:root {
    --primary: #1a4731;
    --primary-light: #2a5741;
    --secondary: #2d6a4f;
    --accent: #40916c;
    --gold: #d4a373;
    --cream: #faf6f1;
    --dark: #1b4332;
    --background: linear-gradient(135deg, #f8fffe 0%, #f1f5f3 50%, #eef3f1 100%);
    --text-color: #1f2937;
    --text-light: #f1faee;
    --danger: #e76f51;
    --warning: #fca311;
    --success: #52b788;
    --shadow: 0 8px 32px rgba(26, 71, 49, 0.08);
    --shadow-hover: 0 16px 48px rgba(26, 71, 49, 0.12);
    --card-shadow: 0 20px 60px rgba(26, 71, 49, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --fast-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 24px;
    --border-radius-sm: 16px;
    --border-radius-xs: 12px;
    --glow: 0 0 32px rgba(64, 145, 108, 0.25);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(235, 235, 235, 0.6);
    --input-border: rgba(0, 0, 0, 0.08);
}

body.dark-mode {
    --primary: #52b788;
    --primary-light: #40916c;
    --secondary: #2d6a4f;
    --accent: #b7e4c7;
    --gold: #f4d35e;
    --dark: #edf2f4;
    --background: linear-gradient(135deg, #1d2d27 0%, #15201b 50%, #101815 100%);
    --text-color: #e2e8f0;
    --text-light: #1d2d27;
    --danger: #f28482;
    --warning: #fca311;
    --success: #80ed99;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 16px 48px rgba(0, 0, 0, 0.3);
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-border: rgba(255, 255, 255, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: clamp(14px, 1.2vw, 16px);
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.7;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(64, 145, 108, 0.06) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 90%, rgba(212, 163, 115, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 40% 60%, rgba(26, 71, 49, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    width: min(95%, 1440px);
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 3vw, 2rem);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.btn {
    padding: clamp(0.8rem, 2vw, 1.2rem) clamp(1.8rem, 4vw, 3.2rem);
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    font-family: inherit;
    letter-spacing: 0.025em;
    text-transform: none;
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover::before {
    left: 100%;
}

.btn:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn:active, .btn.active {
    transform: translateY(2px) scale(0.98);
    box-shadow: 0 4px 16px rgba(26, 71, 49, 0.08);
}

.btn .spinner {
    animation: spin 1s linear infinite;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--accent) 0%, #52b788 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #c04c30 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c04c30 0%, #a53e26 100%);
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(231, 111, 81, 0.25);
}

header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.06);
    padding: clamp(1rem, 2vw, 1.5rem) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: min(95%, 1440px);
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2rem);
}

.logo {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    letter-spacing: -0.02em;
}

.logo:hover {
    transform: scale(1.02);
    color: var(--accent);
}

.logo::before {
    content: "";
    display: inline-block;
    width: clamp(1.2rem, 2.5vw, 1.6rem);
    height: clamp(1.2rem, 2.5vw, 1.6rem);
    background: linear-gradient(135deg, var(--accent) 0%, var(--secondary) 100%);
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(64, 145, 108, 0.3);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2vw, 1.5rem);
}

.user-menu {
    position: relative;
}

#user-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    width: clamp(44px, 8vw, 52px);
    height: clamp(44px, 8vw, 52px);
    padding: 0;
    border-radius: 50%;
    transition: var(--transition);
}

#user-menu-btn:hover {
    background: var(--glass-border);
    transform: translateY(-1px) scale(1.02);
    color: var(--primary);
}

#user-menu-btn svg {
    width: clamp(20px, 4vw, 24px);
    height: clamp(20px, 4vw, 24px);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--card-shadow);
    list-style: none;
    padding: 0.75rem;
    z-index: 1001;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 240px;
    border: 1px solid var(--glass-border);
}

