* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    background: #ffffff;
    min-height: 100vh;
    color: #333;
    font-size: 10pt;
    text-align: left;
    margin: 0;
    padding: 0;
    padding-top: 110px; /* Space for fixed header - increased to prevent content cutoff */
}

/* Global heading alignment */
h1, h2, h3, h4, h5, h6 {
    text-align: left;
}

/* Header Styles */
.header {
    background: white;
    padding: 1.5rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid #f0f0f0;
}

/* Admin Header Styling */
body.admin-page .header {
    background: #f8f9fa;
    border-bottom: 2px solid #2d5f3f;
}

body.admin-page .nav-link {
    color: #666 !important;
    opacity: 0.7 !important;
    text-decoration: none !important;
}

body.admin-page .nav-link:hover {
    color: #2d5f3f !important;
    opacity: 1 !important;
    text-decoration: none !important;
}

body.admin-page .nav-item a {
    color: #666 !important;
    opacity: 0.7 !important;
    text-decoration: none !important;
}

body.admin-page .nav-item a:hover {
    color: #2d5f3f !important;
    opacity: 1 !important;
    text-decoration: none !important;
}

/* Override any visited/active link styles in admin */
body.admin-page a:visited,
body.admin-page a:active,
body.admin-page .nav-link:visited,
body.admin-page .nav-link:active,
body.admin-page .nav-item a:visited,
body.admin-page .nav-item a:active {
    color: #666 !important;
    text-decoration: none !important;
    opacity: 0.7 !important;
}

body.admin-page a:visited:hover,
body.admin-page a:active:hover,
body.admin-page .nav-link:visited:hover,
body.admin-page .nav-link:active:hover,
body.admin-page .nav-item a:visited:hover,
body.admin-page .nav-item a:active:hover {
    color: #2d5f3f !important;
    text-decoration: none !important;
    opacity: 1 !important;
}



.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 3rem;
    flex-wrap: nowrap;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: bold;
    color: #333;
    font-size: 11pt;
    flex-shrink: 0;
    margin-right: 4rem; /* Add extra space after logo */
}

.logo a {
    display: block;
    transition: opacity 0.3s ease;
}

.logo a:hover {
    opacity: 0.8;
}

.logo img {
    height: auto;
    width: auto;
    max-height: 45px;
    max-width: 200px;
    object-fit: contain;
    display: block;
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 1rem; /* Reduced gap for more compact nav items */
    flex-shrink: 0;
    flex: 1; /* Take up remaining space */
}

.nav-item {
    display: flex;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #555;
    font-weight: 400;
    padding: 0.75rem 0.75rem; /* Reduced horizontal padding for compactness */
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 10pt;
    white-space: nowrap;
}

.nav-link:hover {
    color: #2d5f3f;
}

.nav-icon {
    display: none;
}

/* Authentication Styles */
.auth-item {
    position: relative;
    flex-shrink: 0; /* Prevent the auth item from shrinking */
    margin-left: auto; /* Push to the right */
}

.user-profile {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    min-width: 40px; /* Ensure minimum width */
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile:hover {
    background-color: #f5f5f5;
}

.profile-icon {
    color: #555;
    transition: color 0.3s ease;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.user-profile:hover .profile-icon {
    color: #2d5f3f;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px; /* Reduced from 200px to save space */
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    white-space: nowrap; /* Prevent text wrapping */
}

.profile-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content {
    padding: 0.5rem 0;
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 10pt;
    transition: background-color 0.3s ease;
}

.dropdown-link:hover {
    background-color: #f8f9fa;
    color: #2d5f3f;
}

.user-name {
    display: block;
    padding: 0.75rem 1rem;
    color: #666;
    font-size: 10pt;
    font-weight: 500;
    border-bottom: 1px solid #eee;
}

/* Ensure nav menu has proper flex layout */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1; /* Allow nav menu to grow but keep auth item visible */
}

/* Protected page styles */
.protected-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 1rem;
    margin: 2rem 0;
    text-align: center;
}

.protected-notice h3 {
    color: #856404;
    margin-bottom: 0.5rem;
}

.protected-notice p {
    color: #856404;
    margin: 0;
}

/* Alert Styles */
.alert {
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #2d5f3f;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-body {
    padding: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.cta-button.secondary {
    background: #6c757d;
    border-color: #6c757d;
}

.cta-button.secondary:hover {
    background: #5a6268;
    border-color: #545b62;
}

/* Checkbox and Column Selector Styles */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.form-checkbox {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    accent-color: #2d5f3f;
    cursor: pointer;
}

.checkbox-group .form-label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 500;
}

