/* ==========================
    General Layout and Reset
========================== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
    background: #f7fafc;
    color: #222;
    min-height: 100vh;
    box-sizing: border-box;
  }
  
  /* Ensure the page takes full height and columns flow as intended */
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  
  /* ==========================
      Header
  ========================== */
  header {
    background: #232a32;
    color: #fff;
    padding: 0.7rem 0;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
  }
  .header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.6rem;
  }
  h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
  }
  
  /* ==========================
      Avatar and User Dropdown
  ========================== */
  .user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
  }
  
  .user-avatar {
    width: 44px;
    height: 44px;
    background: #2497f3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 2px 6px rgba(44, 62, 80, 0.13);
    cursor: pointer;
    user-select: none;
    transition: box-shadow 0.12s;
  }
  .user-avatar:hover,
  .user-avatar:focus {
    box-shadow: 0 2px 8px #2497f38a;
  }
  
  /* Popover User Menu */
  .user-menu {
    position: absolute;
    right: 0;
    top: 50px;
    background: #232a32;
    color: #fff;
    border-radius: 10px;
    min-width: 165px;
    box-shadow: 0 2px 12px rgba(44, 62, 80, 0.15);
    overflow: hidden;
    display: none;
    z-index: 999;
    transition: opacity 0.16s;
  }
  .user-menu:not(.hidden) {
    display: flex;
    flex-direction: column;
  }
  .user-menu button {
    background: none;
    border: none;
    color: #fff;
    padding: 14px 22px;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
  }
  .user-menu button:hover {
    background: #2497f3;
    color: #fff;
  }
  
  /* ==========================
      Card-Like Content
  ========================== */
  .guidelines, #upload-section, #results-section {
    margin: 2.5rem auto 0 auto;
    padding: 2rem 2.2rem;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 6px 24px 0 rgba(34,51,84,0.08);
    max-width: 900px;
    width: 90%;
  }
  
  .guidelines {
    margin-top: 2.6rem;
  }
  .guidelines h2, #upload-section h2, #results-section h2 {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
  }
  .guidelines ul, .guidelines p {
    text-align: left;
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
  }
  
  #upload-section {
    margin-top: 2.5rem;
  }
  #upload-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
  }
  #upload-form label {
    font-weight: 500;
  }
  #upload-form input[type="file"] {
    border: 1.5px solid #e2e8f0;
    padding: 8px;
    border-radius: 6px;
    background: #f9fafb;
    font-size: 1rem;
  }
  #upload-form button {
    background: #2497f3;
    color: #fff;
    padding: 12px 36px;
    border: none;
    border-radius: 7px;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s;
    margin-top: 8px;
  }
  #upload-form button:hover {
    background: #1771c6;
  }
  
  /* ==========================
      Modal Styles
  ========================== */
  .modal {
    display: none;               /* Hide by default */
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(44, 62, 80, 0.13);
    align-items: center;
    justify-content: center;
    z-index: 1000;
  }
  .modal:not(.hidden) {
    display: flex !important;   /* Show when JS toggles .hidden off */
  }
  .modal-content {
    background: #fff;
    border-radius: 18px;
    padding: 2.2rem 1.7rem 1.8rem 1.7rem;
    min-width: 320px;
    max-width: 96vw;
    box-shadow: 0 8px 32px rgba(44, 62, 80, 0.13);
    position: relative;
    text-align: center;
    animation: popupIn 0.19s;
  }
  @keyframes popupIn {
    from { transform: scale(0.93) translateY(15px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
  }
  .close-btn, .close-button {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 2;
    transition: color 0.17s;
  }
  .close-btn:hover, .close-button:hover { color: #2497f3; }
  
  /* Hide modals when .hidden is present */
  .hidden { display: none !important; }
  
  /* ==========================
      Footer - Sticky or Push
  ========================== */
  footer {
    width: 100%;
    background: #232a32;
    color: #fff;
    text-align: center;
    padding: 15px 0 12px 0;
    font-size: 1.07rem;
    margin-top: auto; /* Pushes footer to bottom if not enough content */
    letter-spacing: 0.04em;
  }
  
  /* ==========================
      Responsive Design
  ========================== */
  @media (max-width: 900px) {
    .guidelines, #upload-section, #results-section {
      max-width: 99vw;
      padding: 1.3rem 0.7rem;
    }
    .header-container {
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
      padding: 0 0.8rem;
    }
  }
  
  @media (max-width: 600px) {
    h1 {
      font-size: 1.25rem;
    }
    .guidelines h2, #upload-section h2, #results-section h2 {
      font-size: 1.16rem;
    }
    .user-avatar {
      width: 38px;
      height: 38px;
      font-size: 1rem;
    }
    .modal-content {
      min-width: 210px;
      padding: 1.3rem 0.5rem 1.1rem 0.5rem;
    }
  }
  
  /* ==========================
      Accessibility and Usability
  ========================== */
  button, .user-avatar {
    outline: none;
  }
  button:focus, .user-avatar:focus {
    outline: 2px solid #2497f3;
    outline-offset: 1px;
  }
  
  /* ==========================
      Utility Classes
  ========================== */
  .center {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(34,51,84,0.08);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 95vw;
  }
  
  /* ==========================
   Navigation Bar
========================== */
.nav-links {
    display: flex;
    gap: 1.6rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .nav-links li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0.02em;
    font-size: 1.07rem;
    padding: 7px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.13s, border-bottom 0.18s;
  }
  .nav-links li a:hover,
  .nav-links li a.active {
    color: #2497f3;
    border-bottom: 2px solid #2497f3;
  }
  
  /* ==========================
     Hero Section
  ========================== */
  .hero {
    width: 100%;
    background: linear-gradient(110deg, #2497f3 0%, #232a32 100%);
    color: #fff;
    padding: 60px 0 50px 0;
    text-align: center;
  }
  .hero-content {
    max-width: 650px;
    margin: 0 auto;
    padding: 0 1rem;
  }
  .hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: 0.01em;
  }
  .hero p {
    font-size: 1.19rem;
    margin-bottom: 30px;
  }
  .cta-btn {
    display: inline-block;
    padding: 13px 36px;
    background: #fff;
    color: #2497f3;
    border-radius: 7px;
    font-weight: 600;
    font-size: 1.13rem;
    border: none;
    cursor: pointer;
    transition: background 0.13s, color 0.13s, box-shadow 0.17s;
    box-shadow: 0 2px 12px #232a3226;
    text-decoration: none;
  }
  .cta-btn:hover {
    background: #2497f3;
    color: #fff;
  }
  
  /* ==========================
     Intro (Mission) Section
  ========================== */
  .intro {
    margin: 0 auto;
    display: flex;
    justify-content: center;
    padding: 32px 0;
    background: #f5faff;
  }
  .intro-card {
    background: #fff;
    box-shadow: 0 4px 20px rgba(44, 62, 80, 0.09);
    border-radius: 16px;
    padding: 2.3rem 2.2rem 1.5rem 2.2rem;
    max-width: 650px;
    width: 96vw;
    text-align: left;
  }
  .intro-card h2 {
    font-size: 1.56rem;
    font-weight: 700;
    margin-bottom: 1.1rem;
    color: #222;
  }
  .intro-card ul {
    font-size: 1.1rem;
    color: #232a32;
    margin-left: 1.3rem;
    margin-bottom: 0;
  }
  .intro-card ul li {
    margin-bottom: 0.52rem;
    line-height: 1.5;
  }
  
  @media (max-width: 700px) {
    .hero h2 { font-size: 1.27rem; }
    .intro-card, .hero-content { padding: 1.2rem 0.5rem; }
  }
  
  /* Card for upload/results on landing page */
  .card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(34,51,84,0.08);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 95vw;
  }
  
  .container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.2rem;
  }
  
  /* Responsive nav + content */
  @media (max-width: 800px) {
    .header-container { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
    .nav-links { gap: 0.8rem; }
  }
  
  @media (max-width: 600px) {
    .intro, .hero, .container { padding-left: 0.4rem; padding-right: 0.4rem; }
    .intro-card { padding: 0.7rem; }
  }
  /* ==========================
   Thesis Summary / About Section
========================== */
.thesis-summary {
    background: linear-gradient(98deg, #eaf3fa 30%, #f7fafc 100%);
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(44, 62, 80, 0.09);
    margin: 2.2rem auto 2.6rem auto;
    padding: 2rem 2.4rem;
    max-width: 820px;
    font-size: 1.08rem;
    color: #232a32;
    line-height: 1.68;
  }
  .thesis-summary h2 {
    color: #2497f3;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
  }
  .thesis-summary ul {
    margin: 1.1rem 0 1.1rem 1.6rem;
    padding-left: 0;
  }
  .thesis-summary ul li {
    margin-bottom: 0.45rem;
    list-style: disc;
  }
  .thesis-summary details {
    margin-top: 1.2rem;
    background: #f3f8fd;
    border-radius: 7px;
    padding: 1rem 1.2rem;
    color: #222;
    box-shadow: 0 2px 8px rgba(44,62,80,0.05);
  }
  .thesis-summary summary {
    font-weight: 600;
    color: #2497f3;
    cursor: pointer;
    outline: none;
    margin-bottom: 0.5rem;
  }
  @media (max-width: 650px) {
    .thesis-summary { padding: 1rem 0.5rem; }
  }
  .details-inner {
    margin-top: 0.5rem;
    color: #2d3b4d;
    font-size: 1.01rem;
    padding-left: 0.2rem;
  }
  .details-inner h3 {
    font-size: 1.09rem;
    color: #3c8dde;
    margin-bottom: 0.4rem;
  }
  .details-inner a {
    color: #2877c3;
    text-decoration: underline dotted;
  }
  @media (max-width: 600px) {
    .details-inner { font-size: 0.97rem; }
  }
  
    /* ==========================
   About Page Specific
========================== */

.about-main {
    padding: 2rem 0 4rem 0;
    max-width: 960px;
    margin: 0 auto;
  }
  .about-hero {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
  }
  .about-intro {
    text-align: center;
  }
  .profile-img {
    width: 108px;
    height: 108px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #2d3748;
    margin-bottom: 1rem;
    background: #fff;
  }
  .about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
  }
  .about-card {
    background: #fff;
    box-shadow: 0 2px 8px rgba(44,62,80,0.08);
    border-radius: 10px;
    padding: 1.5rem 2rem;
    max-width: 450px;
    flex: 1 1 320px;
  }
  .mission-card blockquote {
    font-style: italic;
    color: #007BFF;
    margin: 1rem 0;
    padding-left: 1rem;
    border-left: 3px solid #007BFF;
    background: #f6f9fc;
  }
  .values-card ul {
    list-style: none;
    padding: 0;
  }
  .values-card li {
    margin: 0.5rem 0;
    font-size: 1.08rem;
  }
  .external-link {
    color: #007BFF;
    text-decoration: underline;
    font-weight: bold;
  }
  .external-link:hover {
    color: #0056b3;
    text-decoration: underline;
  }
  
  @media (max-width: 768px) {
    .about-content {
      flex-direction: column;
      gap: 1.2rem;
    }
    .about-card {
      max-width: 100%;
    }
  }
  /* ==========================
   Contact Form Styles
========================== */
.contact-section {
    background: #f6f9fc;
    padding: 3rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .contact-section .container {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(44,62,80,0.07);
    padding: 2rem 2rem 1.5rem 2rem;
  }
  
  .section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1.8rem;
    color: #2d3748;
    font-weight: 600;
  }
  
  .contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
  }
  
  .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }
  
  .form-label {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.1rem;
  }
  .form-label span {
    color: #e53e3e;
    margin-left: 1px;
  }
  
  .form-input {
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.65rem 0.9rem;
    font-size: 1rem;
    background: #f7fafc;
    color: #222;
    transition: border-color 0.2s;
  }
  .form-input:focus {
    outline: none;
    border-color: #3182ce;
    background: #fff;
  }
  
  .contact-btn {
    background: #007bff;
    color: #fff;
    padding: 0.9rem 1.3rem;
    font-size: 1.08rem;
    font-weight: 600;
    border: none;
    border-radius: 7px;
    margin-top: 0.6rem;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(44,62,80,0.07);
    transition: background 0.2s;
  }
  .contact-btn:hover, .contact-btn:focus {
    background: #0056b3;
  }
  
  @media (max-width: 600px) {
    .contact-section .container {
      padding: 1.2rem 0.7rem 1rem 0.7rem;
    }
    .section-title {
      font-size: 1.3rem;
    }
  }
  