.user-menu.open .user-dropdown {
    display: flex;
    animation: fadeInScale 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.user-dropdown .dropdown-header {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0.5rem;
    cursor: default;
    font-weight: 600;
}

.user-dropdown a,
.user-dropdown button {
    text-align: left;
    background: none;
    border: none;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-xs);
    cursor: pointer;
    transition: var(--fast-transition);
    font-size: 0.95rem;
    color: var(--text-color);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
    background-color: var(--glass-border);
    color: var(--primary);
    transform: translateX(4px);
}

.user-dropdown .lang-dropdown-inner {
    list-style: none;
    padding: 0;
    margin-top: 0.5rem;
}

.dropdown-back-btn {
    background: none;
    border: none;
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    color: var(--secondary);
    cursor: pointer;
    text-align: left;
    border-radius: var(--border-radius-xs);
    font-size: 0.9rem;
    font-family: inherit;
}

.dropdown-back-btn:hover {
    background-color: var(--glass-border);
}

.user-dropdown .lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-xs);
    cursor: pointer;
    transition: var(--fast-transition);
}

.user-dropdown .lang-option:hover {
    background-color: var(--glass-border);
    transform: translateX(4px);
}

.user-dropdown .lang-option .flag-icon {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: screenFadeIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 100%;
    flex-grow: 1;
}

.screen.active {
    display: flex;
}

@keyframes screenFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#auth-screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    width: 100%;
    padding: 1rem;
    overflow-y: auto;
}

.auth-screen-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 520px;
}

.app-description {
    background: transparent;
    padding: 0;
    text-align: left;
    width: 100%;
    border: none;
    box-shadow: none;
    margin-bottom: -1rem;
}

.description-wrapper {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.description-wrapper:has(.expanded) {
    flex-direction: column;
    align-items: flex-start;
}

.app-description-content {
    font-size: 0.9rem;
    line-height: 1.6;
    transition: max-height 0.5s ease-in-out;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.app-description-content.expanded {
    max-height: 300px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

#read-more-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    padding: 0 0 0 0.5rem;
    flex-shrink: 0;
}

.card-container {
    max-width: 520px;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: clamp(2rem, 5vw, 3.5rem);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

#progress-screen .card-container {
    max-width: 900px;
}

.card-container:hover {
    box-shadow: 0 24px 80px rgba(26, 71, 49, 0.15);
    transform: translateY(-2px);
}

body.dark-mode .card-container:hover {
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
}

.auth-tabs,
.account-tabs {
    display: flex;
    border-bottom: 2px solid var(--glass-border);
    margin-bottom: 2rem;
    position: relative;
    border-radius: var(--border-radius-xs) var(--border-radius-xs) 0 0;
    overflow: hidden;
}

.auth-tab,
.account-tab {
    flex: 1;
    padding: 1.25rem;
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.7;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    position: relative;
    z-index: 1;
    font-weight: 600;
    font-family: inherit;
}

.auth-tab.active,
.account-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    opacity: 1;
}

.auth-form,
.account-form-panel {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

.auth-form.active,
.account-form-panel.active {
    display: flex;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form h2 {
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    color: var(--dark);
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.input-group {
    text-align: left;
    position: relative;
}

.input-group label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.input-field {
    width: 100%;
    padding: 1.25rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--input-border);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    font-family: inherit;
    color: var(--text-color);
}

body.dark-mode .input-field {
    background: rgba(0, 0, 0, 0.2);
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26, 71, 49, 0.12), var(--glow);
    outline: none;
    transform: translateY(-1px);
}

.message-box {
    text-align: center;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius-sm);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeInUp 0.3s;
}

.message-box.success {
    color: #0f5132;
    background: linear-gradient(135deg, rgba(212, 237, 218, 0.9) 0%, rgba(195, 230, 203, 0.9) 100%);
    border: 2px solid rgba(195, 230, 203, 0.6);
    display: flex;
    box-shadow: 0 6px 24px rgba(82, 183, 136, 0.2);
}

.message-box.error {
    color: #58151c;
    background: linear-gradient(135deg, rgba(248, 215, 218, 0.9) 0%, rgba(245, 198, 203, 0.9) 100%);
    border: 2px solid rgba(245, 198, 203, 0.6);
    display: flex;
    box-shadow: 0 6px 24px rgba(231, 111, 81, 0.2);
}

.forgot-password-link {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.forgot-password-link a {
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    font-weight: 500;
    text-align: center;
    flex: 1;
    min-width: 150px;
}

.forgot-password-link a::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.forgot-password-link a:hover::after {
    width: 100%;
}

.forgot-password-link a:hover {
    color: var(--primary);
}

.remember-me-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
    margin-top: -0.5rem;
}

.remember-me-group label {
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
}

.remember-me-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-step {
    display: none;
    flex-direction: column;
    gap: 1.75rem;
}

.form-step.active {
    display: flex;
    animation: fadeInUp 0.4s ease-out;
}

.screen h2 {
    margin-bottom: 2.5rem;
    color: var(--primary);
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    font-weight: 800;
    letter-spacing: -0.02em;
}

body.dark-mode .screen h2 {
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.screen h2::after {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    border-radius: 2px;
}

.progress-container {
    width: 100%;
    max-width: 900px;
}

.progress-dialect-card {
    background: var(--glass-bg);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.progress-dialect-card:hover {
    box-shadow: var(--card-shadow);
    transform: translateY(-3px);
}

.dialect-summary {
    padding: clamp(1.5rem, 3vw, 2rem);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dialect-summary h4 {
    margin: 0;
    font-size: clamp(1.4rem, 2.8vw, 1.7rem);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

.dialect-details {
    padding: clamp(1.5rem, 3vw, 2rem);
    border-top: 1px solid var(--glass-border);
}

.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: clamp(1.5rem, 3vw, 2rem);
    width: 100%;
}

.lesson-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    padding: clamp(2rem, 4vw, 2.5rem);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
    border-left: 6px solid var(--accent);
    text-align: left;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
}

.lesson-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow);
    border-left-color: var(--primary);
}

.lesson-card.locked {
    opacity: 0.6;
    border-left-color: #ccc;
    cursor: pointer;
}

.lesson-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.8rem;
    opacity: 0.6;
}