.column-selector-group {
    margin-left: 1.5rem;
    transition: all 0.3s ease;
}

.column-selector-group.show {
    display: block;
}

.column-selector-group.hide {
    display: none;
}

/* Admin Layout Styles */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 110px);
}

.admin-sidebar {
    width: 188px;
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 2rem 0;
    position: fixed;
    left: 0;
    top: 110px;
    height: calc(100vh - 110px);
    overflow-y: auto;
}

.admin-content {
    flex: 1;
    margin-left: 188px;
    padding: 2rem 3rem;
}

.admin-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-nav li {
    margin: 0;
}

.admin-nav a {
    display: block;
    padding: 1rem 2rem;
    color: #495057;
    text-decoration: none;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
    font-size: 10pt;
}

.admin-nav a:hover {
    background: #e9ecef;
    color: #2d5f3f;
}

.admin-nav a.active {
    background: #2d5f3f !important;
    color: white !important;
    border-left: 4px solid #1e4029 !important;
}

.admin-nav a.active:visited,
.admin-nav a.active:link,
.admin-nav a.active:hover,
.admin-nav a.active:focus {
    color: white !important;
}

/* Stronger override for active admin nav items */
.admin-nav li a.active {
    background: #2d5f3f !important;
    color: #ffffff !important;
    border-left: 4px solid #1e4029 !important;
}

.admin-nav li a.active:visited,
.admin-nav li a.active:link,
.admin-nav li a.active:hover,
.admin-nav li a.active:focus {
    color: #ffffff !important;
    background: #2d5f3f !important;
}

.admin-sidebar h3 {
    padding: 1.5rem 2rem 1rem 2rem;
    margin: 0 0 0.5rem 0;
    color: #2d5f3f;
    font-size: 11pt;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
}

@media (max-width: 768px) {
    .admin-sidebar h3 {
        padding: 1rem 1.5rem 0.75rem 1.5rem;
        margin: 0 0 0.25rem 0;
        font-size: 10pt;
    }
}

/* Responsive admin layout */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
        position: fixed;
        width: 210px;
        background: white;
        border: 1px solid #e9ecef;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        border-radius: 0 12px 12px 0;
        height: auto;
        top: 110px;
        padding: 0;
        overflow: visible;
    }
    
    /* Hide specific admin nav items on mobile */
    .admin-nav li.mobile-hidden {
        display: none !important;
    }
    
    /* Mobile admin nav styling with better contrast */
    .admin-sidebar .admin-nav a {
        color: #2d5f3f !important;
        background: white !important;
        border-bottom: 1px solid #e9ecef !important;
        font-weight: 500 !important;
    }
    
    .admin-sidebar .admin-nav a:hover {
        background: #f8f9fa !important;
        color: #1e4029 !important;
    }
    
    .admin-sidebar .admin-nav a.active {
        background: #2d5f3f !important;
        color: white !important;
        border-left: 4px solid #1e4029 !important;
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
        padding: 6rem 1rem 2rem 1rem;
    }
    
    .mobile-admin-toggle {
        display: block !important;
        position: fixed;
        top: 140px;
        right: 2rem;
        z-index: 1002;
        background: #2d5f3f;
        color: white;
        border: none;
        padding: 0.75rem;
        border-radius: 6px;
        cursor: pointer;
        font-size: 14pt;
        font-weight: bold;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        transition: all 0.3s ease;
    }
    
    .mobile-admin-toggle:hover {
        background: #1e4029;
        transform: scale(1.05);
    }
    
    /* Overlay for mobile sidebar */
    .admin-sidebar.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.2);
        z-index: -1;
    }
}

