/* AI Tutor for Children - Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #1ABC9C 0%, #16A085 50%, #4ECDC4 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* Animated background elements */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.shape:nth-child(1) {
    width: 100px;
    height: 100px;
    background: #FF5722;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 80px;
    height: 80px;
    background: #FFD700;
    top: 20%;
    right: 10%;
    animation-delay: 2s;
}

.shape:nth-child(3) {
    width: 120px;
    height: 120px;
    background: #1ABC9C;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

.shape:nth-child(4) {
    width: 60px;
    height: 60px;
    background: #4ECDC4;
    bottom: 10%;
    right: 20%;
    animation-delay: 1s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Desktop-optimized Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Desktop container enhancements - Unified Section Width System */
@media (min-width: 769px) {
    .main-content {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    /* Universal standardized width for ALL main sections with minimal container spacing */
    .header,
    .hero-section,
    .learning-section,
    .subject-selection,
    .progress-metrics,
    .chat-container,
    .worksheet-display,
    .games-section,
    .feedback-section,
    .progress-section {
        margin: 0px auto 0px auto;
        max-width: 1200px;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        border-radius: 25px;
        padding: 20px;
        position: relative;
    }
    
    /* Special hero section styling - first section gets minimal top margin */
    .hero-section {
        background: rgba(255, 255, 255, 0.9);
        margin-top: 10px;
    }
}

/* Header - base styles for mobile */
.header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* Desktop header overrides for zero container spacing */
@media (min-width: 769px) {
    .header {
        margin-bottom: 0px;
    }
}

.header h1 {
    color: #FF5722;
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 600;
}

.header p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
}

/* Mobile-only white background header with enhanced contrast */
@media (max-width: 768px) {
    .header {
        background: white !important;
        backdrop-filter: blur(10px) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
        border: 1px solid rgba(0, 0, 0, 0.1) !important;
        margin: 20px 15px !important;
        padding: 25px !important;
    }
    
    .header h1 {
        color: #FF5722 !important;
        text-shadow: none !important;
        font-size: 2.2em !important;
        font-weight: 700 !important;
    }
    
    .header p {
        color: #333 !important;
        text-shadow: none !important;
        font-weight: 500 !important;
        opacity: 0.8 !important;
    }
    
    /* Ensure all section headings are visible on mobile */
    .subject-selection h2,
    .subject-selection h3,
    .subject-selection p,
    .learning-section h2,
    .learning-section h3,
    .learning-section p,
    .learning-section .section-description,
    .subject-card h3,
    .subject-card p {
        color: white !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4) !important;
    }
    
    /* Button text visibility */
    .btn-primary,
    .btn-secondary,
    .subject-btn {
        background: rgba(255, 87, 34, 0.9) !important;
        color: white !important;
        border: 2px solid white !important;
        text-shadow: none !important;
    }
    
    /* Make sure all descriptive text is visible */
    .quick-tools p,
    .advanced-tools p,
    .creative-lab p,
    .innovation-suite p {
        color: white !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4) !important;
    }
    
    /* Progress text visibility */
    .progress-metrics h3,
    .progress-metrics p,
    .badges-container .achievement-badge {
        color: white !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4) !important;
    }
    
    /* Feedback section text */
    .feedback-section h2,
    .feedback-section p {
        color: white !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4) !important;
    }
    
    /* Learning Tips section - white background cards with dark text */
    .progress-section h3,
    .progress-section h4,
    .progress-section p {
        color: inherit !important;
        text-shadow: none !important;
    }
    
    /* Specific styling for Learning Tips cards */
    .progress-section div[style*="background: white"] h4,
    .progress-section div[style*="background: white"] p {
        color: #333 !important;
        text-shadow: none !important;
    }
}

