:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f6fa;
    --text-color: #2c3e50;
    --border-color: #dcdde1;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f1c40f;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

nav {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

nav button {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
    color: #7f8c8d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
}

nav button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: bold;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

h2 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

textarea {
    resize: vertical;
    min-height: 60px;
}

.subject-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    background: var(--secondary-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.subject-row > div {
    display: flex;
    flex-direction: column;
}

.subject-row label {
    font-size: 0.85rem;
    margin-bottom: 5px;
    white-space: nowrap;
}

.subject-row h4 {
    grid-column: 1 / -1;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.remove-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.2s;
}

.remove-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    margin-top: 10px;
}

.secondary-btn {
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 15px;
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.controls .form-group {
    margin-bottom: 0;
}

.chart-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    min-height: 400px;
    max-height: 500px;
    margin-bottom: 30px;
    overflow: auto;
    position: relative;
}

.chart-container canvas {
    max-height: 450px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card .stat-value {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 8px;
    word-wrap: break-word;
    line-height: 1.2;
}

.stat-card .stat-label {
    color: #7f8c8d;
    font-size: 0.8rem;
    line-height: 1.3;
}

.entry-item {
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

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

.entry-info {
    flex: 1;
    min-width: 0;
}

.entry-info strong {
    display: block;
    margin-bottom: 4px;
}

.entry-date {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.empty-state {
    text-align: center;
    color: #95a5a6;
    padding: 20px;
}

.upload-section {
    text-align: center;
    padding: 20px;
    background: var(--secondary-color);
    border-radius: 8px;
    margin-bottom: 20px;
}

.upload-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-btn:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.upload-status {
    margin-top: 20px;
}

.loading {
    color: var(--primary-color);
    font-weight: bold;
    padding: 15px;
    background: #e8f4f8;
    border-radius: 5px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.error {
    color: var(--danger-color);
    padding: 15px;
    background: #ffe8e8;
    border-radius: 5px;
    border-left: 4px solid var(--danger-color);
}

.ocr-success {
    color: var(--success-color);
    font-weight: bold;
    padding: 15px;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 5px;
    border-left: 4px solid var(--success-color);
    margin-bottom: 15px;
}

.ocr-preview-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    margin: 15px 0;
    border: 2px solid var(--border-color);
}

.ocr-preview-box p {
    margin: 10px 0;
}

.ocr-preview-box ul {
    margin: 10px 0 10px 20px;
}

.ocr-preview-box li {
    margin: 5px 0;
}

.ocr-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.multi-student-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.student-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.student-card:has(input:checked) {
    border-color: var(--primary-color);
    background: rgba(74, 144, 226, 0.05);
}

.student-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.student-header input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.student-header label {
    cursor: pointer;
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
}

.student-details {
    font-size: 0.9rem;
    color: #666;
}

.student-details p {
    margin: 8px 0;
}

.entry-score {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
}

.score-percent {
    display: block;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.score-breakdown {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-correct {
    background-color: rgba(46, 204, 113, 0.15);
    color: #27ae60;
    border: 1px solid #27ae60;
}

.badge-wrong {
    background-color: rgba(231, 76, 60, 0.15);
    color: #c0392b;
    border: 1px solid #c0392b;
}

.badge-empty {
    background-color: rgba(149, 165, 166, 0.15);
    color: #7f8c8d;
    border: 1px solid #95a5a6;
}

.entry-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.7;
}

.action-btn:hover {
    opacity: 1;
    background: var(--secondary-color);
}

.edit-btn:hover {
    background: #e8f4f8;
}

.delete-btn:hover {
    background: #ffe8e8;
}

.icon-btn {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    margin-left: 5px;
}

.icon-btn:hover {
    background: var(--primary-color);
    color: white;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.card-header h2 {
    margin: 0;
    padding-bottom: 0;
    border: none;
    flex: 1 1 auto;
}

.data-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.data-actions .search-input {
    flex: 1 1 200px;
    min-width: 150px;
}

.subject-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.subject-stat-item {
    background: var(--secondary-color);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subject-stat-item strong {
    font-size: 0.95rem;
}

.subject-stat-item span {
    font-size: 1.5rem;
    font-weight: bold;
}

.subject-stat-item small {
    color: #7f8c8d;
    font-size: 0.85rem;
}

.subject-stat-item.good {
    border-left-color: var(--success-color);
    background: rgba(46, 204, 113, 0.1);
}

.subject-stat-item.good span {
    color: var(--success-color);
}

.subject-stat-item.medium {
    border-left-color: var(--warning-color);
    background: rgba(241, 196, 15, 0.1);
}

.subject-stat-item.medium span {
    color: var(--warning-color);
}

.subject-stat-item.poor {
    border-left-color: var(--danger-color);
    background: rgba(231, 76, 60, 0.1);
}

.subject-stat-item.poor span {
    color: var(--danger-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .subject-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .subject-row label {
        font-size: 0.75rem;
    }
    
    .subject-row input {
        padding: 8px;
        font-size: 0.9rem;
    }
    
    .subject-row > div:last-child {
        grid-column: 1 / -1;
        margin-top: 10px;
    }
    
    .controls {
        grid-template-columns: 1fr;
    }
    
    .subject-stats {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    nav {
        width: 100%;
    }
    
    nav button {
        flex: 1;
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .data-actions {
        width: 100%;
    }
    
    .icon-btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .chart-container {
        min-height: 300px;
        max-height: 350px;
        padding: 15px;
    }
    
    .chart-container canvas {
        max-height: 280px !important;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    h2 {
        font-size: 1rem;
    }
    
    .card {
        padding: 15px;
    }
}

/* ===================================
   NEW FEATURES STYLES
   =================================== */

/* Quick Stats Cards */
.quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.quick-stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
}

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

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.stat-info .stat-value {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
    word-break: break-word;
    line-height: 1.2;
}

.stat-info .stat-label {
    font-size: 0.8rem;
    color: #7f8c8d;
    word-break: break-word;
    line-height: 1.2;
}

/* Search & Filter */
.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.95rem;
}

/* Bulk Actions */
.bulk-actions {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.bulk-actions p {
    margin: 0;
    font-weight: 500;
}

#selected-count {
    color: var(--primary-color);
    font-weight: bold;
}

.bulk-checkbox {
    width: 20px !important;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.danger-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.danger-btn:hover {
    background: #c0392b;
}

.secondary-btn-small {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.remove-btn-small {
    background: var(--danger-color);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s;
}

.remove-btn-small:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Custom Date Range */
.custom-date-range {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--secondary-color);
    border-radius: 8px;
}

.custom-date-range .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Performance Alerts */
.alerts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid;
    font-size: 0.95rem;
    animation: slideIn 0.3s ease-out;
}

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

.alert-danger {
    background: #ffe8e8;
    border-left-color: var(--danger-color);
}

.alert-warning {
    background: #fff3cd;
    border-left-color: var(--warning-color);
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    border-left-color: var(--success-color);
}

/* Goals Section */
.goals-section .goal-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    align-items: end;
    margin-bottom: 25px;
}

.goals-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.goal-item {
    background: var(--secondary-color);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.goal-item:hover {
    transform: translateX(5px);
}

.goal-item.success {
    border-left-color: var(--success-color);
    background: rgba(46, 204, 113, 0.1);
}

.goal-item.warning {
    border-left-color: var(--warning-color);
    background: rgba(241, 196, 15, 0.1);
}

.goal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.goal-progress {
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* Report Actions */
.report-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.report-actions button,
.report-actions label {
    cursor: pointer;
    text-align: center;
}

/* OCR Experimental Badge */
.feature-badge {
    display: inline-block;
    background: #ff9800;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.ocr-results-card {
    background: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
    border: 2px solid var(--border-color);
}

.ocr-results-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.ocr-results-card h4 {
    margin-top: 15px;
    margin-bottom: 10px;
}

.ocr-results-card ul {
    margin: 10px 0 15px 20px;
}

.ocr-results-card li {
    margin: 5px 0;
}

.ocr-results-card .warning {
    color: var(--warning-color);
    font-weight: 500;
}

.ocr-loading {
    text-align: center;
    padding: 30px;
}

.spinner {
    border: 4px solid var(--secondary-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Textarea styling */
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

/* Notes icon in entry list */
.entry-notes-icon {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-left: 5px;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-actions button {
    flex: 1;
}

/* Entry item with checkbox */
.entry-item.with-checkbox {
    padding-left: 35px;
    position: relative;
}

/* Responsive adjustments for new features */
@media (max-width: 768px) {
    .quick-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .score-breakdown {
        width: 100%;
    }
    
    .entry-score {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .bulk-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .goals-section .goal-form {
        grid-template-columns: 1fr;
    }
    
    .report-actions {
        grid-template-columns: 1fr;
    }
    
    .custom-date-range {
        flex-direction: column;
    }
    
    .alerts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .quick-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-info .stat-value {
        font-size: 1.5rem;
    }
}

/* ================================
   ADVANCED VISUALIZATIONS
   ================================ */

.viz-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    flex-wrap: wrap;
}

.viz-tab {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
    white-space: nowrap;
}

.viz-tab:hover {
    background: var(--secondary-color);
    border-color: var(--primary-color);
}

.viz-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: bold;
}

/* Heatmap Grid */
#heatmapGrid {
    display: grid;
    gap: 2px;
    padding: 20px;
    overflow-x: auto;
}

.heatmap-row {
    display: flex;
    gap: 2px;
}

.heatmap-cell {
    min-width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: bold;
    transition: transform 0.2s;
    cursor: pointer;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 10;
}

.heatmap-label {
    font-weight: bold;
    min-width: 100px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 0.9rem;
}

.heatmap-score {
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.heatmap-detail {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Heatmap Color Scale */
.heatmap-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding: 15px;
    background: var(--secondary-color);
    border-radius: 8px;
}

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

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

/* Chart enhancements */
#chart-radar canvas,
#chart-bar canvas {
    max-height: 400px;
}

/* Performance color indicators */
.perf-excellent { background: #27ae60; color: white; }
.perf-good { background: #2ecc71; color: white; }
.perf-average { background: #f39c12; color: white; }
.perf-poor { background: #e67e22; color: white; }
.perf-verypoor { background: #e74c3c; color: white; }

/* Responsive viz tabs */
@media (max-width: 768px) {
    .viz-tabs {
        justify-content: center;
    }
    
    .viz-tab {
        flex: 1 1 45%;
        min-width: 140px;
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    .heatmap-cell {
        min-width: 50px;
        height: 50px;
        font-size: 0.75rem;
    }
    
    .heatmap-label {
        min-width: 80px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .viz-tabs {
        flex-direction: column;
    }
    
    .viz-tab {
        width: 100%;
    }
    
    .heatmap-cell {
        min-width: 40px;
        height: 40px;
        font-size: 0.7rem;
    }
}

/* ================================
   FIREBASE AUTH UI STYLES
   ================================ */

/* Auth Container in Header */
.auth-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.auth-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.auth-status-logged-in {
    background: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.auth-status-logged-out {
    background: #95a5a6;
}

.auth-user-nickname {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
    padding: 4px 8px;
    background: #e8f4e8;
    border-radius: 4px;
}

.auth-user-email {
    font-size: 0.85rem;
    color: #666;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-hint {
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    margin-top: 15px;
    font-style: italic;
}

.auth-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    background: var(--primary-color);
    color: white;
}

.auth-btn:hover {
    background: #3a7bc8;
    transform: translateY(-1px);
}

.auth-logout {
    background: #95a5a6;
}

.auth-logout:hover {
    background: #7f8c8d;
}

/* Auth Modal */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.auth-modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.auth-modal-close:hover {
    color: var(--danger-color);
}

.auth-modal-content h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary-color);
    border: none;
    padding: 0;
}

.auth-submit-btn {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    font-size: 1.1rem;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Auth Overlay for Protected Sections */
.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 10px;
}

.auth-overlay-content {
    text-align: center;
    padding: 30px;
}

.auth-overlay-content span {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.auth-overlay-content p {
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Disabled Write Actions */
.write-action.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Firebase Notifications */
.firebase-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: notificationSlideIn 0.3s ease;
    max-width: 350px;
}

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

.notification-fade {
    opacity: 0;
    transition: opacity 0.3s;
}

.notification-success {
    background: var(--success-color);
}

.notification-error {
    background: var(--danger-color);
}

.notification-warning {
    background: #e67e22;
}

.notification-info {
    background: var(--primary-color);
}

/* Responsive Auth */
@media (max-width: 768px) {
    .auth-container {
        order: -1;
        width: 100%;
        justify-content: flex-end;
    }
    
    .auth-user-email {
        max-width: 120px;
    }
    
    .auth-modal-content {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .auth-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .auth-user-email {
        display: none;
    }
    
    .firebase-notification {
        left: 20px;
        right: 20px;
        bottom: 10px;
    }
}
