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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2rem;
}

.subtitle {
    color: #333;
    margin-bottom: 30px;
    font-size: 1rem;
}

.section {
    margin-bottom: 30px;
}

.section h2 {
    color: #444;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    position: relative;
    max-height: calc(20 * 45px + 120px); /* 20 rows * ~45px per row + header heights */
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 400px;
}

/* Sticky table headers */
thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

/* Ensure proper background for sticky headers */
thead tr {
    background-color: #4c5fd5;
}

/* Minimum column width - 6% of viewport width */
th, td {
    border: 1px solid #ddd;
    padding: 6px;
    text-align: left;
    min-width: 6vw;
}

/* Date column (first column) - always visible with sticky positioning */
th:first-child, td:first-child {
    position: sticky;
    left: 0;
    z-index: 15;
    background-color: inherit;
    min-width: 150px; /* Fixed width for date column */
}

/* Ensure date column header has correct background and highest z-index */
thead th:first-child {
    background-color: #4c5fd5;
    z-index: 25;
}

/* Ensure date column in data type row has correct background */
thead .data-type-label {
    background-color: #6c7fd8 !important;
    z-index: 25;
}

/* Data type label cell - also sticky */
.data-type-label {
    position: sticky;
    left: 0;
    z-index: 25;
    background-color: #6c7fd8 !important;
}

th {
    background-color: #4c5fd5;
    color: white;
    font-weight: 600;
    position: relative;
    padding: 12px 6px 6px 6px; /* Extra top padding for delete button */
}

/* Ensure tbody cells have white background for sticky columns */
tbody td:first-child {
    background-color: white;
}

th textarea {
    background: transparent;
    border: none;
    color: white;
    font-weight: 600;
    font-size: inherit;
    font-family: inherit;
    width: 100%;
    resize: none;
    overflow: hidden;
    min-height: 1.5em;
    line-height: 1.5;
}

th textarea:focus {
    outline: 1px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

th textarea::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Tooltip styling for GAD-7 headers and cells */
th textarea[title]:hover,
td input[title]:hover {
    cursor: help;
}

th .header-content {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    position: relative;
}

th .delete-column {
    position: absolute;
    top: 2px; /* Positioned within the header padding */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(220, 53, 69, 0.9);
    border: none;
    color: white;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    transition: background 0.3s, opacity 0.3s;
    opacity: 0;
}

th:hover .delete-column {
    opacity: 1;
}

th .delete-column:hover {
    background: rgba(200, 35, 51, 1);
}

/* Delete row button styling */
.delete-row-header {
    background-color: #4c5fd5;
    width: 4.5vw;
    min-width: 50px;
}

.delete-row-cell {
    text-align: center;
    width: 4.5vw;
    min-width: 50px;
    padding: 8px;
}

.delete-row {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    transition: background 0.3s, border-color 0.3s;
    opacity: 1;
}

tr .delete-row {
    opacity: 1;
}

.delete-row:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.5);
}

/* Data type row styling */
.data-type-label {
    background-color: #6c7fd8 !important;
    color: white;
    font-weight: 600;
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
}

.data-type-cell {
    background-color: #6c7fd8;
    padding: 8px 12px;
}

.data-type-selector {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
}

.data-type-selector:hover:not(:disabled) {
    background-color: white;
    border-color: rgba(255, 255, 255, 0.5);
}

.data-type-selector:focus {
    outline: none;
    border-color: #4c5fd5;
    box-shadow: 0 0 0 2px rgba(76, 95, 213, 0.2);
}

.data-type-selector:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

input[type="text"] {
    width: 100%;
    border: none;
    background: transparent;
    padding: 4px;
    font-size: 14px;
}

input[type="text"]:focus {
    outline: 2px solid #667eea;
    border-radius: 4px;
}

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    transition: border-color 0.3s;
}

select:hover {
    border-color: #667eea;
}

select:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 10px 20px;
    background: #4c5fd5;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
    align-self: flex-end;
}

button:hover {
    background: #3d4eb8;
}

button:active {
    transform: scale(0.98);
}

.button-group {
    display: flex;
    gap: 10px;
}

button.secondary {
    background: #6c757d;
}

button.secondary:hover {
    background: #5a6268;
}

/* Undo button styling */
button.undo-btn {
    background: #6c757d; /* Gray when disabled */
    transition: all 0.3s ease;
}

button.undo-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

button.undo-btn:not(:disabled) {
    background: #007bff; /* Blue when active */
    color: white;
}

button.undo-btn:disabled {
    background: #6c757d;
    color: #adb5bd;
    cursor: not-allowed;
    transform: none;
}

.chart-container {
    position: relative;
    min-height: 400px;
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: #f9f9f9;
}

.error {
    color: #dc3545;
    padding: 10px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin-bottom: 15px;
}