.lesson-card h3 {
    font-size: 1.1rem;
}

.back-link {
    color: var(--primary);
    background: var(--glass-bg);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: var(--transition);
}

.back-link:hover {
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.back-link::before {
    content: '←';
    font-size: 1.2rem;
    transition: transform 0.2s ease-out;
}

.back-link:hover::before {
    transform: translateX(-3px);
}

#flashcard-screen {
    max-width: 900px;
    justify-content: flex-start;
}

.flashcard-ui {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 1rem 0.5rem;
}

.flashcard-widget {
    position: relative;
    width: 100%;
    margin-top: 1.5rem;
}

.card-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    padding: 0;
}

.flashcard-ui .card-scene {
    width: 100%;
    max-width: 500px;
    perspective: 1500px;
    position: relative;
    margin: 0 auto;
}

.flashcard-ui .card-container-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1);
    border-radius: var(--border-radius);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 35px -12px rgba(26, 71, 49, 0.12);
    display: flex;
    min-height: 280px;
}

body.dark-mode .flashcard-ui .card-container-inner {
    box-shadow: 0 25px 35px -12px rgba(0, 0, 0, 0.2);
}

.flashcard-ui .card-container-inner.is-flipped {
    transform: rotateY(180deg);
}

.flashcard-ui .card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    padding: clamp(1.5rem, 5vw, 2rem);
    border-radius: var(--border-radius);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: clamp(2.5rem, 5vw, 3rem);
}

.flashcard-ui .card-front,
.flashcard-ui .card-back {
    background: transparent;
}

.flashcard-ui .card-back {
    transform: rotateY(180deg);
    display: flex;
    justify-content: center;
    align-items: center;
}