.mobile-admin-toggle {
    display: none;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Admin Result Cards */
.admin-result-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.admin-result-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.admin-card-content {
    position: relative;
    padding: 2rem;
}

.admin-card-header {
    margin-bottom: 1rem;
}

.admin-card-title {
    font-size: 11pt;
    font-weight: 600;
    color: #2d5f3f;
    margin: 0;
    line-height: 1.4;
}

.admin-card-title a {
    color: #2d5f3f;
    text-decoration: none;
}

.admin-card-title a:hover {
    text-decoration: underline;
}

.admin-card-body {
    margin-bottom: 2.5rem;
}

.admin-field {
    margin: 0.5rem 0;
    font-size: 10pt;
    color: #666;
    line-height: 1.4;
}

.admin-field strong {
    color: #333;
    font-weight: 600;
}

.admin-card-edit {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    padding: 0.5rem;
    border-radius: 6px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-card-edit:hover {
    background: #2d5f3f;
    color: white;
}

.admin-card-edit .edit-icon {
    color: #2d5f3f;
    transition: color 0.3s ease;
}

.admin-card-edit:hover .edit-icon {
    color: white;
}

/* User Management Styles */
.users-card, .add-user-card, .stats-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    margin-bottom: 2rem;
}

.user-list {
    margin-top: 1rem;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #f8f9fa;
}

.user-info h4 {
    margin: 0 0 0.5rem 0;
    color: #2d5f3f;
    font-size: 11pt;
}

.user-info p {
    margin: 0.25rem 0;
    font-size: 9pt;
    color: #666;
}

.user-actions button {
    background: #2d5f3f;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 10pt;
    font-weight: 500;
    transition: all 0.3s ease;
}

.user-actions button:hover:not(:disabled) {
    background: #1e4029;
    transform: translateY(-1px);
}

.user-actions button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.stat-item h4 {
    margin: 0 0 0.5rem 0;
    color: #495057;
    font-size: 10pt;
}

.stat-number {
    font-size: 16pt;
    font-weight: bold;
    color: #2d5f3f;
    margin: 0;
}

/* Alert styles */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 10pt;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Table Display Styles */
.tables-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    margin-bottom: 2rem;
}

.table-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.table-item:last-child {
    margin-bottom: 0;
}

.table-info h4 {
    margin: 0 0 0.5rem 0;
    color: #2d5f3f;
    font-size: 11pt;
    font-weight: 600;
}

.table-meta {
    margin: 0.5rem 0;
    color: #666;
    font-size: 9pt;
}

.table-columns {
    margin: 0.5rem 0 0 0;
    color: #495057;
    font-size: 9pt;
    line-height: 1.4;
}

.no-data-text, .error-text, .loading-text {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
    margin: 0;
}

.error-text {
    color: #dc3545;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.pagination-btn {
    background: white;
    border: 1px solid #d0d7de;
    color: #24292f;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 9pt;
    transition: all 0.2s ease;
    min-width: 40px;
}

.pagination-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #8b949e;
}

.pagination-btn.active {
    background: #2d5f3f;
    border-color: #2d5f3f;
    color: white;
    font-weight: 600;
}

.pagination-btn:disabled {
    background: #f6f8fa;
    color: #8b949e;
    cursor: not-allowed;
}

.pagination-dots {
    color: #656d76;
    padding: 0 0.25rem;
    font-size: 9pt;
}

.page-info {
    margin-left: 1rem;
    color: #656d76;
    font-size: 9pt;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .pagination-container {
        gap: 0.25rem;
    }
    
    .pagination-btn {
        padding: 0.4rem 0.6rem;
        font-size: 8pt;
        min-width: 35px;
    }
    
    .page-info {
        margin-left: 0.5rem;
        font-size: 8pt;
    }
}



/* Main Content */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 3rem;
}

.content-section {
    background: white;
    padding: 0 1rem;
    text-align: left;
}

.hero-section {
    text-align: left;
    padding: 4rem 3rem;
    background: linear-gradient(135deg, #f8fdf9 0%, #e8f5e8 100%);
    margin: -4rem -3rem 4rem -3rem;
}

.hero-section .main-container {
    text-align: left;
}

.hero-section h1 {
    font-size: 18pt;
    color: #2d5f3f;
    margin-bottom: 1.5rem;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
}

.hero-section p {
    color: #666;
    font-size: 10pt;
    max-width: 800px;
    margin: 0 0 2rem 0;
    line-height: 1.6;
    text-align: left;
}

.cta-button {
    display: inline-block;
    background: #2d5f3f;
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 10pt;
    transition: all 0.3s ease;
    margin-top: 1rem;
    text-align: center;
}

.cta-button:hover {
    background: #1e4029;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 95, 63, 0.3);
}

.content-section h1 {
    font-size: 12pt;
    color: #2d5f3f;
    margin-bottom: 0.75rem;
    font-weight: 500;
    text-align: left;
}

.content-section p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 10pt;
    line-height: 1.7;
    max-width: 100%;
    margin-left: 0;
    margin-right: auto;
    text-align: left;
}

