/* Reset and Base 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%);
    color: #333;
    line-height: 1.6;
    padding-bottom: 80px;
    min-height: 100vh;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 1.5rem;
    color: #2196F3;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#userGreeting {
    font-size: 0.9rem;
    color: #666;
}

.profile-btn {
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-btn:hover {
    background: #1976D2;
    transform: scale(1.05);
}

/* Main Content */
main {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.section.active {
    display: block;
}

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

/* Cards */
.welcome-card, .profile-card, .challenge-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-card h2 {
    color: #2196F3;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.welcome-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 1rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #FFC107, #ff9800);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #9C27B0, #7b1fa2);
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.3);
}

.stat-card i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* Quick Actions */
.quick-actions h3, .daily-challenge h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.action-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #2196F3;
    border-radius: 15px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #2196F3;
}

.action-btn:hover {
    background: #2196F3;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.3);
}

.action-btn i {
    font-size: 1.5rem;
}

/* Daily Challenge */
.challenge-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.challenge-info h4 {
    color: #2196F3;
    margin-bottom: 0.5rem;
}

.challenge-info p {
    color: #666;
    font-size: 0.9rem;
}

.challenge-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.challenge-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.4);
}

/* Games Section */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid #2196F3;
    color: #2196F3;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.9rem;
}

.tab-btn.active, .tab-btn:hover {
    background: #2196F3;
    color: white;
}

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

.game-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: #2196F3;
}