.flashcard-ui .card-back .card-content-text {
    font-size: clamp(0.9rem, 4vw, 1.4rem);
    line-height: 1.6;
    text-align: center;
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
}

.lesson-title-display {
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.6;
    z-index: 2;
}

#play-audio-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 52px;
    height: 52px;
    background: var(--glass-border);
    color: var(--secondary);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.2s ease;
    z-index: 5;
}

#play-audio-btn:hover {
    transform: scale(1.1);
    background-color: var(--accent);
    color: white;
}

#play-audio-btn svg {
    width: 24px;
    height: 24px;
}

.card-content-text {
    width: 100%;
    text-align: center;
    padding: 0 0.5rem;
}

.content-word {
    font-size: clamp(2.5rem, 12vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
}

.content-sentence {
    font-size: clamp(1.2rem, 6vw, 2rem);
    font-weight: 600;
    line-height: 1.5;
}

.content-paragraph {
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.6;
    text-align: left;
    white-space: normal;
    align-self: flex-start;
    padding-top: 1rem;
}

.flashcard-ui #card-phonetic {
    font-size: clamp(1rem, 4vw, 1.2rem);
    color: var(--secondary);
    margin-top: 1rem;
    font-weight: 400;
    font-style: italic;
}

.flashcard-actions {
    flex-shrink: 0;
    width: 100%;
    padding: 0;
    margin-top: 5px;
    position: relative;
    z-index: 5;
}

.difficulty-buttons-on-card {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    width: 100%;
    max-width: 450px;
    margin: 1rem auto 0 auto;
    padding: 0 1rem;
}

.btn-difficulty {
    flex: 1;
    padding: 0.8rem 0.5rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
    min-width: 0;
    white-space: nowrap;
}

.btn-difficulty:active {
    transform: translateY(2px);
    box-shadow: none !important;
}

.btn-difficulty[data-difficulty="again"] {
    background: linear-gradient(to top, #d97706, #f59e0b);
    box-shadow: 0 4px 0 0 #b45309;
}
.btn-difficulty[data-difficulty="again"]:hover {
    background: linear-gradient(to top, #e08110, #ffb02b);
}

.btn-difficulty[data-difficulty="hard"] {
    background: linear-gradient(to top, #dc2626, #ef4444);
    box-shadow: 0 4px 0 0 #b91c1c;
}
.btn-difficulty[data-difficulty="hard"]:hover {
    background: linear-gradient(to top, #e23535, #ff5353);
}

.btn-difficulty[data-difficulty="medium"] {
    background: linear-gradient(to top, #2563eb, #3b82f6);
    box-shadow: 0 4px 0 0 #1d4ed8;
}
.btn-difficulty[data-difficulty="medium"]:hover {
    background: linear-gradient(to top, #346ff1, #4a8cf9);
}

.btn-difficulty[data-difficulty="easy"] {
    background: linear-gradient(to top, #16a34a, #22c55e);
    box-shadow: 0 4px 0 0 #15803d;
}
.btn-difficulty[data-difficulty="easy"]:hover {
    background: linear-gradient(to top, #25b259, #31d46d);
}

.flip-instruction {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    color: var(--secondary);
    opacity: 0.7;
    font-size: 0.80rem;
    font-style: italic;
}

.card-feedback-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    z-index: 10;
    color: var(--primary);
    animation: overlayFadeIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: var(--card-shadow);
    border: 2px solid var(--glass-border);
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.notification-menu {
    position: relative;
    display: none;
}

#notification-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(44px, 8vw, 52px);
    height: clamp(44px, 8vw, 52px);
    padding: 0;
    border-radius: 50%;
    transition: var(--transition);
    position: relative;
}

#notification-btn:hover {
    background: var(--glass-border);
    color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: var(--danger);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--background);
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--card-shadow);
    padding: 0.5rem;
    z-index: 1001;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 320px;
    border: 1px solid var(--glass-border);
}

.notification-menu.open .notification-dropdown {
    display: flex;
    animation: fadeInScale 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--border-radius-xs);
    text-align: left;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--fast-transition);
    border: 1px solid transparent;
}

.notification-item:hover {
    background-color: var(--glass-border);
    border-color: var(--accent);
}

.notification-icon {
    flex-shrink: 0;
    font-size: 1.5rem;
    margin-top: 2px;
}

.notification-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
}

.notification-content p {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.5;
    margin: 0;
}

.notification-progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary);
}

