/* Global styles for GEO Figure - Based on GeoSeis React Design */

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

html,
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: pan-y pinch-zoom;
    margin: 0;
    padding: 0;
    margin: 0;
    padding: 0;
    width: 100%;
}

.geoseis-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
}

/* Header - GEOmapper style */
.header {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 50%, #2c5aa0 100%);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
    color: white;
    padding: 25px 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(74, 144, 226, 0.2);
    z-index: 1000;
}

.version-corner {
    position: absolute;
    top: 10px;
    left: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.9;
    z-index: 100;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: shimmer 8s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    z-index: 1;
    position: relative;
}

.globe-logo {
    font-size: 3.5em;
    line-height: 1;
    flex-shrink: 0;
}

.text-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 4em;
}

.text-content h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin: 0;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.text-content p {
    font-size: 1.1em;
    margin: 0;
    opacity: 0.9;
    font-weight: 300;
}

/* GEO Figure logo styling - matching GEOmapper */
.geo-text {
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.app-text {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.2px;
    font-size: 0.8em;
}

.nav-buttons {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    z-index: 10000;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
    z-index: 10001;
}

.dropdown-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.dropdown-toggle::after {
    content: '▼';
    margin-left: 8px;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.dropdown.active .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-content {
    position: fixed !important;
    top: 80px !important;
    right: 30px !important;
    background: white !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
    min-width: 220px !important;
    max-height: none !important;
    z-index: 10002 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.2s ease !important;
    display: block !important;
    pointer-events: none !important;
}

.dropdown.active .dropdown-content {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    border: none;
    font-size: 14px;
    background: none;
    text-align: left;
    cursor: pointer;
    color: #333;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

/* Page navigation */
.page {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.nav-btn-primary {
    background: rgba(76, 175, 80, 0.9);
    border-color: rgba(76, 175, 80, 1);
    font-weight: 600;
}

.nav-btn-primary:hover {
    background: rgba(76, 175, 80, 1);
    border-color: rgba(76, 175, 80, 1);
}

.nav-btn-secondary {
    background: rgba(158, 158, 158, 0.9);
    border-color: rgba(158, 158, 158, 1);
}

.nav-btn-secondary:hover {
    background: rgba(158, 158, 158, 1);
    border-color: rgba(158, 158, 158, 1);
}

/* Main content */
.main-content {
    flex: 1;
    padding: 20px;
    background-color: #f5f5f5;
    min-height: calc(100vh - 64px);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Workspace sections */
.workspace-section {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.workspace-section h3 {
    margin-top: 0;
    color: #1976d2;
    border-bottom: 2px solid #e3f2fd;
    padding-bottom: 10px;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Workspace split layout - Grid with viewer */
.workspace-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    transition: grid-template-columns 0.3s ease;
}

.workspace-split.viewer-hidden {
    grid-template-columns: 1fr;
}

.workspace-split.viewer-hidden .workspace-right {
    display: none;
}

.workspace-left {
    min-width: 0;
    /* Prevent overflow */
    overflow: hidden;
}

.workspace-right {
    min-width: 0;
    /* Prevent overflow */
}

/* Form containers */
.form-container {
    background-color: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
    min-width: 120px;
}

.form-input {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    background: #ffffff;
    min-width: 200px;
}

.form-input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

/* Toggle Switch Styling */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 34px;
    transition: background 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input[type="checkbox"]:checked+.toggle-slider {
    background: #4CAF50;
}

.toggle-switch input[type="checkbox"]:checked+.toggle-slider::before {
    transform: translateX(24px);
}

.toggle-label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.toggle-switch:hover .toggle-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 8px rgba(76, 175, 80, 0.3);
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    background: #ffffff;
    color: #374151;
    margin: 4px;
}

.btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f9fafb;
    color: #9ca3af;
}

.btn-primary {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
    font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
    background: #1565c0;
    border-color: #1565c0;
    color: white;
}

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

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
    border-color: #4b5563;
    color: white;
}

.btn-info {
    background: #06b6d4;
    color: white;
    border-color: #06b6d4;
}

.btn-info:hover:not(:disabled) {
    background: #0891b2;
    border-color: #0891b2;
    color: white;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
    border-color: #d97706;
    color: white;
}

/* Canvas container */
.canvas-container {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    max-width: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    max-height: 600px;
    padding: 10px;
}

.canvas-container img,
.main-display-image,
#display {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Grid container with transparency controls */
.grid-container {
    max-width: 100%;
    margin: 0 auto;
    border: 2px solid #333;
    border-radius: 10px;
    background: #f8f9fa;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow-x: auto;

    /* Grid cell transparency controls - change these values to adjust all cells */
    --cell-bg-opacity: 0.4;
    /* Background transparency (0.0 = invisible, 1.0 = solid) */
    --cell-border-opacity: 0.3;
    /* Border transparency (0.0 = invisible, 1.0 = solid) */

    /* Lesson label transparency controls - change these values to adjust all labels */
    --label-bg-opacity: 0.5;
    /* Label background transparency (0.1 less transparent than cells) */
    --label-border-opacity: 0.4;
    /* Label border transparency (0.1 less transparent than cells) */
    --label-text-opacity: 0.8;
    /* Label text transparency */
}

/* Grid styles */
.lesson-labels {
    display: grid;
    /* grid-template-columns set dynamically by JavaScript */
    gap: 8px;
    margin-bottom: 10px;
    padding: 0;
}

/* Single group mode - center and enlarge the label */
.lesson-labels.single-group-mode {
    max-width: 800px;
    margin: 0 auto 20px auto;
}

.lesson-labels.single-group-mode .lesson-label {
    font-size: 18px;
    padding: 15px;
    text-align: center;
    font-weight: 700;
    border-width: 2px;
}

.lesson-label {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: rgba(25, 118, 210, var(--label-text-opacity));
    padding: 8px 4px;
    background: linear-gradient(135deg, rgba(227, 242, 253, var(--label-bg-opacity)) 0%, rgba(248, 249, 250, var(--label-bg-opacity)) 100%);
    border-radius: 6px;
    border: 2px solid rgba(187, 222, 251, var(--label-border-opacity));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 45px;
    justify-content: center;
}

.label-number {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.label-preview {
    font-size: 10px;
    font-weight: 600;
    opacity: 0.85;
    letter-spacing: 0.3px;
    line-height: 1;
}

/* Very subtle column colors */
.lesson-label:nth-child(1) {
    background: linear-gradient(135deg, rgba(255, 249, 230, var(--label-bg-opacity)) 0%, rgba(254, 243, 199, var(--label-bg-opacity)) 100%);
    border-color: rgba(251, 191, 36, 0.9);
    border-width: 3px;
    color: rgba(146, 64, 14, var(--label-text-opacity));
}

.lesson-label:nth-child(2) {
    background: linear-gradient(135deg, rgba(254, 242, 242, var(--label-bg-opacity)) 0%, rgba(254, 202, 202, var(--label-bg-opacity)) 100%);
    border-color: rgba(248, 113, 113, 0.9);
    border-width: 3px;
    color: rgba(153, 27, 27, var(--label-text-opacity));
}

.lesson-label:nth-child(3) {
    background: linear-gradient(135deg, rgba(253, 242, 248, var(--label-bg-opacity)) 0%, rgba(251, 207, 232, var(--label-bg-opacity)) 100%);
    border-color: rgba(236, 72, 153, 0.9);
    border-width: 3px;
    color: rgba(190, 24, 93, var(--label-text-opacity));
}

.lesson-label:nth-child(4) {
    background: linear-gradient(135deg, rgba(243, 244, 246, var(--label-bg-opacity)) 0%, rgba(229, 231, 235, var(--label-bg-opacity)) 100%);
    border-color: rgba(156, 163, 175, 0.9);
    border-width: 3px;
    color: rgba(55, 65, 81, var(--label-text-opacity));
}

.lesson-label:nth-child(5) {
    background: linear-gradient(135deg, rgba(239, 246, 255, var(--label-bg-opacity)) 0%, rgba(219, 234, 254, var(--label-bg-opacity)) 100%);
    border-color: rgba(59, 130, 246, 0.9);
    border-width: 3px;
    color: rgba(29, 78, 216, var(--label-text-opacity));
}

.lesson-label:nth-child(6) {
    background: linear-gradient(135deg, rgba(240, 253, 250, var(--label-bg-opacity)) 0%, rgba(204, 251, 241, var(--label-bg-opacity)) 100%);
    border-color: rgba(20, 184, 166, 0.9);
    border-width: 3px;
    color: rgba(15, 118, 110, var(--label-text-opacity));
}

.lesson-label:nth-child(7) {
    background: linear-gradient(135deg, rgba(240, 253, 244, var(--label-bg-opacity)) 0%, rgba(220, 252, 231, var(--label-bg-opacity)) 100%);
    border-color: rgba(34, 197, 94, 0.9);
    border-width: 3px;
    color: rgba(21, 128, 61, var(--label-text-opacity));
}

.lesson-label:nth-child(8) {
    background: linear-gradient(135deg, rgba(254, 252, 232, var(--label-bg-opacity)) 0%, rgba(254, 243, 199, var(--label-bg-opacity)) 100%);
    border-color: rgba(234, 179, 8, 0.9);
    border-width: 3px;
    color: rgba(161, 98, 7, var(--label-text-opacity));
}

.lesson-label:nth-child(9) {
    background: linear-gradient(135deg, rgba(255, 247, 237, var(--label-bg-opacity)) 0%, rgba(254, 215, 170, var(--label-bg-opacity)) 100%);
    border-color: rgba(249, 115, 22, 0.9);
    border-width: 3px;
    color: rgba(194, 65, 12, var(--label-text-opacity));
}

.lesson-label:nth-child(10) {
    background: linear-gradient(135deg, rgba(248, 250, 252, var(--label-bg-opacity)) 0%, rgba(226, 232, 240, var(--label-bg-opacity)) 100%);
    border-color: rgba(100, 116, 139, 0.9);
    border-width: 3px;
    color: rgba(51, 65, 85, var(--label-text-opacity));
}

.upload-grid {
    display: grid;
    /* grid-template-columns set dynamically by JavaScript */
    gap: 8px;
}

/* Single group mode - 2x3 layout for complete overview without scrolling */
.upload-grid.single-group-mode {
    max-width: 800px;
    margin: 0 auto;
    gap: 15px;
    /* 2 columns x 3 rows layout handled by JS */
}

.upload-grid.single-group-mode .grid-cell {
    /* Larger cells for better visibility */
    aspect-ratio: 1;
    min-height: 180px;
    max-height: 250px;
}

.grid-cell {
    aspect-ratio: 1;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    padding: 2px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Column colors matching lesson labels - repeats every 10 columns */

/* Column 0 - Amber (matches lesson-label:nth-child(1)) */
.grid-cell[data-column="0"],
.grid-cell[data-column="10"],
.grid-cell[data-column="20"],
.grid-cell[data-column="30"] {
    background: linear-gradient(135deg, rgba(255, 249, 230, 0.8) 0%, rgba(254, 243, 199, 0.8) 100%) !important;
    border-color: rgba(251, 191, 36, 0.8) !important;
}

/* Column 1 - Red (matches lesson-label:nth-child(2)) */
.grid-cell[data-column="1"],
.grid-cell[data-column="11"],
.grid-cell[data-column="21"],
.grid-cell[data-column="31"] {
    background: linear-gradient(135deg, rgba(254, 242, 242, 0.8) 0%, rgba(254, 202, 202, 0.8) 100%) !important;
    border-color: rgba(248, 113, 113, 0.8) !important;
}

/* Column 2 - Pink (matches lesson-label:nth-child(3)) */
.grid-cell[data-column="2"],
.grid-cell[data-column="12"],
.grid-cell[data-column="22"],
.grid-cell[data-column="32"] {
    background: linear-gradient(135deg, rgba(253, 242, 248, 0.8) 0%, rgba(251, 207, 232, 0.8) 100%) !important;
    border-color: rgba(236, 72, 153, 0.8) !important;
}

/* Column 3 - Gray (matches lesson-label:nth-child(4)) */
.grid-cell[data-column="3"],
.grid-cell[data-column="13"],
.grid-cell[data-column="23"],
.grid-cell[data-column="33"] {
    background: linear-gradient(135deg, rgba(243, 244, 246, 0.8) 0%, rgba(229, 231, 235, 0.8) 100%) !important;
    border-color: rgba(156, 163, 175, 0.8) !important;
}

/* Column 4 - Blue (matches lesson-label:nth-child(5)) */
.grid-cell[data-column="4"],
.grid-cell[data-column="14"],
.grid-cell[data-column="24"],
.grid-cell[data-column="34"] {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.8) 0%, rgba(219, 234, 254, 0.8) 100%) !important;
    border-color: rgba(59, 130, 246, 0.8) !important;
}

/* Column 5 - Teal (matches lesson-label:nth-child(6)) */
.grid-cell[data-column="5"],
.grid-cell[data-column="15"],
.grid-cell[data-column="25"],
.grid-cell[data-column="35"] {
    background: linear-gradient(135deg, rgba(240, 253, 250, 0.8) 0%, rgba(204, 251, 241, 0.8) 100%) !important;
    border-color: rgba(20, 184, 166, 0.8) !important;
}

/* Column 6 - Green (matches lesson-label:nth-child(7)) */
.grid-cell[data-column="6"],
.grid-cell[data-column="16"],
.grid-cell[data-column="26"],
.grid-cell[data-column="36"] {
    background: linear-gradient(135deg, rgba(240, 253, 244, 0.8) 0%, rgba(220, 252, 231, 0.8) 100%) !important;
    border-color: rgba(34, 197, 94, 0.8) !important;
}

/* Column 7 - Lime (matches lesson-label:nth-child(8)) */
.grid-cell[data-column="7"],
.grid-cell[data-column="17"],
.grid-cell[data-column="27"],
.grid-cell[data-column="37"] {
    background: linear-gradient(135deg, rgba(254, 252, 232, 0.8) 0%, rgba(254, 243, 199, 0.8) 100%) !important;
    border-color: rgba(234, 179, 8, 0.8) !important;
}

/* Column 8 - Orange (matches lesson-label:nth-child(9)) */
.grid-cell[data-column="8"],
.grid-cell[data-column="18"],
.grid-cell[data-column="28"],
.grid-cell[data-column="38"] {
    background: linear-gradient(135deg, rgba(255, 247, 237, 0.8) 0%, rgba(254, 215, 170, 0.8) 100%) !important;
    border-color: rgba(249, 115, 22, 0.8) !important;
}

/* Column 9 - Slate (matches lesson-label:nth-child(10)) */
.grid-cell[data-column="9"],
.grid-cell[data-column="19"],
.grid-cell[data-column="29"],
.grid-cell[data-column="39"] {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(226, 232, 240, 0.8) 100%) !important;
    border-color: rgba(100, 116, 139, 0.8) !important;
}

.grid-cell:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.grid-cell.has-image {
    /* Keep column colors - don't override background */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.grid-cell img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

.grid-cell .delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    padding: 2px 5px;
    font-size: 10px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.grid-cell:hover .delete-btn {
    opacity: 1;
}

.grid-cell.has-image {
    cursor: context-menu;
}

.note-indicator {
    position: absolute;
    bottom: 2px;
    left: 2px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.note-indicator:hover {
    background: #0056b3;
}

/* Modal styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 50%, #2c5aa0 100%);
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(74, 144, 226, 0.2);
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: shimmer 8s infinite;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.presentation-image,
.test-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.presentation-image img,
.test-image img {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.presentation-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.presentation-note h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.presentation-note p {
    color: #666;
    line-height: 1.6;
    font-size: 1.1em;
}

.modal-footer {
    background: #f8f9fa;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e9ecef;
}

#slideCounter {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.hidden {
    display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .title-section {
        text-align: center;
    }

    .main-title {
        font-size: 1.8em;
    }

    .main-subtitle {
        font-size: 0.9em;
    }

    /* Force single column layout on mobile */
    .workspace-split {
        grid-template-columns: 1fr !important;
    }

    .workspace-split.viewer-hidden {
        grid-template-columns: 1fr !important;
    }

    /* Hide image viewer on mobile by default */
    .workspace-right {
        display: none !important;
    }

    .workspace-section {
        padding: 15px;
        margin-bottom: 15px;
    }

    /* Navigation and buttons */
    .nav-buttons {
        position: static !important;
        margin-top: 10px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .nav-btn {
        min-width: 80px;
        padding: 6px 12px;
        font-size: 12px;
    }

    .dropdown-content {
        position: fixed !important;
        top: auto !important;
        right: 10px !important;
        left: 10px !important;
        max-width: none !important;
    }

    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Toggle switch on mobile */
    .toggle-switch {
        display: none !important;
    }

    /* Form controls */
    .form-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .form-label {
        min-width: auto;
    }

    .form-input,
    .form-select {
        min-width: 100%;
        width: 100%;
    }

    .main-content {
        padding: 12px 8px;
        overflow-x: hidden;
    }

    /* Grid adjustments */
    .grid-container {
        max-width: 100%;
        padding: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .upload-grid {
        gap: 5px;
        padding: 8px;
        min-width: min-content;
    }

    .grid-cell {
        min-height: 70px;
        min-width: 70px;
    }

    .lesson-labels {
        gap: 5px;
        min-width: min-content;
    }

    .lesson-label {
        font-size: 10px;
        padding: 6px 3px;
        min-height: 50px;
    }

    .label-number {
        font-size: 14px;
    }

    .label-preview {
        font-size: 8px;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-body {
        padding: 15px;
    }

    .presentation-image,
    .test-image {
        padding: 15px;
    }

    .presentation-image img,
    .test-image img {
        max-height: 50vh;
    }

    .modal-footer {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 10px 15px;
    }

    .nav-btn {
        min-width: 70px;
        padding: 5px 10px;
        font-size: 11px;
    }

    .main-title {
        font-size: 1.5em;
    }

    .main-subtitle {
        font-size: 11px;
    }

    .globe-logo {
        font-size: 1.5em;
    }

    .workspace-section {
        padding: 12px;
    }

    .workspace-section h3 {
        font-size: 1.1em;
    }

    .grid-cell {
        min-height: 60px;
        min-width: 60px;
    }

    .lesson-label {
        font-size: 9px;
        padding: 4px 2px;
        min-height: 45px;
    }

    .label-number {
        font-size: 13px;
    }

    .label-preview {
        font-size: 7px;
        letter-spacing: 0.2px;
    }

    .btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .modal-header h2 {
        font-size: 1.2em;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}