/* Color Variables */
:root {
    --header-bg: #274872;
    --header-text: #DBF5B0;
    --primary: #274872;
    --primary-dark: #1a3350;
    --secondary: #3d6699;
    --accent: #DBF5B0;
    --dark: #0f172a;
    --white: #FFFFFF;
    --gray: #F5F5F5;
    --text-gray: #64748b;
    --border-gray: #e2e8f0;
    /* Legacy colors for backwards compatibility */
    --dark-blue: #274872;
    --light-blue: #3d6699;
    --gold: #DBF5B0;
    --lighter-blue: #ADD8E6;
}

/* Basic styling for the application */
html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--white);
    height: 100vh;
    box-sizing: border-box;
    color: var(--dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Modern Navigation */
nav {
    background-color: rgba(255, 255, 255, 0.98);
    padding: 0;
    border-bottom: 1px solid var(--border-gray);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-brand i {
    font-size: 1.75rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a {
    color: var(--text-gray);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--primary);
    background-color: var(--gray);
}

.nav-btn {
    border: 1px solid var(--border-gray);
}

.nav-btn-primary {
    background: var(--primary) !important;
    color: white !important;
    padding: 0.5rem 1.25rem !important;
}

.nav-btn-primary:hover {
    background: var(--primary-dark) !important;
}

/* Hero Section */
.hero {
    background: var(--primary);
    padding: 6rem 2rem;
    text-align: center;
    color: white;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    border: none;
    color: white;
    padding: 0;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    font-weight: 400;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-hero-primary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-hero-primary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-hero-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-hero-secondary i {
    margin-right: 0.5rem;
}

/* Features Section */
.features {
    padding: 5rem 2rem;
    background: var(--gray);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-gray);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    transition: all 0.3s;
    border: 1px solid var(--border-gray);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: var(--primary);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--accent);
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark);
}

.feature-card p {
    color: var(--text-gray);
    line-height: 1.7;
}

/* Stats Banner */
.stats-banner {
    background: var(--dark);
    padding: 3rem 2rem;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
}