.notification-item .goal-progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--glass-border);
    border-radius: 4px;
    overflow: hidden;
}

.notification-item .goal-progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--accent));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.no-notifications {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-color);
    opacity: 0.6;
    font-style: italic;
    cursor: default;
}

#dialect-selection-screen .dialect-choice-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 700px;
    width: 100%;
}

#dialect-selection-screen .btn {
    width: 100%;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    font-size: clamp(1.2rem, 2.5vw, 1.4rem);
    position: relative;
    overflow: hidden;
    font-weight: 700;
}

#level-choice-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 700px;
}

.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
    padding-top: 5vh;
    padding-bottom: 5vh;
}

.modal-content {
    background: var(--glass-bg);
    padding: clamp(2rem, 4vw, 3rem);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--card-shadow);
    max-width: 560px;
    width: 100%;
    text-align: center;
    position: relative;
    border: 1px solid var(--glass-border);
    color: var(--text-color);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-color);
    opacity: 0.6;
    cursor: pointer;
    line-height: 1;
    transition: var(--fast-transition);
}

.close-modal:hover {
    opacity: 1;
    transform: scale(1.1);
}

.modal.active {
    display: flex;
    animation: modalFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

footer {
    width: 100%;
    background: linear-gradient(135deg, #1d2d27 0%, #101815 100%);
    color: var(--cream);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 5%;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--cream);
    text-decoration: none;
    font-weight: 500;
    opacity: 0.8;
    transition: var(--fast-transition);
    position: relative;
    padding-bottom: 4px;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--gold);
    transition: width 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
}

.footer-links a:hover::after {
    width: 100%;
}

.patreon-notice {
    font-size: 0.8rem;
    opacity: 0.7;
    max-width: 600px;
    line-height: 1.5;
}

.floating-home-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: clamp(56px, 10vw, 64px);
    height: clamp(56px, 10vw, 64px);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
    text-decoration: none;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

#auth-screen.active .floating-home-btn {
    display: flex;
    animation: fadeInUp 0.5s ease-out;
}

.floating-home-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-hover);
}

.floating-home-btn svg {
    width: clamp(24px, 5vw, 28px);
    height: clamp(24px, 5vw, 28px);
}

.faq-modal-content {
    max-width: 900px;
    text-align: left;
}

.faq-modal-content h2 {
    text-align: center;
}

.faq-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 1rem;
}

.faq-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.faq-item[open] {
    background: var(--glass-bg);
    box-shadow: var(--shadow);
    border-left: 5px solid var(--primary);
}

.faq-item summary {
    font-size: clamp(1rem, 2vw, 1.1rem);
    font-weight: 600;
    color: var(--text-color);
    padding: clamp(1.25rem, 2.5vw, 1.5rem);
    cursor: pointer;
    list-style: none;
    position: relative;
    transition: var(--fast-transition);
}

.faq-item summary:hover {
    background-color: var(--glass-border);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    position: absolute;
    right: clamp(1.25rem, 2.5vw, 1.5rem);
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--accent);
    transition: transform 0.3s ease;
}

.faq-item[open] summary::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-item p {
    padding: 0 clamp(1.25rem, 2.5vw, 1.5rem) clamp(1.25rem, 2.5vw, 1.5rem) clamp(1.25rem, 2.5vw, 1.5rem);
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.7;
}

