/* ===== CSS Variables ===== */
:root {
    --primary: #FF6B35;
    --secondary: #6B9FFF;
    --accent: #FFB86C;
    --background: #0a0a0a;
    --surface: #1a1a1a;
    --text-primary: #FFFFFF;
    --text-secondary: #AAAAAA;
    --border: #333333;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* ===== Global Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    overflow: hidden;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

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

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

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

/* ===== HOME PAGE STYLES ===== */

/* Main Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    background: var(--background);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
}

/* Header */
.header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 107, 53, 0.15);
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.95) 0%, rgba(20, 20, 20, 0.8) 100%);
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.header-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-title {
    font-size: 24px;
    font-weight: 700;
    color: #FF6B35;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.header-tagline {
    font-size: 12px;
    color: #CCCCCC;
    font-weight: 500;
}

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

.icon-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 107, 53, 0.15);
    border: 1px solid rgba(255, 107, 53, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    color: #FF6B35;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.15);
}

.icon-button:hover {
    background: rgba(255, 107, 53, 0.25);
    border-color: rgba(255, 107, 53, 0.5);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

.icon-button:active {
    transform: scale(0.95);
}

/* Main Content */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 100px;
    scroll-behavior: smooth;
}

.content::-webkit-scrollbar {
    width: 6px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background: #D0D0D0;
    border-radius: 3px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: #999999;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.card {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1) 0%, rgba(107, 159, 255, 0.08) 100%);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(107, 159, 255, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    border-color: rgba(255, 107, 53, 0.5);
    box-shadow: 0 8px 24px rgba(255, 107, 53, 0.25);
    transform: translateY(-4px);
}

.card:hover::before {
    opacity: 1;
}

.card-icon {
    font-size: 56px;
    min-width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

.card-content {
    flex: 1;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 4px;
}

.card-description {
    font-size: 13px;
    color: #AAAAAA;
    line-height: 1.4;
}

.card-arrow {
    font-size: 20px;
    color: #FF6B35;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.card:hover .card-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 80px;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.8) 0%, rgba(10, 10, 10, 0.95) 100%);
    border-top: 1px solid rgba(255, 107, 53, 0.15);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: 8px;
    flex-shrink: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #777777;
    text-decoration: none;
    flex: 1;
    height: 100%;
    justify-content: center;
}

.nav-item:hover {
    color: #FF6B35;
}

.nav-item.active {
    color: #FF6B35;
}

.nav-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.nav-item:hover .nav-icon {
    transform: scale(1.1);
}

.nav-item.active .nav-icon {
    animation: bounceIn 0.4s ease;
    text-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.nav-label {
    font-size: 11px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-item.active .nav-label {
    color: #FF6B35;
}

/* ===== LEARNING PAGE STYLES ===== */

/* Lessons Container */
.lessons-container {
    width: 100vw;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar */
.lessons-container::-webkit-scrollbar {
    display: none;
}

.lessons-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Lesson Card */
.lesson {
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 30px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    position: relative;
    overflow: hidden;
}

/* Lesson Background Accents */
.lesson::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.lesson::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(100, 150, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.lesson-content {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    animation: fadeIn 0.6s ease;
}

/* Large Tamil Letter */
.tamil-letter {
    font-size: 140px;
    font-weight: 700;
    color: #FF6B35;
    margin-bottom: 20px;
    line-height: 1;
    letter-spacing: -4px;
    animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}

/* Pronunciation */
.pronunciation {
    font-size: 32px;
    font-weight: 600;
    color: #6B9FFF;
    margin-bottom: 8px;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(107, 159, 255, 0.3);
}

/* Meaning */
.meaning {
    font-size: 14px;
    color: #CCCCCC;
    margin-bottom: 40px;
    line-height: 1.6;
    max-width: 280px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 50px;
}

.action-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid #FF6B35;
    background: rgba(255, 107, 53, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.action-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 107, 53, 0.25);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.3);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn.sound {
    background: linear-gradient(135deg, #FF6B35 0%, #FF8A50 100%);
    border-color: #FF6B35;
    color: white;
    font-size: 26px;
    width: 64px;
    height: 64px;
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.action-btn.sound:hover {
    background: linear-gradient(135deg, #FF8A50 0%, #FFA070 100%);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.5);
}

/* Examples Section */
.examples-section {
    margin-top: 30px;
    width: 100%;
}

.examples-title {
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.examples-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.example-item {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.12) 0%, rgba(107, 159, 255, 0.08) 100%);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    animation: slideUp 0.5s ease forwards;
    backdrop-filter: blur(10px);
}

.example-item:nth-child(1) { animation-delay: 0.1s; opacity: 0; }
.example-item:nth-child(2) { animation-delay: 0.2s; opacity: 0; }
.example-item:nth-child(3) { animation-delay: 0.3s; opacity: 0; }

.example-item:hover {
    transform: translateY(-4px);
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.18) 0%, rgba(107, 159, 255, 0.12) 100%);
    border-color: rgba(255, 107, 53, 0.4);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.25);
}

.example-tamil {
    font-size: 20px;
    font-weight: 600;
    color: #FF6B35;
    margin-bottom: 4px;
    font-family: 'Noto Sans Tamil', 'Arial', sans-serif;
}

.example-english {
    font-size: 13px;
    color: #AAAAAA;
}

/* Swipe Indicator */
.swipe-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #888;
    animation: bounce 2s infinite;
    z-index: 100;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Back Button */
.back-btn {
    position: fixed;
    top: 30px;
    left: 30px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 107, 53, 0.2);
    border: 1.5px solid rgba(255, 107, 53, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
    color: #FF6B35;
}

.back-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 107, 53, 0.3);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.3);
}

.back-btn:active {
    transform: scale(0.95);
}

/* Lesson Counter */
.lesson-counter {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(255, 107, 53, 0.15);
    border: 1px solid rgba(255, 107, 53, 0.3);
    color: #FF6B35;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.15);
}

/* ===== RESPONSIVE ===== */
@media (max-height: 667px) {
    .content {
        padding-bottom: 120px;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 22px;
    }

    .header-tagline {
        font-size: 11px;
    }

    .tamil-letter {
        font-size: 100px;
    }

    .pronunciation {
        font-size: 24px;
    }

    .action-btn {
        width: 48px;
        height: 48px;
    }

    .action-btn.sound {
        width: 56px;
        height: 56px;
    }

    .example-tamil {
        font-size: 18px;
    }

    .card-icon {
        font-size: 45px;
    }

    .card-title {
        font-size: 15px;
    }

    .card-description {
        font-size: 12px;
    }
}

@media (max-width: 400px) {
    .tamil-letter {
        font-size: 90px;
    }

    .pronunciation {
        font-size: 22px;
    }

    .action-buttons {
        gap: 15px;
    }

    .card {
        padding: 16px;
        gap: 12px;
    }

    .card-icon {
        font-size: 40px;
        min-width: 40px;
        height: 40px;
    }
}