svg {
    width: 100%;
    height: 400px;
}

.chart-title {
    text-align: center;
    font-weight: 600;
    color: #444;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.auth-section {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.auth-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.auth-button {
    padding: 10px 20px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-button:hover {
    background: #1557b0;
}

/* Google Sign-In Button - Official Branding */
.google-signin-btn {
    background: white;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 0;
    height: 40px;
    min-width: 180px;
    font-family: 'Google Sans', 'Roboto', arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s;
    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
}

.google-signin-btn:hover {
    background: #f8f9fa;
    border-color: #d2e3fc;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.google-signin-btn:active {
    background: #f1f3f4;
    border-color: #d2e3fc;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.google-signin-btn:focus {
    outline: none;
    border-color: #4285f4;
}

.google-icon {
    width: 18px;
    height: 18px;
    margin-left: 8px;
}


.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: #f5f5f5;
    border-radius: 20px;
    font-weight: 500;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.small-button {
    padding: 6px 12px;
    font-size: 14px;
}

/* Logout button styling */
button.red-btn {
    background: #dc3545;
}

button.red-btn:hover {
    background: #c82333;
}

.auth-status {
    text-align: center;
    padding: 8px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    margin-bottom: 15px;
    color: #856404;
    font-size: 0.9rem;
}

.auth-status.hidden {
    display: none;
}

.import-section {
    margin-bottom: 20px;
}

.import-divider {
    text-align: center;
    color: #666;
    margin: 15px 0;
    font-weight: 500;
}

.drop-zone {
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: #f8f9ff;
    transition: all 0.3s;
    cursor: pointer;
    width: 50%;
    max-width: 600px;
}

.drop-zone:hover, .drop-zone.drag-over {
    background: #e8ebff;
    border-color: #5568d3;
}

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

.upload-icon {
    font-size: 48px;
}

.drop-zone p {
    margin: 0;
    color: #555;
    font-weight: 500;
}

.correlation-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.control-group-inline {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.control-group-inline label {
    margin: 0;
}

.control-group-inline select {
    min-width: 150px;
}

.correlation-results {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.correlation-results h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #444;
}

.correlation-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

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

.correlation-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.correlation-strength {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 10px;
}

.strength-icon {
    display: inline-block;
    margin-right: 4px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Shared correlation color classes for both pairwise and matrix */
.correlation-strong-positive {
    background: linear-gradient(135deg, #00b894 0%, #55efc4 100%);
    color: white;
}

.correlation-moderate-positive {
    background: linear-gradient(135deg, #a8e6cf 0%, #c8f0dd 100%);
    color: #00693e;
}

.correlation-weak {
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    color: #555;
}

.correlation-moderate-negative {
    background: linear-gradient(135deg, #ffb3ba 0%, #ffd1d1 100%);
    color: #b71c1c;
}

.correlation-strong-negative {
    background: linear-gradient(135deg, #e74c3c 0%, #ff6b6b 100%);
    color: white;
}

/* Correlation Matrix Styles */
.correlation-matrix-container {
    overflow-x: auto;
    margin: 20px 0;
}

.correlation-matrix {
    width: auto;
    border-collapse: collapse;
    margin: 0 auto;
    background: white;
}

.correlation-matrix th {
    background-color: #667eea;
    color: white;
    padding: 10px;
    font-weight: 600;
    text-align: center;
    min-width: 80px;
}

.correlation-matrix .matrix-header,
.correlation-matrix .matrix-row-header {
    font-size: 0.9rem;
    white-space: nowrap;
}

.correlation-matrix .matrix-row-header {
    text-align: left;
    padding-left: 15px;
}

.correlation-matrix td {
    text-align: center;
    padding: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid #ddd;
    min-width: 80px;
    cursor: help;
    transition: transform 0.2s;
}

.correlation-matrix td:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10;
    position: relative;
}

.matrix-icon {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 2px;
    font-weight: bold;
    opacity: 0.9;
}

.matrix-value {
    display: block;
    font-size: 0.95rem;
}

/* Matrix Legend */
.matrix-legend {
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.legend-title {
    font-weight: 600;
    color: #444;
    margin-bottom: 10px;
    font-size: 1rem;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #555;
}

.legend-icon {
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 30px;
    text-align: center;
}

.legend-color {
    width: 30px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.api-key-section {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-text {
    margin-top: 10px;
    color: #555;
    font-size: 0.85rem;
    font-style: italic;
}

.token-quota-display {
    margin-top: 10px;
    padding: 10px 15px;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
    border-radius: 4px;
    font-size: 0.9rem;
}

.token-quota-display.low {
    background: #fff3e0;
    border-left-color: #ff9800;
}

.token-quota-display.very-low {
    background: #ffebee;
    border-left-color: #f44336;
}

.chat-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f9f9f9;
}

.chat-header {
    display: flex;
    justify-content: flex-end;
    padding: 10px 15px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
}

.clear-chat-btn {
    padding: 6px 12px;
    font-size: 14px;
}

.chat-history {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: white;
}

.chat-message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    max-width: 80%;
}

.chat-message.user {
    background: #667eea;
    color: white;
    margin-left: auto;
}

.chat-message.assistant {
    background: #f0f0f0;
    color: #333;
}

.chat-message.system {
    background: #e8f5e9;
    color: #2e7d32;
    max-width: 100%;
}

.chat-input-section {
    background: #f9f9f9;
    padding: 15px;
    border-top: 1px solid #ddd;
}

.correlation-context {
    margin-bottom: 10px;
}

.context-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.context-info {
    display: inline-block;
    background: #fff8e1;
    color: #f57c00;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

.chat-input-container input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.chat-input-container input:focus {
    outline: none;
    border-color: #667eea;
}

.chat-input-container button {
    padding: 12px 24px;
}

/* Standard ordered list styling for better readability */
.collapsible-content ol {
    padding-left: 25px;
    line-height: 1.8;
}

.collapsible-content ol li {
    margin-bottom: 15px;
    color: #000;
}

.collapsible-content ol li:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    button {
        align-self: stretch;
    }
    
    /* Mobile-friendly ordered list styling */
    .collapsible-content ol {
        padding-left: 20px;
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .collapsible-content ol li {
        margin-bottom: 18px;
        padding-right: 5px;
    }
    
    /* Make collapsible headers easier to tap on mobile */
    .collapsible-header {
        padding: 10px 0;
        font-size: 1.2rem;
    }
    
    /* Improve touch targets for mobile */
    .section h2 {
        font-size: 1.2rem;
        padding-bottom: 10px;
    }
    
    /* Mobile-friendly table headers */
    th {
        min-width: 25vw; /* Minimum 10% of viewport width */
        font-size: 0.85rem; /* Slightly smaller text for mobile */
        padding: 10px 8px; /* Adjust padding for mobile */
    }
    
    th textarea {
        font-size: 0.85rem; /* Match header font size */
        min-height: 1.275em; /* Maintain proportional relationship to desktop (1.5em * 0.85) */
        line-height: 1.3;
    }
    
    /* Adjust delete column button for mobile */
    th .delete-column {
        font-size: 0.875rem; /* 14px for better readability and touch target size */
        padding: 3px 6px;
    }
}

/* Contact Section Styles */
.contact-description {
    color: #000;
    margin-bottom: 25px;
    line-height: 1.5;
    text-align: center;
}

.contact-button-container {
    text-align: center;
    margin: 30px auto;
}

.contact-status {
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #000;
    font-size: 14px;
    margin-top: 15px;
}

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

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





@media (max-width: 768px) {
    .contact-button {
        padding: 16px 30px;
        font-size: 16px;
    }
}

/* Plot Correlation Results Styles */
.plot-correlation-results {
    background: #f0f4ff;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.plot-correlation-results h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #444;
    font-size: 1.1rem;
}

.plot-correlation-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Tell Me More Button Styles */
.tell-me-more-btn {
    background: none;
    border: none;
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-left: 8px;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.tell-me-more-btn:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #5a6fd8;
}

/* Statistics Extra Info Styles */
.statistics-extra-info {
    margin-top: 15px;
    padding: 20px;
    background-color: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 6px;
    animation: slideDown 0.3s ease-out;
}

.statistics-extra-info p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #333;
}

.statistics-extra-info p:last-child {
    margin-bottom: 0;
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
        padding-top: 20px;
        padding-bottom: 20px;
    }
}

/* Example Data Section Styles */
.example-data-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.example-data-section label {
    color: #555;
    font-weight: 500;
    font-size: 0.95rem;
}

.example-data-section select {
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 200px;
}

.example-data-section select:hover {
    border-color: #5568d3;
    background: #f8f9ff;
}

.example-data-section select:focus {
    outline: none;
    border-color: #5568d3;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Collapsible Section Styles */
.collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.collapsible-header:hover {
    color: #667eea;
}

.collapsible-header:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 4px;
}

.collapse-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.8em;
    min-width: 20px;
}

.collapse-icon.collapsed {
    transform: rotate(-90deg);
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease;
    max-height: 5000px;
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

/* Status Message Styles */
.status-message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.status-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
    font-size: 0.95rem;
    line-height: 1.4;
}

.status-message.fade-out {
    animation: slideOut 0.3s ease-out forwards;
}

.status-info {
    background: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #1976d2;
}

.status-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.status-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .status-message-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .status-message {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
}

/* Validation Error Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

.modal-content h2 {
    color: #dc3545;
    margin-bottom: 15px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-content p {
    color: #333;
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 1rem;
}

.modal-close-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
}

.modal-close-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Invalid cell highlighting */
input.invalid-data {
    background-color: #ffebee !important;
    border: 2px solid #dc3545 !important;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Multi-variable Analysis Styles */
.multi-variable-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.multi-variable-controls .control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.multi-variable-controls label {
    font-weight: 600;
    color: #444;
}

.multi-variable-controls select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s;
}

.multi-variable-controls select:focus {
    border-color: #667eea;
    outline: none;
}

.multi-variable-controls select[multiple] {
    min-height: 120px;
}

.multi-variable-controls .help-text {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: -4px;
}

.multi-variable-controls button {
    margin-top: 10px;
}

.multi-variable-results {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.multi-variable-results h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.analysis-result {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.analysis-result h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.analysis-result h5 {
    color: #444;
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 1rem;
}

.analysis-result ul {
    list-style: none;
    padding-left: 0;
    margin: 10px 0;
}

.analysis-result li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.analysis-result li:last-child {
    border-bottom: none;
}

.analysis-result .interpretation {
    background: #e8f4f8;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 0.95rem;
    color: #2c5f77;
    border-left: 3px solid #3498db;
}

.pca-results,
.regression-results,
.deeplearning-results {
    margin-top: 10px;
}

/* GAD-7 Questionnaire Styles */
.gad7-footer-note {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    color: #856404;
}

.gad7-footer-note p {
    margin: 10px 0;
    line-height: 1.6;
}

.gad7-footer-note p:first-child {
    margin-top: 0;
}

.gad7-footer-note p:last-child {
    margin-bottom: 0;
}

.gad7-footer-note strong {
    color: #664d03;
    font-size: 1.05em;
}

.gad7-footer-note a {
    color: #0056b3;
    text-decoration: underline;
    word-break: break-all;
}

.gad7-footer-note a:hover {
    color: #003d82;
}

.gad7-score-cell {
    background-color: #f8f9fa !important;
    font-weight: 600;
    color: #495057;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 9999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #5568d3;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.back-to-top:active {
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* Analysis section checkbox styles */
.analysis-header-with-checkbox {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.analysis-header-with-checkbox h3 {
    margin: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    user-select: none;
    padding: 6px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: background-color 0.2s, border-color 0.2s;
}

.checkbox-label:hover {
    background-color: #e9ecef;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-label span {
    font-weight: 500;
}

@media (max-width: 768px) {
    .analysis-header-with-checkbox {
        flex-direction: column;
        align-items: flex-start;
/* What-If Analysis Styles */
.what-if-analysis {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.what-if-analysis h5 {
    color: #444;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.what-if-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.what-if-input-group {
    display: flex;
    flex-direction: column;
}

.what-if-input-group label {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.what-if-input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.what-if-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.what-if-calc-btn {
    margin-top: 10px;
}

.what-if-result {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

.what-if-result p {
    margin: 0;
    font-size: 1.1rem;
}

.what-if-result strong {
    color: #333;
}

.what-if-result span {
    color: #28a745;
    font-weight: 700;
    font-size: 1.2rem;

/* Auto-update notification styles */
.auto-update-notification {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #667eea;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
    max-width: 300px;
}

.auto-update-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Local Edit Mode Banner */
.local-edit-banner {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border: 2px solid #f39c12;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.local-edit-banner .banner-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.local-edit-banner .banner-text {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
}

.local-edit-banner .banner-close-btn {
    background: #e67e22;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.local-edit-banner .banner-close-btn:hover {
    background: #d35400;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.local-edit-banner .banner-close-btn:active {
    transform: translateY(0);
}

/* Example Data Modal Specific Styles */
#exampleDataModal .modal-content {
    max-width: 550px;
}

#exampleDataModal .modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 18px; /* Increased from 12px for better spacing */
    margin-top: 20px;
}

#exampleDataModal .modal-buttons button {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    position: relative;
}

#exampleDataModal .primary-btn {
    background: linear-gradient(135deg, #4c5fd5 0%, #667eea 100%); /* Changed to match app theme, more distinct from secondary */
    color: white;
    box-shadow: 0 4px 6px rgba(76, 95, 213, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2); /* Added border for more distinction */
}

#exampleDataModal .primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(76, 95, 213, 0.4);
}

#exampleDataModal .secondary-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(245, 87, 108, 0.3);
}

#exampleDataModal .secondary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(245, 87, 108, 0.4);
}

#exampleDataModal .cancel-btn {
    background: #95a5a6;
    color: white;
}

#exampleDataModal .cancel-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

#exampleDataModal .modal-buttons button:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .auto-update-notification {
        bottom: 80px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
    .local-edit-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 15px;
    }
    
    .local-edit-banner .banner-close-btn {
        width: 100%;
        text-align: center;
    }
    
    #exampleDataModal .modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
}