.faq-item ul {
    padding: 0 clamp(1.25rem, 2.5vw, 1.5rem) clamp(1.25rem, 2.5vw, 1.5rem) clamp(3rem, 5vw, 3.5rem);
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.7;
}

html[lang="mg"] #faq-link {
    display: none;
}

details > summary {
    list-style: none;
}

details > summary::-webkit-details-marker {
    display: none;
}

details > summary::before {
    content: '▶';
    margin-right: 1rem;
    font-size: 0.8em;
    color: var(--accent);
    transition: transform 0.2s ease-in-out;
    display: inline-block;
}

details[open] > summary::before {
    transform: rotate(90deg);
}

#header-back-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--fast-transition);
    margin-right: 0.5rem;
}
#header-back-btn:hover {
    background-color: var(--glass-border);
    color: var(--accent);
}
#header-back-btn svg {
    display: block;
}

.navigation-popup-buttons, .revision-reminder-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.navigation-popup-buttons .btn, .revision-reminder-buttons .btn {
    width: 100%;
}

.navigation-popup-buttons .btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    border-color: #bbb;
    transform: none;
    box-shadow: none;
}
.navigation-popup-buttons .btn:disabled:hover {
    background: #ccc;
}

#revision-reminder-modal p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 1rem 0 1.5rem 0;
}

.password-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.password-wrapper .input-field {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 48px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    padding: 0;
}

.toggle-password:hover {
    color: var(--primary);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.toggle-password .icon-eye-off {
    display: none;
}

#account-screen .screen-navigation, #account-details-screen .screen-navigation {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 2rem auto;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}
.dashboard-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}
.dashboard-subtitle {
    font-size: 1.1rem;
    color: var(--secondary);
    margin-top: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 1200px;
}

.dashboard-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 1.5rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    background-color: var(--glass-border);
}

.card-content h3 {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
    margin: 0;
}

.card-content p {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
    margin: 0.25rem 0 0 0;
    line-height: 1.4;
}

.dashboard-card.danger-action .card-content h3 {
    color: var(--danger);
}

.password-strength-container {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    align-items: flex-start;
    text-align: left;
}

.password-strength-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--glass-border);
    border-radius: 4px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 4px;
    transition: width 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

.password-strength-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.flashcard-progress-text {
    text-align: right;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.flashcard-progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--glass-border);
    border-radius: 4px;
    margin-bottom: 1rem;
}

.flashcard-progress-bar-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.lesson-card-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.lesson-progress-container {
    flex-grow: 1;
    height: 10px;
    background-color: var(--glass-border);
    border-radius: 5px;
    overflow: hidden;
}

.lesson-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 5px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.lesson-progress-percentage {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
}

.progress-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.summary-card {
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow);
    border: 1px solid var(--glass-border);
}

.summary-card h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--secondary);
    margin: 0 0 0.5rem 0;
}