/* Features Section */
.features-section {
    margin-top: 0; /* Removed vertical spacing */
    margin-bottom: 3rem; /* Add padding after the cards section */
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 0; /* Removed to eliminate gap */
}

.feature-card {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    text-align: left;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.feature-card h3 {
    color: #2d5f3f;
    font-size: 12pt;
    margin-bottom: 1rem;
    font-weight: 600;
    text-align: left;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 10pt;
}

.feature-link {
    color: #2d5f3f;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 2px solid #2d5f3f;
    border-radius: 6px;
    display: inline-block;
    transition: all 0.3s ease;
}

.feature-link:hover {
    background: #2d5f3f;
    color: white;
}

/* Featured Studies Section */
.featured-studies-section {
    margin-top: 2rem;
}

.study-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    margin-bottom: 2rem;
    text-align: left;
}

.study-card h2 {
    color: #2d5f3f;
    font-size: 14pt;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-align: left;
    line-height: 1.3;
}

.study-meta {
    color: #888;
    font-size: 9pt;
    margin-bottom: 1rem;
    font-style: italic;
    text-align: left;
}

.study-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 10pt;
    text-align: left;
}

.study-highlights {
    background: #f8fdf9;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid #2d5f3f;
}

.study-highlights h3 {
    color: #2d5f3f;
    font-size: 11pt;
    margin-bottom: 1rem;
    font-weight: 600;
    text-align: left;
}

.study-highlights ul {
    margin: 0;
    padding-left: 1.5rem;
    text-align: left;
}

.study-highlights li {
    color: #666;
    margin-bottom: 0.5rem;
    font-size: 10pt;
    line-height: 1.5;
    text-align: left;
}

.study-link {
    display: inline-block;
    background: #2d5f3f;
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 10pt;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.study-link:hover {
    background: #1e4029;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 95, 63, 0.3);
}

/* Registration Form */
.registration-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 100px;
}

.form-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #00bcd4;
    font-size: 1.5rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.required {
    color: #e91e63;
}

.form-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #00bcd4;
    box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.1);
}

.form-help {
    font-size: 9pt;
    color: #666;
    margin-top: 0.25rem;
    display: block;
    font-style: italic;
    text-align: left;
}

.password-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 0.9rem;
}