.stat-item {
    text-align: center;
    color: white;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.stat-label {
    font-size: 1rem;
    opacity: 0.8;
}

/* CTA Section */
.cta-section {
    background: var(--primary);
    padding: 5rem 2rem;
    text-align: center;
    color: white;
}

.cta-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.btn-cta {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    display: inline-block;
    transition: all 0.3s;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-cta:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

h1 {
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 0;
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-banner {
        flex-direction: column;
    }
}

ul {
    list-style-type: none;
    padding: 0;
}

li {
    padding: 10px;
    margin: 5px 0;
    background-color: #f8f9fa;
    border-left: 3px solid #007bff;
    border-radius: 3px;
}

/* Flash message styles */
.flash-messages {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    min-width: 300px;
    max-width: 600px;
}

.flash-message {
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease-out;
}

.flash-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.flash-message.success {
    /* Form styling */
    .form-group {
        margin-bottom: 20px;
    }
    background-color: #d4edda;
    color: #155724; 
}

.flash-message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.flash-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
    outline: none;
    border-color: #007bff;
}

select {
    background-color: white;
    cursor: pointer;
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    cursor: pointer;
}

.btn {
    background-color: #007bff;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #0056b3;
}

/* Alert messages */
.alert {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}



@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard styles */
.dashboard-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 20px;
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.stats-section {
    width: 100%;
    background: var(--dark-blue);
    border-radius: 12px;
    padding: 16px 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: var(--white);
    box-sizing: border-box;
    flex-shrink: 0;
}

.welcome-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-greeting {
    font-size: 1.6rem;
    font-weight: 600;
}

.welcome-progress {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.welcome-progress strong {
    font-size: 1.8rem;
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
    min-height: 0;
    max-height: 55vh;
}

@media (max-width: 1000px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-container {
        padding: 10px;
        width: 100%;
        overflow: auto;
    }
    .welcome-bar {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }
}

.stats-title {
    font-size: 1rem;
    font-weight: 300;
    margin-bottom: 4px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.stats-value {
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    margin: 2px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.stats-label {
    font-size: 0.95rem;
    text-align: center;
    font-weight: 300;
    opacity: 0.95;
}

.center-content {
    margin-top: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.start-btn {
    background: linear-gradient(135deg, var(--light-blue) 0%, var(--lighter-blue) 100%);
    color: var(--white);
    border: none;
    padding: 8px 30px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

.start-btn:active {
    transform: translateY(-1px);
}

.logout-container {
    display: inline-block;
}

.logout-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 24px;
    font-size: 0.9rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    vertical-align: middle;
}

.logout-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.logout-btn:active {
    transform: translateY(0);
}

/*Stats Card for additional dashboard sections */
.stats-card {
    width: 100%;
    background: var(--white);
    border-radius: 12px;
    padding: 8px 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 5px;
    text-align: center;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 3px;
}

/* Vertical Bar Chart Styles */
.vertical-chart {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    flex: 1;
    min-height: 0;
    padding: 4px 8px;
}

.vertical-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.vertical-bar-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    flex-shrink: 0;
}

.vertical-bar-track {
    width: 100%;
    max-width: 50px;
    flex: 1;
    min-height: 0;
    background: #f0f0f0;
    border-radius: 6px 6px 4px 4px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.vertical-bar-fill {
    width: 100%;
    border-radius: 6px 6px 0 0;
    transition: height 0.5s ease;
    min-height: 4px;
}

.vertical-bar-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #555;
    flex-shrink: 0;
}


.vote-bar-a {
    background: linear-gradient(90deg, #4CAF50 0%, #66BB6A 100%);
}

.vote-bar-b {
    background: linear-gradient(90deg, #2196F3 0%, #42A5F5 100%);
}

.vote-bar-c {
    background: linear-gradient(90deg, #FF9800 0%, #FFA726 100%);
}

.vote-bar-d {
    background: linear-gradient(90deg, #F44336 0%, #EF5350 100%);
}

.vote-count {
    font-weight: bold;
    color: #333;
    min-width: 24px;
    text-align: right;
    font-size: 0.85rem;
}

/* Time Per Image Styles */
.time-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.time-summary {
    display: flex;
    justify-content: space-around;
    background: var(--dark-blue);
    padding: 6px;
    border-radius: 8px;
    color: var(--white);
}

.time-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.metric-label {
    font-size: 0.8rem;
    font-weight: 300;
    opacity: 0.9;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: bold;
}

/* Line Chart Styles */
.line-chart-container {
    width: 100%;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 4px;
    margin-top: 2px;
    flex: 1;
    min-height: 0;
}

.line-chart {
    width: 100%;
    height: 100%;
}

.axis-text {
    font-size: 12px;
    fill: #666;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.data-label {
    font-size: 11px;
    fill: #11998e;
    font-weight: bold;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.time-chart-axis {
    text-align: center;
    margin-top: 2px;
}

.axis-label {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

.no-data {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Labeling Page Styles */
.labeling-page-body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Modern Header */
.labeling-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
    z-index: 100;
}

.back-btn-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #f8f9fa;
    color: #495057;
    padding: 0.75rem 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-btn-modern:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
    transform: translateX(-1px);
}

.back-btn-modern span {
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    transform: translateY(-1px);
}

.header-info {
    flex: 1;
    text-align: center;
}

.labeling-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
}

.participant-info {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.progress-header {
    text-align: right;
}

.progress-numbers {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary, #274872);
}

.progress-label-small {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Main Layout - 3 columns: example | image | controls */
.labeling-main {
    flex: 1;
    display: flex;
    max-width: 1800px;
    width: 100%;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    gap: 0.75rem;
    box-sizing: border-box;
    overflow: hidden;
    min-height: 0;
}

/* Left panel - Example image */
.example-panel {
    flex: 0 0 280px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.example-panel-title {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 0.5rem 0;
    text-align: center;
}

.example-panel .example-image-section {
    padding: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.example-panel .example-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

/* Center - Image viewer */
.image-viewer-section {
    flex: 1 1 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
}

/* Right panel - Controls */
.classification-section {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    overflow: hidden;
    min-height: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 0.75rem;
}

.classification-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
    text-align: center;
}

.view-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.25rem;
    text-align: center;
}

.zoom-hint {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
    font-style: italic;
}

.slideshow-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.slide-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    margin: 0;
    max-width: 100%;
}

.slide {
    display: none;
    padding: 0;
    margin: 0;
}

.slide.active {
    display: block;
}

.slide h2 {
    margin: 10px 0;
}

.navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
}

.change-view-btn {
    display: block;
    margin: 12px auto 0;
    padding: 8px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background-color: var(--primary, #274872);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.change-view-btn:hover:not(:disabled) {
    background-color: var(--primary-dark, #1b3350);
}

.change-view-btn:disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.5;
}

.label-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0;
}

.label-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #212529;
    padding: 1.25rem 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 700;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.label-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: var(--primary, #274872);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.label-btn.selected {
    background: linear-gradient(135deg, var(--primary, #274872) 0%, #1a3350 100%);
    color: white;
    border-color: var(--primary, #274872);
    box-shadow: 0 6px 20px rgba(39, 72, 114, 0.3);
}

.label-btn.selected:hover {
    background: linear-gradient(135deg, #1a3350 0%, var(--primary, #274872) 100%);
}

.label-letter {
    display: block;
}

.image-zoom-container {
    width: fit-content;
    max-width: 100%;
    max-height: 65vh;
    overflow: hidden;
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: grab;
    display: inline-block;
    margin: 0;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.image-zoom-container:active {
    cursor: grabbing;
}

.image-zoom-container img {
    display: block;
    max-width: 100%;
    max-height: 65vh;
    height: auto;
    width: auto;
    transform-origin: center center;
    user-select: none;
    pointer-events: none; /* So the drag works properly */
}

/* Navigation Section */
.image-navigation-section {
    padding: 0;
}

.nav-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin: 0 0 0.5rem 0;
    text-align: center;
}

.image-navigation {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.image-nav-btn {
    background-color: #f8f9fa;
    color: #495057;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.image-nav-btn:hover:not(:disabled) {
    background-color: var(--primary, #274872);
    color: white;
    border-color: var(--primary, #274872);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 72, 114, 0.2);
}

.image-nav-btn:disabled {
    background-color: #f8f9fa;
    color: #ced4da;
    border-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.6;
}

.image-nav-btn span {
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    transform: translateY(-2px);
}

.example-image-toggle {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.example-image-toggle summary {
    list-style: none;
}

.example-image-toggle summary::-webkit-details-marker {
    display: none;
}

.example-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary, #274872);
    cursor: pointer;
    border: 2px solid var(--primary, #274872);
    border-radius: 12px;
    background: white;
    transition: all 0.2s ease;
    user-select: none;
}

.example-toggle-btn::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.example-image-toggle[open] .example-toggle-btn {
    border-radius: 12px 12px 0 0;
    background: var(--primary, #274872);
    color: white;
}

.example-image-toggle[open] .example-toggle-btn::after {
    transform: rotate(180deg);
}

.example-toggle-btn:hover {
    background: var(--primary, #274872);
    color: white;
}

.example-image-section {
    text-align: center;
    padding: 0.75rem;
}

.example-image {
    max-width: 100%;
    border-radius: 8px;
}

/* Progress Bar */
.progress-container {
    flex-shrink: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 0.35rem 2rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.progress-bar-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.progress-bar-outer {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--primary, #274872) 0%, #3d6699 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-percentage {
    position: absolute;
    top: -25px;
    right: 0;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .labeling-main {
        flex-direction: column;
    }
    
    .example-panel {
        flex: 0 0 auto;
        order: 2;
    }
    
    .image-viewer-section {
        order: 1;
    }
    
    .classification-section {
        flex: 0 0 auto;
        order: 3;
    }
    
    .label-buttons {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .image-navigation {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .labeling-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .progress-header {
        text-align: center;
    }
    
    .labeling-main {
        padding: 0.5rem;
    }
    
    .example-panel {
        flex: 0 0 auto;
    }
    
    .label-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .image-navigation {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== Tutorial Page ========== */
.tutorial-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 1rem 1.5rem 2rem;
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.tutorial-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tutorial-main-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 0.5rem;
}

.tutorial-subtitle {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin: 0;
}

.tutorial-section {
    position: relative;
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: 2rem 2rem 2rem 4.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.tutorial-section-number {
    position: absolute;
    top: 2rem;
    left: 1.2rem;
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
}

.tutorial-section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0 0 0.75rem;
}

.tutorial-text {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0 0 0.75rem;
}

.tutorial-list {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.8;
    margin: 0 0 1rem;
    padding-left: 1.2rem;
}

.tutorial-list li {
    margin-bottom: 0.3rem;
}

.tutorial-image-placeholder {
    text-align: center;
    margin-top: 1rem;
}

.tutorial-image-placeholder img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border-gray);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tutorial-image-caption {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-gray);
    font-style: italic;
}

.tutorial-labels-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin: 1rem 0;
}

.tutorial-label-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #334155;
}

.tutorial-label-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    background: var(--primary);
    color: var(--white);
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.tutorial-continue {
    text-align: center;
    margin-top: 2.5rem;
}

.tutorial-continue-btn {
    display: inline-block;
    padding: 14px 48px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    background: var(--primary);
    border: none;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.tutorial-continue-btn:hover {
    background: var(--primary-dark);
}

/* Tutorial link on dashboard */
.tutorial-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--primary);
    background: transparent;
    border: 2px solid var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tutorial-link-btn:hover {
    background: var(--primary);
    color: var(--white);
}

@media (max-width: 768px) {
    .tutorial-section {
        padding: 1.5rem 1.5rem 1.5rem 3.5rem;
    }

    .tutorial-labels-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Admin Panel ===== */
.admin-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    border: none;
}

.admin-back-btn {
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 500;
    transition: color 0.2s;
}
.admin-back-btn:hover {
    color: var(--primary);
}

/* Action cards grid */
.admin-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.admin-action-card {
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s;
}
.admin-action-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.action-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.admin-action-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: var(--dark);
}

.admin-action-card p {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 1.25rem;
}

/* Buttons */
.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}
.admin-btn:active {
    transform: scale(0.97);
}

.admin-btn-primary {
    background: var(--primary);
    color: var(--white);
}
.admin-btn-primary:hover {
    background: var(--primary-dark);
}

.admin-btn-accent {
    background: #11998e;
    color: var(--white);
}
.admin-btn-accent:hover {
    background: #0e7c73;
}

.admin-btn-warning {
    background: #e67e22;
    color: var(--white);
}
.admin-btn-warning:hover {
    background: #cf6d17;
}

.admin-btn-danger {
    background: #e74c3c;
    color: var(--white);
}
.admin-btn-danger:hover {
    background: #c0392b;
}

.admin-btn-outline {
    background: transparent;
    color: var(--text-gray);
    border: 1px solid var(--border-gray);
}
.admin-btn-outline:hover {
    background: var(--gray);
    color: var(--dark);
}

.admin-btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* Section */
.admin-section {
    margin-bottom: 2rem;
}
.admin-section h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1rem;
    border: none;
}

/* Table */
.admin-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-gray);
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-gray);
}

.admin-table thead {
    background: var(--gray);
}
.admin-table th {
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-admin {
    background: var(--primary);
    color: var(--white);
}
.badge-user {
    background: var(--border-gray);
    color: var(--text-gray);
}

/* Footer */
.admin-footer {
    text-align: center;
    margin-top: 2rem;
}

.text-muted {
    color: var(--text-gray);
}

/* Admin link button on dashboard */
.admin-link-btn {
    background: var(--primary) !important;
}
.admin-link-btn:hover {
    background: var(--primary-dark) !important;
}

@media (max-width: 600px) {
    .admin-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    .admin-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* Password-reset persistent banner */
.admin-reset-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #eef6ff;
    border: 1px solid #b6d4fe;
    border-left: 4px solid var(--primary);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.reset-banner-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--dark);
    font-size: 0.95rem;
}

.reset-banner-content i {
    font-size: 1.4rem;
    color: var(--primary);
}

.reset-banner-content code {
    background: var(--white);
    border: 1px solid var(--border-gray);
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    user-select: all;
}

.reset-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .admin-reset-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Auth pages (login, register, reset password, onboarding) — center in viewport */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    padding: 1rem 2rem;
    box-sizing: border-box;
}

.auth-container h1 {
    margin-top: 0;
}

.auth-container form {
    width: 100%;
}

.auth-container .form-group {
    margin-bottom: 12px;
}

.auth-container button[type="submit"] {
    width: 100%;
    padding: 10px;
    font-size: 1em;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.auth-container button[type="submit"]:hover {
    background-color: var(--primary-dark);
}