/* Parent Dashboard Styles */
:root {
    /* Professional Color Palette */
    --primary-blue: #2563eb;
    --primary-blue-dark: #1d4ed8;
    --secondary-indigo: #6366f1;
    --accent-emerald: #10b981;
    --accent-orange: #f59e0b;
    --accent-rose: #f43f5e;
    
    /* Neutral Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Status Colors */
    --success: #22c55e;
    --warning: #eab308;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Layout */
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header Styles */
.dashboard-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo-section h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.25rem;
}

.logo-section p {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.child-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.child-selector label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
}

.child-dropdown {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    background: white;
    font-size: 0.875rem;
    color: var(--gray-700);
    min-width: 200px;
    transition: all 0.2s ease;
}

.child-dropdown:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

.refresh-btn, .back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    background: white;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.refresh-btn:hover, .back-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-1px);
}

.refresh-btn .icon, .back-btn .icon {
    font-size: 1rem;
}

/* Main Dashboard */
.dashboard-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Card Base Styles */
.overview-section, .progress-section, .skills-section, 
.analytics-section, .activity-section, .recommendations-section, .reports-section {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Child Profile Card */
.child-profile-card {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.child-avatar-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.child-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-blue);
    object-fit: cover;
}

.child-basic-info h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.child-basic-info p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Progress Section */
.progress-card {
    padding: 2rem;
}

.progress-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
}

.level-progress {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.level-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-level {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.level-description {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-indigo));
    border-radius: 6px;
    transition: width 0.3s ease;
}

.progress-percentage {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    min-width: 40px;
}

/* Skills Section */
.skills-card {
    padding: 2rem;
}

.skills-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.skill-item {
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.skill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.skill-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
}

.skill-rating {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.skill-progress {
    margin-bottom: 0.75rem;
}

.skill-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.skill-fill.spelling {
    background: linear-gradient(90deg, var(--accent-emerald), #34d399);
}

.skill-fill.vocabulary {
    background: linear-gradient(90deg, var(--accent-orange), #fbbf24);
}

.skill-fill.comprehension {
    background: linear-gradient(90deg, var(--accent-rose), #fb7185);
}

.skill-attempts {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Analytics Section */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-card {
    padding: 2rem;
}

.chart-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
}

.chart-container {
    height: 300px;
    position: relative;
}

/* Activity Section */
.activity-card {
    padding: 2rem;
}

.activity-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
}

.activity-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    background: white;
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--gray-50);
}

.filter-btn.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.activity-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Recommendations Section */
.recommendations-card {
    padding: 2rem;
}

.recommendations-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.recommendation-item {
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.recommendation-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.recommendation-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.recommendation-content ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recommendation-content li {
    font-size: 0.875rem;
    color: var(--gray-600);
    padding-left: 1rem;
    position: relative;
}

.recommendation-content li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-blue);
    font-weight: bold;
}

.achievement-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--accent-emerald), #34d399);
    color: white;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0.25rem;
}

.badge-icon {
    font-size: 1rem;
}

/* Reports Section */
.reports-card {
    padding: 2rem;
}

.reports-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.report-item {
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    text-align: center;
}

.report-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}

.report-item p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.report-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-btn:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-1px);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: var(--shadow-xl);
}

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

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

.loading-spinner p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: var(--primary-blue-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

/* Edit Profile Modal and Form */
.edit-profile-form { 
    display: flex; 
    flex-direction: column; 
    gap: 14px; 
}

.edit-profile-form .form-row { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
}

.edit-profile-form label { 
    font-size: 0.85rem; 
    font-weight: 600; 
    color: #334155; 
}

.edit-profile-form input, 
.edit-profile-form select { 
    padding: 10px 12px; 
    border: 1px solid #cbd5e1; 
    border-radius: 8px; 
    font-size: 0.9rem; 
    background: #fff; 
    transition: border-color .2s, box-shadow .2s; 
}

.edit-profile-form input:focus, 
.edit-profile-form select:focus { 
    outline: none; 
    border-color: #6366f1; 
    box-shadow: 0 0 0 3px rgba(99,102,241,0.25); 
}

.edit-profile-form .form-actions { 
    display: flex; 
    justify-content: flex-end; 
    gap: 10px; 
    margin-top: 4px; 
}

.btn-primary { 
    background: #2563eb; 
    color: #fff; 
    border: none; 
    padding: 10px 16px; 
    border-radius: 8px; 
    font-weight: 600; 
    cursor: pointer; 
}

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

.btn-secondary { 
    background: #e2e8f0; 
    color: #334155; 
    border: none; 
    padding: 10px 16px; 
    border-radius: 8px; 
    font-weight: 600; 
    cursor: pointer; 
}

.btn-secondary:hover { 
    background: #cbd5e1; 
}

.modal.show { 
    display: flex; 
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-main {
        padding: 1rem;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .child-profile-card {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .recommendations-grid {
        grid-template-columns: 1fr;
    }
    
    .reports-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .child-dropdown {
        min-width: 150px;
    }
    
    .refresh-btn, .back-btn {
        padding: 0.5rem;
    }
    
    .refresh-btn span:not(.icon), .back-btn span:not(.icon) {
        display: none;
    }
    
    .quick-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .activity-filter {
        flex-wrap: wrap;
    }
}

/* Utility Classes */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-info { color: var(--info); }

.bg-success { background-color: var(--success); }
.bg-warning { background-color: var(--warning); }
.bg-error { background-color: var(--error); }
.bg-info { background-color: var(--info); }

.hidden { display: none; }
.sr-only { 
    position: absolute; 
    width: 1px; 
    height: 1px; 
    padding: 0; 
    margin: -1px; 
    overflow: hidden; 
    clip: rect(0,0,0,0); 
    border: 0; 
}
