html {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: "Roboto", sans-serif;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Intro overlay with canvas animation */
.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 9999;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.5s ease-out;
}

.intro-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Main content fade-in after intro */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.8s ease-in;
}

.main-content.visible {
  opacity: 1;
}

.text-container {
  text-align: center;
  position: relative;
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-style: italic;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.dumbaf {
  font-size: 24rem;
  font-weight: bold;
  color: rgb(0, 71, 90);
  margin: 0;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.cse-btn {
  padding: 1rem 2rem;
  font-size: 1rem;
  cursor: pointer;
  background-color: rgb(0, 71, 90);
  color: white;
  border: 2px solid rgb(0, 71, 90);
  border-radius: 84px;
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.noticeboard-btn {
  padding: 1rem 2rem;
  font-size: 1rem;
  cursor: pointer;
  background-color: rgb(0, 71, 90);
  color: white;
  border: 2px solid rgb(0, 71, 90);
  border-radius: 84px;
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  display: inline-block;
  position: relative;
}

.resources-idcard-btn {
  padding: 1rem 2rem;
  font-size: 1rem;
  cursor: pointer;
  background-color: rgb(0, 71, 90);
  color: white;
  border: 2px solid rgb(0, 71, 90);
  border-radius: 84px;
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  display: inline-block;
  position: relative;
}

.cse-btn:hover {
  background-color: white;
  color: rgb(0, 71, 90);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.noticeboard-btn:hover {
  background-color: white;
  color: rgb(0, 71, 90);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}


.resources-idcard-btn:hover {
  background-color: white;
  color: rgb(0, 71, 90);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.resources-idcard-btn[title]:hover:after {
  content: attr(title);
  white-space: pre-line;
  position: absolute;
  left: 50%;
  top: 110%;
  transform: translateX(-50%);
  background: #fff;
  color: #00475a;
  border: 1px solid #00475a;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  z-index: 10;
  min-width: 220px;
  text-align: left;
}

.noticeboard-btn[title]:hover:after {
  content: attr(title);
  white-space: pre-line;
  position: absolute;
  left: 50%;
  top: 110%;
  transform: translateX(-50%);
  background: #fff;
  color: #00475a;
  border: 1px solid #00475a;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  z-index: 10;
  min-width: 220px;
  text-align: left;
}

.semester-container {
  display: none;
  text-align: center;
  margin-top: 1rem;
}

.semester-row {
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
}

.semester-link {
  color: rgb(29, 29, 138);
  text-decoration: none;
  margin: 0 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.semester-link:hover {
  background-color: rgba(29, 29, 138, 0.1);
  color: rgb(0, 0, 100);
}

footer {
  padding: 1rem 2rem;
  background-color: #f8f9fa;
  border-top: 1px solid #e7e7e7;
  width: 100%;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.footer-left {
  flex: 1;
}

.footer-center {
  flex: 2;
  text-align: center;
}

.footer-center p {
  margin: 0;
}

.footer-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.contribution-btn {
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  background-color: rgb(0, 71, 90);
  color: white;
  border: 2px solid rgb(0, 71, 90);
  border-radius: 84px;
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  white-space: nowrap;
}

.contribution-btn:hover {
  background-color: white;
  color: rgb(0, 71, 90);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.contribution-btn:active {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.visitor-counter {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: #666;
}

#visit-count {
  font-weight: bold;
  margin-left: 4px;
}

@media (max-width: 600px) {
  .visitor-counter {
    justify-content: center;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 1200px) {
  .dumbaf {
    font-size: 12rem;
  }
}

@media (max-width: 1024px) {
  .dumbaf {
    font-size: 10rem;
  }
}

@media (max-width: 992px) {
  .dumbaf {
    font-size: 8rem;
  }
}

@media (max-width: 768px) {
  .dumbaf {
    font-size: 6rem;
  }

  .cse-btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }

  .noticeboard-btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }

  .contribution-btn {
    padding: 0.7rem 1.2rem;
    font-size: 0.85rem;
  }

  footer {
    padding: 1rem;
  }
}

@media (max-width: 600px) {
  footer {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .footer-left,
  .footer-center,
  .footer-right {
    flex: none;
    width: 100%;
  }

  .footer-right {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .dumbaf {
    font-size: 5.5rem;
  }

  .cse-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    width: 85%;
    max-width: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    text-align: center;
  }

  .noticeboard-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    width: 85%;
    max-width: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    text-align: center;
  }

  .semester-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  .contribution-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    width: auto;
    min-width: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 84px;
  }

  .resources-idcard-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    width: 85%;
    max-width: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    text-align: center;
  }
}

@media (max-width: 360px) {
  .dumbaf {
    font-size: 5rem;
  }
}

:root {
    --primary-color: rgb(0, 71, 90);
    --primary-color-dark: rgb(0, 50, 63);
    --light-bg-color: #f8f9fa;
    --white-color: #fff;
    --text-color: #333;
    --border-color: #e0e0e0;
    --success-color: #2e7d32;
    --success-bg: #e8f5e9;
    --error-color: #c62828;
    --error-bg: #ffebee;
    --font-family: 'Roboto', sans-serif;
    --border-radius: 84px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 8px rgba(0, 0, 0, 0.15);
}

body.noticeboard-page {
    font-family: var(--font-family);
    background-color: var(--light-bg-color);
    color: var(--text-color);
    margin: 0;
}

.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 1rem;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.header p {
    font-size: 1.2rem;
    color: #666;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    background-color: var(--white-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 120px;
    max-width: 100%;
    white-space: nowrap;
}

.back-btn:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    box-shadow: var(--shadow-hover);
}

@media (max-width: 600px) {
  body.noticeboard-page .back-btn {
    position: static;
    display: block;
    width: 100%;
    margin: 0 0 1rem 0;
    text-align: center;
    font-size: 1rem;
    padding: 0.9rem 1.2rem;
    border-radius: 8px;
    min-width: 0;
    box-sizing: border-box;
  }
}

@media (max-width: 768px) {
    .back-btn {
        position: static;
        display: block;
        text-align: center;
        margin: 0 auto 1rem;
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        max-width: 280px;
        box-sizing: border-box;
        min-width: 0;
    }
}

.controls {
    background: var(--white-color);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.search-container {
    display: flex;
    flex-grow: 1;
    min-width: 300px;
}

.search-input {
    flex-grow: 1;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    border-right: none;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.refresh-btn {
    padding: 0.8rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    background-color: var(--primary-color);
    color: var(--white-color);
    border: 2px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    transition: background-color 0.3s;
}

.refresh-btn:hover {
    background-color: var(--primary-color-dark);
}

.toggle-container, .page-size-container, .date-filter-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-filter-container {
    flex-wrap: wrap;
    gap: 0.3rem 0.5rem;
}

.date-input {
    padding: 0.5rem;
    font-size: 0.9rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    transition: border-color 0.3s;
    max-width: 140px;
}

.date-input:focus {
    border-color: var(--primary-color);
}

.clear-date-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.clear-date-btn:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.stats {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.status-success {
    color: var(--success-color);
    background-color: var(--success-bg);
}

.status-error {
    color: var(--error-color);
    background-color: var(--error-bg);
}

#errorContainer {
    padding: 0 1.5rem 1.5rem;
    display: none;
}

.hidden {
    display: none !important;
}

.table-container {
    background: var(--white-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

th, td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

table th:nth-child(1), 
table td:nth-child(1) {
    width: 60px;
    text-align: center;
}

table th:nth-child(2), 
table td:nth-child(2) {
    width: auto;
}

table th:nth-child(3), 
table td:nth-child(3) {
    width: 120px;
}

table th:nth-child(4), 
table td:nth-child(4) {
    width: 100px;
    text-align: center;
}

thead th {
    background-color: var(--primary-color);
    color: var(--white-color);
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 1;
}

.notice-title {
    font-weight: 500;
}

.download-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
}

.download-link:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.loading {
    text-align: center;
    padding: 3rem;
    margin: 1.5rem 0;
    background: var(--white-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#errorContainer {
    padding: 1.5rem;
    margin: 1.5rem 0;
    background: var(--white-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.error {
    background: var(--error-bg);
    color: var(--error-color);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 5px solid var(--error-color);
}

.retry-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    background-color: var(--primary-color);
    color: var(--white-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
}

.retry-btn:hover {
    background-color: var(--white-color);
    color: var(--primary-color);
}

.pagination {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-top: 20px;
    background: var(--white-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
    width: 100%;
    box-sizing: border-box;
}

.pagination button {
    width: 120px;
    padding: 10px 15px;
    font-size: 16px;
    background: var(--white-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    text-align: center;
    display: inline-block;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-color);
    color: var(--white-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
    color: #666;
}

#pageInfo {
    text-align: center;
    font-size: 16px;
    flex: 0 0 auto;
    padding: 0 10px;
}

.hidden {
    display: none !important;
}

@media (max-width: 900px) {
    body.noticeboard-page .container {
        padding: 0.5rem;
        margin: 0.5rem auto;
        max-width: 100vw;
    }

    body.noticeboard-page .header {
        margin-bottom: 1rem;
        padding-top: 0.5rem;
    }

    body.noticeboard-page .header h1 {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 0.3rem;
    }

    body.noticeboard-page .header p {
        font-size: 1rem;
        margin: 0;
    }

    body.noticeboard-page .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.7rem;
        padding: 0.7rem;
        border-radius: 8px;
        margin-bottom: 1rem;
    }

    body.noticeboard-page .toggle-container,
    body.noticeboard-page .page-size-container,
    body.noticeboard-page .date-filter-container {
        font-size: 0.95rem;
        gap: 0.5rem;
        justify-content: space-between;
        flex-wrap: wrap;
        margin-bottom: 0.3rem;
    }

    body.noticeboard-page .pagination {
        flex-direction: row !important;
        padding: 0.8rem 0.5rem;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    body.noticeboard-page .pagination button {
        flex: 0 0 auto;
        min-width: 100px;
        font-size: 0.95rem;
        padding: 0.8rem 0.5rem;
        display: inline-block;
    }
}

@media (max-width: 600px) {
    body.noticeboard-page .download-link {
        min-height: 36px;
        min-width: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0;
        padding: 0;
        border-radius: 6px;
    }
    
    body.noticeboard-page .download-link::before {
        content: "📄";
        font-size: 1.2rem;
    }

    body.noticeboard-page .header h1 {
        font-size: 1.2rem;
    }

    body.noticeboard-page .header p {
        font-size: 0.85rem;
    }
    
    body.noticeboard-page .pagination {
        flex-direction: row !important;
        gap: 0.3rem;
    }
    
    body.noticeboard-page .pagination button {
        min-width: 80px;
        font-size: 0.9rem;
        padding: 0.7rem 0.4rem;
        display: inline-block;
    }
    
    body.noticeboard-page #pageInfo {
        font-size: 0.85rem;
        white-space: nowrap;
        padding: 0 0.3rem;
    }

    body.noticeboard-page table {
        font-size: 0.75rem;
        min-width: 400px;
        table-layout: fixed;
    }
    
    body.noticeboard-page th:nth-child(1),
    body.noticeboard-page td:nth-child(1) {
        width: 30px;
        padding: 0.3rem 0.2rem;
        text-align: center;
        font-size: 0.7rem;
    }
    
    body.noticeboard-page th:nth-child(2),
    body.noticeboard-page td:nth-child(2) {
        width: 50%;
        padding: 0.5rem 0.3rem;
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
    }
    
    body.noticeboard-page th:nth-child(3),
    body.noticeboard-page td:nth-child(3) {
        width: 70px;
        white-space: nowrap;
        padding: 0.3rem;
        font-size: 0.7rem;
    }
    
    body.noticeboard-page th:nth-child(4),
    body.noticeboard-page td:nth-child(4) {
        width: 38px;
        padding: 0.3rem 0.1rem;
        text-align: center;
    }
    
    body.noticeboard-page .table-container {
        margin: 0;
        padding: 0;
        border-radius: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        position: relative;
    }
    
    body.noticeboard-page .table-container::-webkit-scrollbar {
        height: 4px;
    }
    
    body.noticeboard-page .table-container::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 4px;
    }
    
    body.noticeboard-page .download-link {
        min-height: 28px;
        min-width: 28px;
        padding: 0;
        border-width: 1px;
    }
    
    body.noticeboard-page .download-link::before {
        content: "📄";
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    body.noticeboard-page .container {
        padding: 0.3rem;
        margin: 0.3rem auto;
    }

    body.noticeboard-page .controls {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    body.noticeboard-page .toggle-container,
    body.noticeboard-page .page-size-container {
        flex-wrap: nowrap;
        width: 100%;
    }

    body.noticeboard-page .toggle-container label,
    body.noticeboard-page .page-size-container label {
        font-size: 0.85rem;
    }

    body.noticeboard-page .date-input {
        max-width: 100%;
    }

    body.noticeboard-page .pagination {
        flex-direction: row !important;
    }

    body.noticeboard-page .pagination button {
        min-width: 70px;
        font-size: 0.8rem;
        padding: 0.6rem 0.4rem;
        display: inline-block;
    }

    body.noticeboard-page #pageInfo {
        font-size: 0.75rem;
    }

    body.noticeboard-page .table-container::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 15px;
        height: 100%;
        background: linear-gradient(to right, transparent, rgba(0,0,0,0.05));
        pointer-events: none;
    }
}

@media (max-height: 700px) and (max-width: 600px) {
    body.noticeboard-page .pagination {
        position: sticky;
        bottom: 0.5rem;
        z-index: 2;
        margin-top: 0.5rem;
    }
  
    body.noticeboard-page .container {
        margin-bottom: 3.5rem;
    }
}