/* ==========================
   Auth Page Styles
========================== */
.auth-main {
    min-height: 100vh;
    background: linear-gradient(110deg, #eef4fb 60%, #d1e4ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .auth-card {
    background: #fff;
    padding: 2.5rem 2rem 2rem 2rem;
    border-radius: 18px;
    box-shadow: 0 6px 30px rgba(44, 62, 80, 0.10), 0 1.5px 8px rgba(44, 62, 80, 0.03);
    max-width: 400px;
    width: 100%;
    text-align: center;
    margin: 2rem auto;
    transition: box-shadow 0.3s;
  }
  
  .auth-title {
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #1a365d;
    font-weight: 700;
    letter-spacing: 1px;
  }
  
  .auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    width: 100%;
  }
  
  .form-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .form-label {
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #2d3748;
    font-size: 1rem;
  }
  .form-label span {
    color: #e53e3e;
    margin-left: 1px;
  }
  
  .form-input {
    width: 100%;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    background: #f7fafc;
    color: #222;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s;
  }
  .form-input:focus {
    outline: none;
    border-color: #3182ce;
    background: #fff;
  }
  
  .cta-btn, .auth-btn {
    background: #007bff;
    color: #fff;
    font-weight: 600;
    padding: 0.95rem 1.4rem;
    border: none;
    border-radius: 8px;
    font-size: 1.08rem;
    cursor: pointer;
    transition: background 0.16s;
    margin-top: 0.6rem;
    box-shadow: 0 1.5px 6px rgba(44, 62, 80, 0.09);
  }
  .cta-btn:hover, .auth-btn:hover, .cta-btn:focus, .auth-btn:focus {
    background: #0056b3;
  }
  
  .signup-link {
    margin-top: 1.6rem;
    font-size: 1rem;
  }
  .signup-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.14s;
  }
  .signup-link a:hover {
    color: #0056b3;
    text-decoration: underline;
  }
  
  /* Responsive */
  @media (max-width: 540px) {
    .auth-card {
      padding: 1.3rem 0.5rem 1.2rem 0.5rem;
      border-radius: 10px;
    }
    .auth-title { font-size: 1.3rem; }
  }
  @media (max-width: 540px) {
    .auth-main {
      padding-top: 2rem;
      padding-bottom: 2rem;
    }
  }
  
  /* ==========================
   Admin Dashboard Styles
========================== */