.password-requirements {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.submit-btn {
    width: 100%;
    background: #00bcd4;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 1rem;
}

.submit-btn:hover {
    background: #00acc1;
}

.login-link {
    text-align: center;
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.login-link a {
    color: #00bcd4;
    text-decoration: none;
}

.login-link a:hover {
    text-decoration: underline;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: none;
    font-size: 10pt;
    text-align: right;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Footer Styles */
.site-footer {
    background: #2d5f3f;
    color: white;
    padding: 3rem 0 2rem 0;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-logo-section {
    text-align: left;
}

.footer-logo {
    margin-bottom: 1.5rem;
}

.footer-logo img {
    height: 60px;
    width: auto;
    filter: brightness(0) invert(1);
}

.footer-description {
    color: #e8f5e8;
    font-size: 10pt;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: white;
    font-size: 12pt;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: left;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #e8f5e8;
    text-decoration: none;
    font-size: 10pt;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-contact {
    color: #e8f5e8;
    font-size: 10pt;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-contact strong {
    color: white;
}

.footer-social {
    margin-top: 1.5rem;
}

.footer-social a {
    display: inline-block;
    margin-right: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: background 0.3s ease;
}

.footer-social a:hover {
    background: rgba(255, 255, 255, 0.2);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 2rem;
    text-align: center;
    color: #e8f5e8;
    font-size: 9pt;
}

.footer-bottom a {
    color: #e8f5e8;
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer-bottom a:hover {
    color: white;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-container {
        padding: 0 1.5rem;
    }
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    margin-right: 1rem;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-container {
        padding: 0 2rem;
    }
    
    .logo {
        margin-right: 2rem;
    }
    
    .nav-menu {
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.5rem;
        font-size: 9pt;
    }
    
    .main-container {
        padding: 2rem 2rem;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 90px; /* Increased padding for mobile header */
    }
    
    .nav-container {
        padding: 1rem 1.5rem;
        position: relative;
    }
    
    .logo {
        margin-right: 1rem;
        flex: 1;
    }
    
    .logo img {
        max-height: 35px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        border-top: 1px solid #f0f0f0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
        gap: 0;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-item {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        display: block;
        padding: 1rem 1.5rem;
        width: 100%;
        font-size: 10pt;
        border-radius: 0;
    }
    
    .auth-item {
        margin-left: 0;
        padding: 1rem 0;
        display: flex;
        justify-content: center;
    }
    
    .upload-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-container {
        padding: 2rem 1.5rem;
    }
    
    .content-section {
        padding: 0 0.5rem;
    }
    
    .content-section h1 {
        font-size: 11pt;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-card {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 80px; /* Increased padding for small mobile screens */
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    .logo img {
        max-height: 30px;
    }
    
    .main-container {
        padding: 1.5rem 1rem;
    }
    
    .content-section h1 {
        font-size: 10pt;
    }
    
    .content-section p {
        font-size: 9pt;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    .feature-card h3 {
        font-size: 11pt;
    }
    
    .feature-card p {
        font-size: 9pt;
    }
    
    .feature-link {
        font-size: 9pt;
        padding: 0.75rem 1.5rem;
    }
}

/* Data Management Styles */
.data-section {
    margin-bottom: 3rem;
}

/* Results section alignment */
#resultsSection {
    margin-top: 0;
    margin-bottom: 2rem;
    order: -1; /* Ensure it appears first in flex layout */
}

#resultsSection .results-card {
    margin-top: 0;
    margin-bottom: 2rem;
    padding: 2rem 2.5rem;
}

#resultsSection .results-card h3 {
    margin-bottom: 0.5rem;
}

/* Edit Modal Styles */
.edit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.edit-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.edit-modal-header h3 {
    margin: 0;
    color: #2d5f3f;
    font-size: 12pt;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #333;
}

.edit-modal-body {
    padding: 2rem;
}

#editFormFields {
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 2rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 10pt;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #2d5f3f;
    color: white;
}

.btn-primary:hover {
    background: #1e4029;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.upload-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.upload-card, .tables-card, .search-card, .results-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.upload-description {
    font-size: 9pt;
    color: #666;
    margin-bottom: 1rem;
    text-align: left;
}

.file-name {
    display: block;
    margin-top: 0.5rem;
    font-size: 9pt;
    color: #2d5f3f;
    font-weight: bold;
}

.upload-card h3, .tables-card h3, .search-card h3, .results-card h3 {
    color: #2d5f3f;
    margin-bottom: 1.5rem;
    font-size: 12pt;
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
    font-size: 10pt;
}

.form-input, .file-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 10pt;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    text-align: left;
}

.form-input:focus, .file-input:focus {
    outline: none;
    border-color: #2d5f3f;
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-size: 8pt;
}

.table-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #2d5f3f;
}

.table-info h4 {
    color: #2d5f3f;
    margin-bottom: 0.5rem;
    font-size: 11pt;
    text-align: left;
}

.table-meta {
    color: #666;
    font-size: 9pt;
    margin-bottom: 0.5rem;
}

.table-columns {
    color: #555;
    font-size: 9pt;
}

.loading-text, .no-data-text, .error-text {
    text-align: left;
    color: #666;
    font-style: italic;
    padding: 2.5rem;
    font-size: 10pt;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.results-table th {
    background: #2d5f3f;
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.results-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.results-table tr:nth-child(even) {
    background: #f8f9fa;
}

.results-table tr:hover {
    background: #e8f5e8;
}

.cta-button[type="submit"] {
    border: none;
    cursor: pointer;
}

.cta-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Research Results Card Styles */
.research-result-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.research-result-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.research-card-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 1rem;
}

.research-card-title {
    margin: 0;
    font-size: 12pt;
    line-height: 1.4;
}

.research-title-link {
    color: #2d5f3f;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.research-title-link:hover {
    color: #1e4029;
    text-decoration: underline;
}

.research-title-text {
    color: #333;
    font-weight: 600;
}

.research-card-content {
    color: #666;
    font-size: 10pt;
    line-height: 1.6;
}

.research-card-content p {
    margin: 0 0 0.75rem 0;
}

.research-card-content p:last-child {
    margin-bottom: 0;
}

.research-publication,
.research-author,
.research-source,
.research-intervention {
    color: #555;
}

.research-publication strong,
.research-author strong,
.research-source strong,
.research-intervention strong {
    color: #2d5f3f;
    font-weight: 600;
}

/* Legacy styles for backward compatibility */
.research-result-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.research-result-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.research-header {
    margin-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.75rem;
}

/* Mobile responsiveness for cards */
@media (max-width: 768px) {
    .research-result-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .research-card-title {
        font-size: 11pt;
    }
    
    .research-card-content {
        font-size: 9pt;
    }
}

@media (max-width: 480px) {
    .research-result-card {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .research-card-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .research-card-title {
        font-size: 10pt;
    }
}

.research-title {
    color: #2d5f3f;
    font-size: 12pt;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    text-align: left;
}

.research-meta {
    color: #666;
    font-size: 9pt;
}

.research-year {
    font-weight: 500;
    color: #2d5f3f;
}

.research-type {
    background: #e8f5e8;
    color: #2d5f3f;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 8pt;
    font-weight: 500;
}

.research-authors, .research-journal {
    margin-bottom: 0.75rem;
    color: #555;
    font-size: 10pt;
}

.research-abstract {
    margin-bottom: 1rem;
    color: #666;
}

.research-abstract p {
    margin-top: 0.5rem;
    line-height: 1.6;
    font-size: 10pt;
}

.research-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.research-link {
    color: #2d5f3f;
    text-decoration: none;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border: 1px solid #2d5f3f;
    border-radius: 4px;
    font-size: 9pt;
    transition: all 0.3s ease;
}

.research-link:hover {
    background: #2d5f3f;
    color: white;
}

.research-tags {
    color: #777;
    font-size: 9pt;
    border-top: 1px solid #f0f0f0;
    padding-top: 0.75rem;
}

/* Responsive adjustments for research results */
@media (max-width: 768px) {
    .research-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .research-link {
        text-align: center;
    }
    
    .research-title {
        font-size: 1.1rem;
    }
}

/* Pagination Styles */
.pagination-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-top: 2px solid #2d5f3f;
}

.pagination-info {
    text-align: left;
    margin-bottom: 1rem;
    color: #666;
    font-size: 9pt;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 9pt;
    transition: all 0.3s ease;
}

.page-btn:hover:not(.disabled) {
    background: #2d5f3f;
    color: white;
    border-color: #2d5f3f;
}

.page-btn.active {
    background: #2d5f3f;
    color: white;
    border-color: #2d5f3f;
    font-weight: 600;
}

.page-btn.disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border-color: #ddd;
}

.page-ellipsis {
    padding: 0.5rem 0.25rem;
    color: #666;
    font-size: 9pt;
}

@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .page-numbers {
        order: 1;
    }
    
    .page-btn {
        padding: 0.4rem 0.6rem;
        font-size: 8pt;
    }
}
/* Statistics Page Styles */
.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-card h3 {
    color: #2d5f3f;
    font-size: 11pt;
    font-weight: 600;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 28pt;
    font-weight: bold;
    color: #2d5f3f;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.stat-description {
    color: #666;
    font-size: 9pt;
    margin: 0;
}

.activity-card, .database-status-card, .controls-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.activity-card h3, .database-status-card h3, .controls-card h3 {
    color: #2d5f3f;
    font-size: 12pt;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

#userActivityContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.activity-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.activity-metric h4 {
    color: #2d5f3f;
    font-size: 10pt;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 20pt;
    font-weight: bold;
    color: #2d5f3f;
    margin-bottom: 0.25rem;
}

.activity-metric p {
    color: #666;
    font-size: 9pt;
    margin: 0;
}

#databaseStatusContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.status-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.status-item h4 {
    color: #2d5f3f;
    font-size: 10pt;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.status-value {
    font-size: 14pt;
    font-weight: 600;
    color: #333;
    word-break: break-word;
}

.controls-container {
    text-align: center;
}

.control-description {
    color: #666;
    font-size: 9pt;
    margin-top: 1rem;
}

/* Mobile responsive adjustments for statistics */
@media (max-width: 768px) {
    .statistics-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-value {
        font-size: 22pt;
    }
    
    .activity-card, .database-status-card, .controls-card {
        padding: 1.5rem;
    }
    
    #userActivityContainer, #databaseStatusContainer {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 18pt;
    }
    
    .metric-value {
        font-size: 16pt;
    }
    
    .activity-card, .database-status-card, .controls-card {
        padding: 1rem;
    }
}
