/* ========================================
   PARENT DASHBOARD STYLES
   ======================================== */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ========== HEADER ========== */
.dashboard-header {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.dashboard-header h1 {
    font-size: 28px;
    color: #333;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn-refresh,
.btn-back {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-refresh {
    background: #667eea;
    color: white;
}

.btn-refresh:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-back {
    background: #f0f0f0;
    color: #333;
}

.btn-back:hover {
    background: #e0e0e0;
}

/* ========== LOADING ========== */
.loading {
    background: white;
    border-radius: 16px;
    padding: 60px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.loading p {
    color: #666;
    font-size: 16px;
}

/* ========== SECTIONS ========== */
.stats-section,
.chart-section,
.words-section,
.history-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.stats-section h2,
.chart-section h2,
.words-section h2,
.history-section h2 {
    font-size: 22px;
    color: #333;
    margin-bottom: 20px;
    font-weight: 700;
}

/* ========== STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    color: white;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card-large {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* ========== CHART ========== */
.chart-container {
    position: relative;
    height: 300px;
    padding: 20px 0;
}

/* ========== WORDS SECTION ========== */
.words-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.word-category {
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid;
}

.word-category.mastered {
    background: #e8f5e9;
    border-color: #4caf50;
}

.word-category.learning {
    background: #fff3e0;
    border-color: #ff9800;
}

.word-category.practice {
    background: #ffebee;
    border-color: #f44336;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.category-icon {
    font-size: 24px;
}

.category-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.category-count {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.category-desc {
    font-size: 12px;
    color: #666;
}

/* ========== WORDS DETAIL ========== */
.words-detail {
    margin-top: 32px;
}

.words-detail h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 16px;
}

.words-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.word-tab {
    padding: 12px 24px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.word-tab:hover {
    color: #667eea;
}

.word-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.words-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
}

.word-item {
    background: white;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.word-item:hover {
    transform: scale(1.05);
}

.word-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.word-mastery {
    font-size: 12px;
    color: #666;
}

.mastery-bar {
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.mastery-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

/* ========== SESSIONS LIST ========== */
.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.session-item {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    transition: background 0.3s;
}

.session-item:hover {
    background: #f0f0f0;
}

.session-info {
    flex: 1;
    min-width: 200px;
}

.session-time {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.session-details {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.session-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

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

.session-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

.session-stat-label {
    font-size: 12px;
    color: #666;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 16px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .dashboard-header {
        padding: 16px;
    }

    .dashboard-header h1 {
        font-size: 22px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .words-summary {
        grid-template-columns: 1fr;
    }

    .words-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .session-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .session-stats {
        width: 100%;
        justify-content: space-around;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header-actions {
        width: 100%;
    }

    .btn-refresh,
    .btn-back {
        flex: 1;
    }
}