.admin-wrapper {
    display: flex;
    min-height: 100vh;
    background: #f7fafc;
  }
  
  .admin-sidebar {
    background: #232f3e;
    color: #fff;
    width: 260px;
    min-height: 100vh;
    padding: 0 0 30px 0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 10;
  }
  
  .admin-logo {
    display: flex;
    align-items: center;
    padding: 30px 30px 24px 30px;
    border-bottom: 1px solid #1a2330;
  }
  .admin-avatar {
    width: 42px;
    height: 42px;
    background: #29a3ef;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 22px;
    margin-right: 12px;
    box-shadow: 0 2px 6px rgba(40,180,255,0.12);
  }
  .admin-title {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 1px;
  }
  
  .admin-nav {
    list-style: none;
    padding: 0;
    margin: 28px 0 0 0;
    flex: 1;
  }
  .admin-nav li {
    margin-bottom: 4px;
  }
  .admin-nav a {
    color: #e2e8f0;
    text-decoration: none;
    display: block;
    padding: 13px 36px;
    font-size: 1.08rem;
    border-left: 4px solid transparent;
    transition: all 0.15s;
    border-radius: 0 18px 18px 0;
  }
  .admin-nav a.active,
  .admin-nav a:hover {
    background: #19202b;
    color: #4fd1c5;
    border-left: 4px solid #29a3ef;
  }
  
  .admin-main {
    margin-left: 260px;
    padding: 40px 32px 32px 32px;
    width: 100%;
    min-height: 100vh;
  }
  
  @media (max-width: 900px) {
    .admin-sidebar { width: 60px; padding: 0;}
    .admin-logo { padding: 24px 8px 16px 8px; flex-direction: column; align-items: flex-start;}
    .admin-avatar { margin: 0 0 5px 0;}
    .admin-title { font-size: 1.0rem; }
    .admin-main { margin-left: 60px; padding: 24px 10px; }
    .admin-nav a { padding: 13px 18px; font-size: 1.0rem; }
  }
  
  /* Table Styling */
  .admin-main table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 32px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(40,80,120,0.07);
  }
  
  .admin-main th, .admin-main td {
    padding: 16px 12px;
    text-align: left;
  }
  
  .admin-main th {
    background: #f1f5f9;
    color: #1e293b;
    font-size: 1.08rem;
    font-weight: 700;
    border-bottom: 1px solid #e2e8f0;
  }
  .admin-main td {
    font-size: 1rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
  }
  
  .admin-main tr:last-child td {
    border-bottom: none;
  }
  
  /* Buttons */
  .admin-main button,
  .admin-main input[type="submit"] {
    padding: 6px 16px;
    background: #29a3ef;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    margin-right: 4px;
    cursor: pointer;
    transition: background 0.16s;
  }
  
  .admin-main button:hover,
  .admin-main input[type="submit"]:hover {
    background: #1586d3;
  }
  
  .admin-main .edit-btn { background: #ffc107; color: #222; }
  .admin-main .edit-btn:hover { background: #e0a800; }
  .admin-main .delete-btn { background: #f87171; color: #fff;}
  .admin-main .delete-btn:hover { background: #dc2626; }
  
  .admin-main .add-user-form input,
  .admin-main .add-user-form select {
    padding: 8px;
    margin-right: 12px;
    border-radius: 5px;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
  }
  
  .admin-main .add-user-form button {
    padding: 8px 20px;
    background: #4fd1c5;
    color: #0f172a;
    font-weight: 600;
    border-radius: 5px;
    border: none;
    transition: background 0.18s;
  }
  .admin-main .add-user-form button:hover {
    background: #2ec3b6;
    color: #fff;
  }
  
  .admin-main h2, .admin-main h3 {
    color: #263159;
    margin-bottom: 20px;
  }
  
  /* Responsive table */
  @media (max-width: 700px) {
    .admin-main table, .admin-main thead, .admin-main tbody, .admin-main th, .admin-main td, .admin-main tr { display: block; width: 100%; }
    .admin-main th { display: none; }
    .admin-main td { padding: 12px 10px; border: none; border-bottom: 1px solid #eee;}
    .admin-main tr { margin-bottom: 16px; background: #fff;}
    .admin-main td::before {
      content: attr(data-label);
      font-weight: bold;
      color: #888;
      display: block;
      margin-bottom: 2px;
    }
  }
  
  /* Add New User Form */
  .add-user-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 24px;
  }
  @media (max-width: 500px) {
    .add-user-form {
      flex-direction: column;
      align-items: stretch;
      gap: 0;
    }
  }
  