.game-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.game-card h4 {
    color: #2196F3;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.game-card p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.difficulty-badge {
    background: #4CAF50;
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.difficulty-badge.medium {
    background: #FFC107;
}

.difficulty-badge.hard {
    background: #F44336;
}

.difficulty-badge.expert {
    background: #9C27B0;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #666;
}

/* Game Area */
.game-area {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.game-area.hidden {
    display: none;
}

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

.back-btn {
    background: #666;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

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

#currentGameTitle {
    color: #2196F3;
    font-size: 1.3rem;
}

.game-stats {
    display: flex;
    gap: 1rem;
    font-weight: bold;
}

.game-content {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 2rem;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.control-btn {
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #1976D2;
    transform: scale(1.1);
}

/* Memory Game Specific */
.memory-grid {
    display: grid;
    gap: 0.5rem;
    margin: 1rem 0;
}

.memory-card {
    aspect-ratio: 1;
    background: #2196F3;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.5rem;
    color: white;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transform-style: preserve-3d;
}

.memory-card .card-back,
.memory-card .card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    transition: all 0.3s ease;
}

.memory-card .card-front {
    transform: rotateY(180deg);
    background: #4CAF50;
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card.flipped .card-front {
    transform: rotateY(0deg);
}

.memory-card.matched {
    background: #FFC107;
    cursor: default;
    animation: cardMatched 0.5s ease-out;
}

@keyframes cardMatched {
    0% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.1); }
    100% { transform: rotateY(180deg) scale(1); }
}

/* Logic Game Specific */
.sequence-display {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    justify-content: center;
    flex-wrap: wrap;
}

.sequence-item {
    width: 60px;
    height: 60px;
    background: #e0e0e0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.sequence-item.active {
    background: #2196F3;
    color: white;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.answer-input {
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.2rem;
    text-align: center;
    width: 200px;
    margin: 1rem;
}

.answer-input:focus {
    border-color: #2196F3;
    outline: none;
}

.submit-answer {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.8rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.submit-answer:hover {
    background: #45a049;
    transform: translateY(-2px);
}

/* Focus Game Specific */
.focus-target {
    width: 100px;
    height: 100px;
    background: #F44336;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 2rem auto;
    position: relative;
    z-index: 10;
}

.focus-target:hover {
    transform: scale(1.1);
}

.focus-target.hit {
    background: #4CAF50;
    animation: hit 0.3s ease-out;
}

@keyframes hit {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Focus Color Game Specific */
.focus-color-game {
    text-align: center;
    padding: 1rem;
}

.color-challenge {
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.color-word {
    font-size: 3rem !important;
    font-weight: bold;
    margin: 2rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.color-option {
    background: var(--color, #e0e0e0);
    color: white;
    border: 3px solid transparent;
    border-radius: 15px;
    padding: 1rem 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.color-option.correct {
    background: #4CAF50 !important;
    border-color: #45a049;
    animation: correctAnswer 0.5s ease-out;
}

.color-option.incorrect {
    background: #F44336 !important;
    border-color: #d32f2f;
    animation: incorrectAnswer 0.5s ease-out;
}

.color-option:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.answer-option:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

@keyframes correctAnswer {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes incorrectAnswer {
    0% { transform: scale(1); }
    25% { transform: scale(1.05) rotate(-2deg); }
    75% { transform: scale(1.05) rotate(2deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Speed Reaction Game Specific */
.speed-reaction-game {
    text-align: center;
    padding: 1rem;
}

.reaction-area {
    width: 100%;
    height: 300px;
    background: #f0f0f0;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.reaction-area:hover {
    border-color: #2196F3;
}

.reaction-status {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.reaction-status p {
    margin: 0;
    line-height: 1.5;
}

/* Speed Math Game Specific */
.speed-math-game {
    text-align: center;
    padding: 1rem;
}

.math-problem {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2196F3;
    margin: 2rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.answer-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 2rem 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.answer-option {
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid #2196F3;
    color: #2196F3;
    padding: 1.5rem;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: bold;
    transition: all 0.3s ease;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer-option:hover {
    background: #2196F3;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(33, 150, 243, 0.3);
}

.answer-option.correct {
    background: #4CAF50;
    border-color: #45a049;
    color: white;
    animation: correctAnswer 0.5s ease-out;
}

.answer-option.incorrect {
    background: #F44336;
    border-color: #d32f2f;
    color: white;
    animation: incorrectAnswer 0.5s ease-out;
}

/* Sequence Display Improvements */
.sequence-display {
    display: flex;
    gap: 0.8rem;
    margin: 2rem 0;
    justify-content: center;
    flex-wrap: wrap;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sequence-item {
    width: 70px;
    height: 70px;
    background: #e0e0e0;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sequence-item.active {
    background: #2196F3;
    color: white;
    animation: pulse 0.6s ease-in-out;
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.4);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Memory Sequence Game Specific */
.memory-sequence-game {
    text-align: center;
    padding: 1rem;
}

.sequence-display .sequence-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.sequence-display .sequence-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sequence-display .sequence-item:active {
    transform: scale(0.95);
}

/* Logic Games Specific */
.logic-pattern-game,
.logic-numbers-game {
    text-align: center;
    padding: 1rem;
}

/* Focus Target Game Specific */
.focus-target-game {
    text-align: center;
    padding: 1rem;
}

/* Answer Section Improvements */
.answer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.hint-section {
    text-align: center;
    margin: 1rem 0;
}

/* Target Area Improvements */
.target-area {
    position: relative;
    width: 100%;
    height: 300px;
    background: #f0f0f0;
    border-radius: 15px;
    border: 3px solid #ddd;
    overflow: hidden;
}

.target-area p {
    text-align: center;
    padding-top: 130px;
    color: #666;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Profile Section */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.avatar {
    font-size: 3rem;
    color: #2196F3;
}

.profile-info h3 {
    color: #333;
    margin-bottom: 0.2rem;
}

.profile-info p {
    color: #666;
    font-size: 0.9rem;
}

.edit-btn {
    background: #FFC107;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.3s ease;
}

.edit-btn:hover {
    background: #ff9800;
    transform: scale(1.05);
}

.progress-section {
    margin-bottom: 1.5rem;
}

.progress-section h4 {
    color: #333;
    margin-bottom: 0.8rem;
}

.progress-bar {
    background: #e0e0e0;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-text {
    color: #666;
    font-size: 0.9rem;
    text-align: center;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
}

.achievement-badge {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.achievement-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.achievement-badge.earned {
    background: linear-gradient(135deg, #FFC107, #ff9800);
    color: white;
}

.achievement-badge i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.achievement-badge span {
    display: block;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Profile Form */
.profile-form {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.profile-form.hidden {
    display: none;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #2196F3;
    outline: none;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.cancel-btn {
    background: #666;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #555;
}

.save-btn {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background: #45a049;
}

/* Reports Section */
.report-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    color: #333;
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-group select {
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    min-width: 120px;
}

.generate-btn {
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    height: fit-content;
}

.generate-btn:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

.report-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 1.5rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.summary-card:nth-child(2) {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.summary-card:nth-child(3) {
    background: linear-gradient(135deg, #FFC107, #ff9800);
}

.summary-card:nth-child(4) {
    background: linear-gradient(135deg, #F44336, #d32f2f);
}

.summary-card h4 {
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.summary-number {
    font-size: 2rem;
    font-weight: bold;
}

.chart-container {
    margin: 2rem 0;
    background: white;
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.detailed-stats h4 {
    color: #333;
    margin-bottom: 1rem;
}

.stats-table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stats-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.stats-row:nth-child(even) {
    background: #f8f9fa;
}

.stats-row:first-child {
    background: #2196F3;
    color: white;
    font-weight: bold;
}

/* Settings Section */
.settings-groups {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-group {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 1.5rem;
}

.settings-group h3 {
    color: #2196F3;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

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

.setting-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
    justify-content: space-between;
}

.setting-toggle {
    position: relative;
    width: 50px;
    height: 24px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 12px;
    outline: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.setting-toggle:checked {
    background: #4CAF50;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.setting-toggle:checked + .toggle-slider {
    transform: translateX(26px);
}

.setting-item input[type="time"],
.setting-item select {
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    min-width: 120px;
}

.action-btn.secondary {
    background: #666;
    color: white;
}

.action-btn.secondary:hover {
    background: #555;
}

.action-btn.danger {
    background: #F44336;
    color: white;
}

.action-btn.danger:hover {
    background: #d32f2f;
}

/* FAQ Section */
.faq-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.faq-section h2 {
    color: #2196F3;
    margin-bottom: 1.5rem;
    text-align: center;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: #2196F3;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: #f8f9fa;
}

.faq-question[aria-expanded="true"] {
    background: #2196F3;
    color: white;
}

.faq-icon {
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1.5rem 1rem;
    color: #666;
    line-height: 1.6;
    animation: slideDown 0.3s ease-out;
}

.faq-answer[hidden] {
    display: none;
}

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

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 0.8rem 0;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 15px;
    min-width: 60px;
}

.nav-item:hover {
    color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
}

.nav-item.active {
    color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 0;
}

.modal-header h3 {
    color: #2196F3;
    font-size: 1.5rem;
}

.close-btn {
    background: #666;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #555;
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
}

.result-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.result-item i {
    font-size: 1.5rem;
    color: #2196F3;
}

.achievements-earned {
    margin-top: 1rem;
}

.achievement-notification {
    background: linear-gradient(135deg, #FFC107, #ff9800);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: achievementPop 0.5s ease-out;
}

@keyframes achievementPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.modal-footer {
    display: flex;
    gap: 1rem;
    padding: 0 1.5rem 1.5rem;
    justify-content: center;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    text-align: center;
    color: #2196F3;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.loading-spinner p {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: 2rem;
}

footer p {
    margin: 0.5rem 0;
}

footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
}

footer a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

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

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* Responsive Design */
@media (max-width: 768px) {
    .action-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-row {
        grid-template-columns: 2fr 1fr;
        gap: 0.5rem;
    }
    
    .stats-row span:nth-child(3),
    .stats-row span:nth-child(4) {
        display: none;
    }
    
    .report-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .generate-btn {
        justify-content: center;
    }
    
    .challenge-card {
        flex-direction: column;
        text-align: center;
    }
    
    .game-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.2rem;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .bottom-nav {
        padding: 0.5rem 0;
    }
    
    .nav-item span {
        font-size: 0.6rem;
    }
    
    .category-tabs {
        justify-content: flex-start;
    }
    
    .tab-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    body.theme-auto {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
        color: #e0e0e0;
    }
    
    body.theme-auto header,
    body.theme-auto .bottom-nav {
        background: rgba(30, 30, 30, 0.95);
    }
    
    body.theme-auto .welcome-card,
    body.theme-auto .profile-card,
    body.theme-auto .challenge-card,
    body.theme-auto .game-card,
    body.theme-auto .settings-group,
    body.theme-auto .faq-section {
        background: rgba(40, 40, 40, 0.95);
        color: #e0e0e0;
    }
}

/* Manual dark theme */
body.theme-dark {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
}

body.theme-dark header,
body.theme-dark .bottom-nav {
    background: rgba(30, 30, 30, 0.95);
}

body.theme-dark .welcome-card,
body.theme-dark .profile-card,
body.theme-dark .challenge-card,
body.theme-dark .game-card,
body.theme-dark .settings-group,
body.theme-dark .faq-section {
    background: rgba(40, 40, 40, 0.95);
    color: #e0e0e0;
}

body.theme-dark .welcome-card h2,
body.theme-dark .profile-card h2,
body.theme-dark .challenge-card h2,
body.theme-dark .settings-group h3 {
    color: #64B5F6;
}

body.theme-dark .action-btn,
body.theme-dark .tab-btn,
body.theme-dark .nav-item {
    background: rgba(60, 60, 60, 0.9);
    color: #e0e0e0;
}

body.theme-dark .action-btn:hover,
body.theme-dark .tab-btn:hover,
body.theme-dark .nav-item:hover {
    background: rgba(80, 80, 80, 0.9);
}

body.theme-dark .nav-item.active {
    background: #2196F3;
    color: white;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
    background: rgba(60, 60, 60, 0.9);
    color: #e0e0e0;
    border: 1px solid #555;
}

body.theme-dark input:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus {
    border-color: #2196F3;
    background: rgba(80, 80, 80, 0.9);
}

/* Print styles */
@media print {
    .bottom-nav,
    .game-controls,
    .modal,
    .loading-overlay {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .welcome-card,
    .profile-card,
    .challenge-card {
        background: white;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