.tutor-avatar {
    width: 160px;
    height: 120px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Main content areas */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.subject-selection {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.subject-selection h2 {
    color: #FF5722;
    font-size: 2em;
    margin-bottom: 30px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 500;
}

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

.subject-btn {
    background: linear-gradient(135deg, #1ABC9C, #16A085);
    color: white;
    border: none;
    padding: 25px;
    border-radius: 20px;
    font-size: 1.2em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(26, 188, 156, 0.3);
    text-transform: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-family: Arial, Helvetica, sans-serif;
}

.subject-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(26, 188, 156, 0.4);
}

.subject-btn:active {
    transform: translateY(-2px);
}

.subject-btn .emoji {
    font-size: 2.5em;
    margin-bottom: 5px;
}

/* Math button */
.subject-btn.math {
    background: linear-gradient(135deg, #FF5722, #E64A19);
}

.subject-btn.math:hover {
    box-shadow: 0 12px 30px rgba(255, 87, 34, 0.4);
}

/* Stories button */
.subject-btn.stories {
    background: linear-gradient(135deg, #1ABC9C, #16A085);
}

.subject-btn.stories:hover {
    box-shadow: 0 12px 30px rgba(26, 188, 156, 0.4);
}

/* Drawing button */
.subject-btn.drawing {
    background: linear-gradient(135deg, #FFD700, #FFA000);
}

.subject-btn.drawing:hover {
    box-shadow: 0 12px 30px rgba(255, 215, 0, 0.4);
}

/* General Q&A button */
.subject-btn.general {
    background: linear-gradient(135deg, #FF5722, #FFD700);
}

.subject-btn.general:hover {
    box-shadow: 0 12px 30px rgba(255, 87, 34, 0.4);
}

/* Chat interface */
.chat-interface {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    display: none;
}

.chat-interface.active {
    display: block;
}

.chat-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #FF5722;
}

.chat-header h2 {
    color: #FF5722;
    font-size: 2em;
    margin-bottom: 10px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 500;
}

.session-info {
    background: rgba(26, 188, 156, 0.1);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.session-info p {
    margin: 5px 0;
    color: #666;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    background: #f9f9f9;
}

.message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 15px;
    max-width: 80%;
    animation: slideIn 0.3s ease;
}

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

.message.user {
    background: linear-gradient(135deg, #FF5722, #E64A19);
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.tutor {
    background: white;
    color: #333;
    border: 2px solid #1ABC9C;
    margin-right: auto;
}

.message.system {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    text-align: center;
    margin: 0 auto;
    border: 1px solid #ffeaa7;
}

/* Input area */
.input-area {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.text-input {
    flex: 1;
    min-width: 250px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    font-size: 1.1em;
    font-family: Arial, Helvetica, sans-serif;
    outline: none;
    transition: border-color 0.3s ease;
}

.text-input:focus {
    border-color: #1ABC9C;
    box-shadow: 0 0 10px rgba(26, 188, 156, 0.2);
}

.input-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 25px;
    border: none;
    border-radius: 15px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    min-width: 120px;
    font-family: Arial, Helvetica, sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #1ABC9C, #16A085);
    color: white;
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 188, 156, 0.4);
}

.btn-voice {
    background: linear-gradient(135deg, #FF5722, #E64A19);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.3);
    position: relative;
}

.btn-voice:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 87, 34, 0.4);
}

.btn-voice.recording {
    animation: pulse 1s infinite;
    background: linear-gradient(135deg, #e17055, #d63031);
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 107, 107, 0.6);
    }
    100% {
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    }
}

.btn-story {
    background: linear-gradient(135deg, #FFD700, #FFA000);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-story:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

/* Feedback section */
.feedback-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    margin-top: 30px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feedback-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.feedback-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.feedback-btn {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    font-size: 3em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-btn:hover {
    transform: scale(1.1);
    border-color: #667eea;
}

.feedback-btn.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.1);
}

/* Progress indicator */
.progress-indicator {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

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

.progress-text {
    text-align: center;
    color: #666;
    font-weight: bold;
}

/* Loading states */
.loading {
    display: inline-block;
    position: relative;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Audio player */
.audio-player {
    background: rgba(102, 126, 234, 0.1);
    padding: 15px;
    border-radius: 15px;
    margin: 10px 0;
    text-align: center;
}

.audio-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.play-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-btn:hover {
    transform: scale(1.1);
    background: #764ba2;
}

/* Error states */
.error-message {
    background: rgba(255, 107, 107, 0.1);
    color: #d63031;
    padding: 15px;
    border-radius: 15px;
    border: 1px solid #ff6b6b;
    margin: 10px 0;
    text-align: center;
}

.success-message {
    background: rgba(78, 205, 196, 0.1);
    color: #00b894;
    padding: 15px;
    border-radius: 15px;
    border: 1px solid #4ecdc4;
    margin: 10px 0;
    text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        max-width: 100%;
    }
    
    .header h1 {
        font-size: 2.5em;
    }
    
    .subject-buttons {
        grid-template-columns: 1fr;
    }
    
    .input-area {
        flex-direction: column;
    }
    
    .text-input {
        min-width: auto;
        width: 100%;
    }
    
    .input-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .btn {
        min-width: 100px;
        flex: 1;
    }
    
    .feedback-buttons {
        gap: 15px;
    }
    
    .feedback-btn {
        width: 60px;
        height: 60px;
        font-size: 2.5em;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2em;
    }
    
    .header p {
        font-size: 1em;
    }
    
    .tutor-avatar {
        width: 80px;
        height: 80px;
        font-size: 3em;
    }
    
    .subject-btn {
        padding: 20px;
        font-size: 1em;
    }
    
    .subject-btn .emoji {
        font-size: 2em;
    }
    
    .chat-messages {
        height: 300px;
    }
    
    .message {
        max-width: 90%;
        padding: 12px;
    }
}

/* Accessibility improvements */
.btn:focus,
.text-input:focus,
.feedback-btn:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000;
        border: 2px solid #fff;
    }
    
    .message.tutor {
        border-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* IB PYP specific styles */
.subject-btn.inquiry {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.subject-btn.concept {
    background: linear-gradient(135deg, #a55eea 0%, #8854d0 100%);
}

.subject-btn.global {
    background: linear-gradient(135deg, #26de81 0%, #20bf6b 100%);
}

.subject-btn.themes {
    background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
}

/* Theme suggestion and reflection styling */
.theme-suggestion {
    animation: slideInLeft 0.5s ease forwards;
}

.reflection-questions {
    animation: slideInRight 0.5s ease forwards;
}

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

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

/* Voice interaction enhancements */
.audio-player {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 87, 34, 0.1);
    border-radius: 15px;
    border: 1px solid #FF5722;
    animation: fadeIn 0.5s ease;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.play-btn:hover {
    background: #E64A19;
    transform: scale(1.1);
}

.voice-story-btn {
    display: block;
    width: 100%;
    margin-top: 15px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #FF5722, #FFD700);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}

.voice-story-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.3);
}

.voice-story-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

/* Enhanced voice button animation */
.btn-voice.recording {
    background: linear-gradient(135deg, #f44336, #d32f2f) !important;
    animation: pulse-recording 1s infinite !important;
}

@keyframes pulse-recording {
    0% { 
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7), 0 4px 15px rgba(244, 67, 54, 0.3);
        transform: scale(1);
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(244, 67, 54, 0), 0 4px 15px rgba(244, 67, 54, 0.3);
        transform: scale(1.02);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0), 0 4px 15px rgba(244, 67, 54, 0.3);
        transform: scale(1);
    }
}

/* Enhanced Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.logo-link {
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 20px;
    padding: 10px;
}

.logo-link:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 25px rgba(26, 188, 156, 0.3);
}

.hero-logo {
    height: 150px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
    display: block;
    transition: all 0.3s ease;
}

.hero-title {
    font-size: 2.5em;
    color: #1ABC9C;
    margin-bottom: 15px;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.2em;
    color: #34495e;
    margin-bottom: 25px;
    line-height: 1.6;
}

.cta-button {
    background: linear-gradient(135deg, #FF5722, #FFD700);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 87, 34, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 87, 34, 0.4);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Enhanced Section Styling with Visual Hierarchy - base styles for all devices */
.learning-section {
    background: rgba(255, 255, 255, 0.95);
    margin: 5px 0;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-left: 5px solid;
    transition: all 0.3s ease;
    color: #333;
}

.learning-section h2,
.learning-section h3 {
    color: #333 !important;
    margin-bottom: 15px;
}

/* Desktop text and heading improvements - unified with standardized sections */
@media (min-width: 769px) {
    /* All headings in desktop sections have proper visibility and spacing */
    .main-content h2,
    .main-content h3,
    .learning-section h2,
    .learning-section h3 {
        color: #333 !important;
        font-weight: 600;
        margin-bottom: 20px !important;
    }
    
    /* Ensure consistent spacing between titles and content */
    .learning-section h2 + .subject-buttons,
    .learning-section h2 + .tool-grid,
    .learning-section h2 + .progress-display,
    .learning-section h2 + p,
    .learning-section h2 + div {
        margin-top: 20px;
    }
}

.learning-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.learning-section.core-subjects {
    border-left-color: #FF5722;
}

.learning-section.creative-tools {
    border-left-color: #FFD700;
}

.learning-section.ib-tools {
    border-left-color: #1ABC9C;
}

.learning-section.progress-section {
    border-left-color: #9C27B0;
}

/* Enhanced Subject Selection with Preview Cards */
.subject-selection {
    scroll-margin-top: 100px;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Desktop grid layout for subject cards */
@media (min-width: 769px) {
    .subject-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
        margin-top: 30px;
        padding: 0;
    }
    
    .subject-card {
        min-height: 180px;
    }
}

.subject-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.subject-card:hover {
    transform: translateY(-5px);
    border-color: #FF5722;
    box-shadow: 0 8px 25px rgba(255, 87, 34, 0.2);
}

.subject-icon {
    font-size: 3em;
    margin-bottom: 10px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subject-name {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.subject-description {
    font-size: 0.9em;
    color: #7f8c8d;
    line-height: 1.4;
}

/* Progress Visualization Enhancements */
.progress-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.progress-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
}

.progress-metric {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.progress-label {
    font-size: 0.9em;
    opacity: 0.9;
}

.streak-counter {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
}

.streak-days {
    font-size: 2.5em;
    font-weight: bold;
    color: white;
}

.streak-text {
    color: white;
    margin-top: 5px;
}

/* Achievement Badges */
.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    justify-content: center;
}

.achievement-badge {
    background: linear-gradient(135deg, #FFD700, #FFA000);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    animation: sparkle 2s infinite;
}

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

/* Session Duration Options */
.session-options {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.session-btn {
    padding: 10px 20px;
    border: 2px solid #FF5722;
    background: white;
    color: #FF5722;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.session-btn:hover, .session-btn.active {
    background: #FF5722;
    color: white;
    transform: scale(1.05);
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    /* Hide desktop-only sections on mobile */
    .hero-section {
        display: none !important;
    }
    
    .background-shapes {
        display: none !important;
    }
    
    .session-options {
        display: none !important;
    }
    
    /* Mobile-specific container adjustments */
    .container {
        padding: 20px 15px;
        max-width: 100%;
    }
    
    .hero-title {
        font-size: 2em;
    }
    
    .hero-logo {
        height: 120px;
    }
    
    .subject-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .progress-display {
        grid-template-columns: 1fr;
    }
    
    /* Compact mobile learning sections */
    .learning-section {
        margin-bottom: 25px;
        padding: 15px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 15px;
    }
    
    .learning-section h2 {
        font-size: 18px;
        margin-bottom: 15px;
        text-align: center;
        color: white !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4) !important;
    }
    
    /* Enhanced mobile text visibility */
    .main-content h2,
    .main-content h3,
    .main-content p,
    .main-content .section-description {
        color: white !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4) !important;
    }
    
    /* Learning section content visibility */
    .learning-section .tool-grid .tool-card h4,
    .learning-section .tool-grid .tool-card p {
        color: white !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4) !important;
    }
}

/* Learning Path Indicators */
.learning-path {
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.path-step {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 15px;
    margin: 5px;
    font-size: 0.9em;
}

.path-step.completed {
    background: rgba(76, 175, 80, 0.8);
}

.path-step.current {
    background: rgba(255, 193, 7, 0.8);
    font-weight: bold;
}

/* Desktop-only elements */
@media (min-width: 769px) {
    .mobile-header {
        display: none;
    }
}

/* Mobile header styles with white background */
.mobile-header {
    display: none;
    text-align: center;
    margin: 20px 15px 20px 15px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    color: #333;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 12px;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

.mobile-title {
    font-size: 20px;
    margin: 0;
    font-weight: 700;
    color: #FF5722;
    text-shadow: none;
}

@media (max-width: 768px) {
    .mobile-header {
        display: block;
    }
}

/* Print styles */
@media print {
    .background-shapes,
    .input-area,
    .feedback-section,
    .audio-player {
        display: none;
    }
    
    .chat-messages {
        height: auto;
        border: 1px solid #ccc;
    }
}