.summary-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.heatmap-title {
    text-align: left;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.heatmap-container {
    display: flex;
    justify-content: center;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-auto-rows: 1fr;
    gap: 4px;
    width: 100%;
}

.heatmap-cell {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: var(--glass-border);
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.heatmap-cell:hover {
    transform: scale(1.2);
}

.heatmap-cell[data-level="1"] { background-color: #c6e48b; }
.heatmap-cell[data-level="2"] { background-color: #7bc96f; }
.heatmap-cell[data-level="3"] { background-color: #239a3b; }
.heatmap-cell[data-level="4"] { background-color: #196127; }

.summary-action {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
}

.progress-card-list {
    padding-left: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.modal-icon-wrapper {
    width: 60px;
    height: 60px;
    background: linear-gradient(145deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -60px auto 20px auto;
    box-shadow: 0 8px 24px rgba(26, 71, 49, 0.2);
    border: 4px solid #fff;
}
body.dark-mode .modal-icon-wrapper {
    border-color: #1d2d27;
}
.modal-icon-wrapper svg {
    width: 32px;
    height: 32px;
    color: #fff;
}
#price-gate-modal .modal-title {
    font-size: clamp(1.5rem, 5vw, 1.8rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}
#price-gate-modal .modal-text {
    color: var(--text-color);
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
.price-display-wrapper {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 1.5rem;
    margin: 0 auto;
    padding: 0.5rem;
}
.original-price {
    font-size: clamp(1.8rem, 6vw, 2.2rem);
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.4;
    position: relative;
}
.original-price::after {
    content: '';
    position: absolute;
    left: -5%;
    top: 50%;
    width: 0;
    height: 3px;
    background-color: var(--danger);
    border-radius: 3px;
    transform: rotate(-5deg);
    animation: strike-through-anim 0.6s 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}
@keyframes strike-through-anim {
    from { width: 0; }
    to { width: 110%; }
}
.final-price {
    font-size: clamp(3.5rem, 12vw, 4.5rem);
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.per-month {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
}
#confirm-price-gate-btn {
    transform: scale(1.05);
    animation: pulse-animation 2s infinite;
}
@keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0 rgba(26, 71, 49, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(26, 71, 49, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 71, 49, 0); }
}
body.dark-mode @keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0 rgba(82, 183, 136, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(82, 183, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(82, 183, 136, 0); }
}
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    text-align: left;
}
.benefits-section {
    margin: 1.5rem 0;
}
.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.benefits-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-color);
    opacity: 0.9;
}
.benefits-list li::before {
    content: '✓';
    color: var(--success);
    font-weight: 800;
    font-size: 1.2rem;
    flex-shrink: 0;
}
#cancel-price-gate-btn {
    background: transparent;
    color: var(--secondary);
    box-shadow: none;
    border: 2px solid var(--glass-border);
}
#cancel-price-gate-btn:hover {
    background: var(--glass-border);
    color: var(--primary);
    transform: translateY(-2px);
}
.patreon-info-box {
    margin-top: 1.5rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1rem;
}
.patreon-info-box p {
    font-size: 0.85rem;
}
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.user-email-display {
    display: block;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0.75rem 0;
    word-break: break-all;
}
.payment-tip {
    font-size: 0.85rem;
    font-style: italic;
    opacity: 0.9;
    margin-top: 1rem;
    color: var(--text-color);
    padding: 0.5rem;
    background-color: var(--glass-border);
    border-radius: var(--border-radius-xs);
}

.price-display-wrapper {
    perspective: 300px;
}

.final-price {
    min-width: 150px; 
    display: inline-block;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.1s ease-in-out;
}

.price-animating {
    transform: rotateX(15deg) scale(1.05);
    opacity: 0.8;
}

.benefits-list li {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInBenefit 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.benefits-list li:nth-child(1) { animation-delay: 0.1s; }
.benefits-list li:nth-child(2) { animation-delay: 0.2s; }
.benefits-list li:nth-child(3) { animation-delay: 0.3s; }
.benefits-list li:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInBenefit {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

.notification-item {
    position: relative;
}

.notification-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s ease;
}

.notification-close-btn:hover {
    color: var(--text-color);
}

#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 16px 24px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--card-shadow);
    color: white;
    font-weight: 600;
    opacity: 0;
    transform: translateX(calc(100% + 20px));
    animation: slideInAndOut 5s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}
.toast.success { background: linear-gradient(135deg, var(--success), #2a9d8f); }
.toast.error { background: linear-gradient(135deg, var(--danger), #c04c30); }

@keyframes slideInAndOut {
    5%, 80% { opacity: 1; transform: translateX(0); }
    95%, 100% { opacity: 0; transform: translateX(calc(100% + 20px)); }
}

.streak-display {
    display: none;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    color: var(--warning);
    font-size: 1.2rem;
    padding: 0 10px;
}

.skeleton {
    opacity: 0.7;
    animation: shimmer 1.5s infinite linear;
    background: linear-gradient(90deg, 
        var(--glass-border) 25%, 
        rgba(255, 255, 255, 0.4) 50%, 
        var(--glass-border) 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.reminder-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
}

.reminder-buttons-container .btn {
    width: 100%;
}

@media (max-width: 768px) {
    .container {
        padding: clamp(1.5rem, 3vw, 2rem) clamp(0.75rem, 2vw, 1rem);
    }
    .lesson-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .flashcard-ui {
        padding: 1rem 0.5rem;
    }
    .account-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    .account-tab {
        flex-basis: 48%;
        min-width: 120px;
    }
    .header-content {
        padding: 0 1rem;
    }
    .header-nav {
        gap: 1rem;
    }
    .notification-dropdown {
        position: fixed;
        top: 80px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 90vw;
        max-width: 400px;
        min-width: unset;
    }
    #price-gate-modal .modal-content {
        padding: 1rem;
        overflow: hidden;
        max-width: calc(100% - 2rem);
        display: flex;
        flex-direction: column;
    }
    #price-gate-modal .modal-icon-wrapper {
        width: 40px;
        height: 40px;
        margin: -32px auto 10px auto;
        border-width: 3px;
    }
    #price-gate-modal .modal-icon-wrapper svg {
        width: 22px;
        height: 22px;
    }
    #price-gate-modal .modal-title {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }
    #price-gate-modal .price-display-wrapper {
        gap: 0.75rem;
        padding: 0;
    }
    #price-gate-modal .final-price {
        font-size: 2.6rem;
        line-height: 1.1;
    }
    #price-gate-modal .original-price {
        font-size: 1.3rem;
    }
    #price-gate-modal .per-month {
        margin-bottom: 0.75rem;
        font-size: 0.8rem;
    }
    #price-gate-modal .benefits-section {
        margin: 0.75rem 0;
    }
    #price-gate-modal .benefits-list {
        gap: 0.3rem;
    }
    #price-gate-modal .benefits-list li {
        font-size: 0.8rem;
    }
    #price-gate-modal .patreon-info-box {
        margin-top: 0.75rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    #price-gate-modal .user-email-display {
        font-size: 0.9rem;
    }
    #price-gate-modal .modal-actions {
        margin-top: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    #price-gate-modal .modal-actions .btn {
        padding: 0.7rem 1.25rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 600px) {
    footer {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 1.5rem;
    }
    .subscription-actions {
        flex-direction: column;
    }
    .btn {
        width: 100%;
        min-width: auto;
    }
    .screen h2 {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
    }
    #dialect-selection-screen .btn,
    #level-selection-screen .btn {
        font-size: clamp(1rem, 4vw, 1.2rem);
        padding: clamp(1.2rem, 3vw, 2rem);
    }
}

@media (max-width: 480px) {
    .account-tab {
        font-size: 0.9rem;
        padding: 1rem 0.75rem;
        flex-basis: 100%;
    }
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    .faq-container {
        padding-right: 0.5rem;
    }
    .forgot-password-link {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    .forgot-password-link a {
        flex: auto;
        width: 100%;
    }
}

@media (max-width: 420px) {
    .btn-difficulty {
        padding: 0.7rem 0.4rem;
        font-size: 0.8rem;
        gap: 0.3rem;
    }
    #price-gate-modal .modal-content {
        padding: 0.75rem;
        max-width: calc(100% - 1.5rem);
    }
    #price-gate-modal .modal-icon-wrapper {
        display: none;
    }
    #price-gate-modal .modal-title {
        margin-top: 0;
        font-size: 1rem;
    }
    #price-gate-modal .final-price {
        font-size: 2.2rem;
    }
    #price-gate-modal .original-price {
        font-size: 1.1rem;
    }
    #price-gate-modal .benefits-list li,
    #price-gate-modal .patreon-info-box {
        font-size: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.notification-progress-stats {
    width: 100%; 
}