/* ==========================================================================
   Resort English – English for Photographers
   Design System & Styling Rules
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(99, 102, 241, 0.3);

    --primary: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --secondary: #06b6d4; /* Cyan */
    --accent: #10b981; /* Emerald */
    --coral: #f43f5e; /* Coral/Rose */
    --gold: #f59e0b; /* Gold/Amber */
    --purple: #8b5cf6;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Statuses */
    --success: #10b981;
    --error: #ef4444;

    /* Spacing & Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Shadows & Effects */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
    --backdrop: blur(16px);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables Fallback Support if toggled */
[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: #ffffff;
    --bg-glass: rgba(0, 0, 0, 0.03);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #94a3b8;
}

/* Reset & Base Setup */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Tajawal', 'Outfit', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* App Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: var(--backdrop);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a5b4fc, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.5px;
}

/* Search Box */
.search-box {
    position: relative;
    flex: 1;
    max-width: 480px;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    padding: 0.65rem 2.5rem 0.65rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.95);
}

.search-icon {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.clear-btn {
    position: absolute;
    left: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.clear-btn:hover { color: var(--coral); }

/* Stats & Quick Actions */
.header-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.9rem;
}

.streak-pill { color: #f97316; border-color: rgba(249, 115, 22, 0.3); }
.xp-pill { color: #eab308; border-color: rgba(234, 179, 8, 0.3); }
.stat-unit { font-size: 0.75rem; font-weight: 500; opacity: 0.8; }

.icon-btn {
    position: relative;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background: var(--coral);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 99px;
}

/* App Body Layout */
.app-body {
    display: flex;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding-bottom: 70px; /* Space for mobile nav */
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.4);
    border-left: 1px solid var(--border-color);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-shrink: 0;
}

.user-mini-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-mini-card .avatar {
    font-size: 2rem;
    background: rgba(99, 102, 241, 0.15);
    padding: 0.5rem;
    border-radius: 50%;
}

.user-info { flex: 1; }
.user-info h4 { font-size: 0.95rem; font-weight: 700; }

.mini-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 0.4rem;
}

.mini-progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.4s ease;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.nav-item:hover, .nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), transparent);
    color: #fff;
    border-right: 3px solid var(--primary);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1.5rem 2rem;
    min-width: 0;
}

/* Views Management */
.view-section {
    animation: fadeIn 0.3s ease;
}

.hidden { display: none !important; }

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

/* Buttons System */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.secondary-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.accent-btn {
    background: linear-gradient(135deg, var(--accent), #059669);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    transition: var(--transition);
}

.accent-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.gold-btn {
    background: linear-gradient(135deg, var(--gold), #d97706);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-lg { padding: 0.9rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; }
.full-width { width: 100%; }

/* Hero Section */
.hero-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9)), url('https://images.unsplash.com/photo-1540555700478-4be289fbecef?q=80&w=1200&auto=format&fit=crop') center/cover;
    background-blend-mode: overlay;
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-glow);
}

.hero-content {
    max-width: 650px;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    padding: 0.35rem 0.9rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-graphic {
    position: relative;
    width: 260px;
    height: 220px;
    display: none; /* Visible on desktop */
}

@media (min-width: 1024px) {
    .hero-graphic { display: block; }
}

.graphic-circle {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    position: absolute;
    top: 20px;
    left: 40px;
    animation: pulse 4s infinite alternate;
}

.floating-badge {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
    backdrop-filter: var(--backdrop);
    animation: float 3s infinite ease-in-out alternate;
}

.badge-1 { top: 10px; right: 10px; color: var(--secondary); animation-delay: 0s; }
.badge-2 { top: 90px; left: 0px; color: var(--accent); animation-delay: 1s; }
.badge-3 { bottom: 10px; right: 30px; color: var(--gold); animation-delay: 2s; }

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

@keyframes pulse {
    from { transform: scale(0.9); opacity: 0.5; }
    to { transform: scale(1.1); opacity: 0.9; }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    backdrop-filter: var(--backdrop);
}

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

.title-with-icon {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.title-with-icon i {
    font-size: 1.4rem;
    color: var(--primary);
}

.title-with-icon h3 { font-size: 1.1rem; font-weight: 700; }
.sub-text { font-size: 0.8rem; color: var(--text-muted); }

.level-tag {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 700;
}

.progress-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.xp-val { color: var(--gold); }

.main-progress-bar {
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.main-progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    background: var(--bg-glass);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    text-align: center;
}

.m-val { font-size: 1.1rem; font-weight: 800; display: block; color: #fff; }
.m-lbl { font-size: 0.7rem; color: var(--text-muted); }

/* Daily Dash */
.daily-dash {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(249, 115, 22, 0.1));
    border-color: rgba(249, 115, 22, 0.25);
}

.daily-badge {
    align-self: flex-start;
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
    padding: 0.2rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
}

.daily-status {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 0.95rem;
}

/* Categories Carousel */
.section-title-wrap {
    margin-bottom: 1.25rem;
}

.section-title-wrap h2 {
    font-size: 1.35rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-title-wrap .sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.margin-top { margin-top: 2.5rem; }

.categories-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
}

.cat-chip {
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
}

.cat-chip:hover, .cat-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Levels Grid */
.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.level-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--card-color, var(--primary));
}

.level-card:hover {
    transform: translateY(-4px);
    border-color: var(--card-color, var(--primary));
    box-shadow: var(--shadow-md);
}

.level-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.level-num-badge {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    color: var(--card-color, var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    border: 1px solid var(--border-color);
}

.level-title-wrap h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.level-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Phrase Cards System */
.phrases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.25rem;
}

.phrase-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: var(--transition);
    position: relative;
}

.phrase-card:hover {
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
}

.phrase-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.phrase-cat-tag {
    font-size: 0.75rem;
    background: var(--bg-glass);
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    color: var(--text-muted);
    font-weight: 600;
}

.fav-toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.fav-toggle-btn:hover, .fav-toggle-btn.is-fav {
    color: var(--gold);
}

.english-text {
    direction: ltr;
    text-align: left;
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.4;
}

.arabic-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: #cbd5e1;
}

.pronunciation-text {
    font-size: 0.85rem;
    color: var(--secondary);
    background: rgba(6, 182, 212, 0.08);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    width: fit-content;
}

.phrase-situation {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-style: italic;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.5rem;
}

.phrase-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.listen-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid var(--border-accent);
    color: #fff;
    padding: 0.45rem 1rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.listen-btn:hover {
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.listen-btn.playing {
    animation: pulse 1s infinite alternate;
    background: var(--coral);
}

/* Quick Work Mode */
.quick-work-hero {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(99, 102, 241, 0.15));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.qw-icon {
    font-size: 2.5rem;
    color: var(--gold);
}

.qw-text { flex: 1; min-width: 280px; }
.qw-text h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.25rem; }
.qw-text p { font-size: 0.95rem; color: var(--text-muted); }

/* Real Customer Situations Layout */
.situations-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .situations-layout { grid-template-columns: 1fr; }
}

.situations-menu {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sit-menu-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sit-menu-item:hover, .sit-menu-item.active {
    border-color: var(--secondary);
    background: rgba(6, 182, 212, 0.15);
}

.sit-icon { font-size: 1.4rem; }
.sit-title { font-weight: 700; font-size: 0.95rem; }

.situation-card-display {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.dialogue-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.dialogue-line {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-md);
    max-width: 85%;
}

.line-photographer {
    align-self: flex-start;
    background: rgba(99, 102, 241, 0.15);
    border-right: 4px solid var(--primary);
}

.line-tourist {
    align-self: flex-end;
    background: rgba(6, 182, 212, 0.15);
    border-left: 4px solid var(--secondary);
}

.speaker-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.line-photographer .speaker-label { color: #a5b4fc; }
.line-tourist .speaker-label { color: #67e8f9; }

/* Practice Hub Components */
.practice-modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.practice-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.practice-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-accent);
}

.p-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
}

.quiz-bg { background: linear-gradient(135deg, var(--primary), var(--purple)); }
.flash-bg { background: linear-gradient(135deg, var(--secondary), #0284c7); }
.listen-bg { background: linear-gradient(135deg, var(--accent), #047857); }
.speak-bg { background: linear-gradient(135deg, var(--gold), #c2410c); }

.practice-workspace {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-md);
}

/* Flashcards 3D Flip */
.flashcard-wrapper {
    perspective: 1000px;
    max-width: 500px;
    height: 280px;
    margin: 0 auto 1.5rem auto;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flashcard-wrapper.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-accent);
    background: rgba(30, 41, 59, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
    box-shadow: var(--shadow-md);
}

.flashcard-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(99, 102, 241, 0.2));
}

.card-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Quiz UI Components */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.quiz-option-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 1.05rem;
    text-align: right;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.quiz-option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.quiz-option-btn.correct {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: var(--success) !important;
    color: #fff;
}

.quiz-option-btn.wrong {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: var(--error) !important;
    color: #fff;
}

/* Pricing Page Packages */
.pricing-calculator-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
}

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

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.package-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    transition: var(--transition);
}

.package-card.popular {
    border-color: var(--gold);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(245, 158, 11, 0.15));
}

.popular-badge {
    position: absolute;
    top: -12px;
    right: 50%;
    transform: translateX(50%);
    background: var(--gold);
    color: #000;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 99px;
}

.pkg-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.5rem; }
.pkg-price { font-size: 2rem; font-weight: 800; color: var(--secondary); }
.pkg-unit { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }

.pricing-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
}

/* Profile & Badges */
.profile-card-hero {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.profile-avatar {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.profile-info { flex: 1; }
.profile-info h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.4rem; }

.profile-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tag-pill {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 0.2rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 700;
}

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

.p-stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
}

.stat-ico { font-size: 1.8rem; color: var(--primary); margin-bottom: 0.5rem; }
.p-stat-val { font-size: 1.8rem; font-weight: 800; }
.p-stat-lbl { font-size: 0.85rem; color: var(--text-muted); }

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

.badge-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.5;
    filter: grayscale(1);
    transition: var(--transition);
}

.badge-card.unlocked {
    opacity: 1;
    filter: grayscale(0);
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--bg-card), rgba(245, 158, 11, 0.1));
}

.badge-icon {
    font-size: 2.2rem;
}

.badge-info h4 { font-size: 1rem; font-weight: 800; }
.badge-info p { font-size: 0.8rem; color: var(--text-muted); }

/* Bottom Mobile Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.mobile-bottom-nav .nav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    width: 20%;
    height: 100%;
    transition: var(--transition);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.mobile-bottom-nav .nav-btn i { 
    font-size: 1.25rem; 
    transition: transform 0.2s ease;
}

.mobile-bottom-nav .nav-btn:active {
    transform: scale(0.92);
}

.mobile-bottom-nav .nav-btn.active { 
    color: var(--primary); 
}

.mobile-bottom-nav .nav-btn.active i {
    transform: translateY(-2px);
    color: #a5b4fc;
}

.mobile-bottom-nav .nav-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 0 10px var(--primary);
}

/* Comprehensive Responsive Rules for Mobile Devices */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .mobile-bottom-nav { display: flex; }
    
    .app-header {
        padding: 0.6rem 0.85rem;
    }
    
    .header-container {
        flex-wrap: wrap;
        gap: 0.6rem;
    }
    
    .brand-name {
        font-size: 1.15rem;
    }
    
    .brand-tagline {
        display: none; /* Hide tagline on phone screens to save space */
    }
    
    .search-box {
        order: 3;
        flex: 1 0 100%;
        max-width: 100%;
        margin-top: 0.2rem;
    }
    
    .search-box input {
        padding: 0.55rem 2.2rem 0.55rem 0.85rem;
        font-size: 0.85rem;
    }
    
    .header-stats {
        gap: 0.4rem;
    }

    .stat-pill {
        padding: 0.3rem 0.65rem;
        font-size: 0.8rem;
    }

    .main-content { 
        padding: 1rem 0.85rem 5rem 0.85rem; 
    }

    /* Hero Section Mobile Styling */
    .hero-card { 
        padding: 1.75rem 1.25rem; 
        border-radius: var(--radius-lg);
        margin-bottom: 1.25rem;
    }
    
    .hero-title { 
        font-size: 1.6rem;
        margin-bottom: 0.75rem; 
    }

    .hero-desc {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
        line-height: 1.5;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.6rem;
    }

    .hero-actions button {
        width: 100%;
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    /* Dashboard Cards Mobile Layout */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1.75rem;
    }

    .dash-card {
        padding: 1.15rem;
        border-radius: var(--radius-md);
    }

    /* Level Cards Mobile Layout */
    .levels-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .level-card {
        padding: 1.15rem;
    }

    /* Phrases Grid Mobile Styling */
    .phrases-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .phrase-card {
        padding: 1.15rem;
        border-radius: var(--radius-md);
    }

    .english-text {
        font-size: 1.05rem;
    }

    .arabic-text {
        font-size: 0.95rem;
    }

    .listen-btn {
        width: 100%;
        justify-content: center;
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
        border-radius: var(--radius-md);
        min-height: 44px; /* Touch target optimized */
    }

    /* Categories Carousel Mobile */
    .cat-chip {
        padding: 0.5rem 1rem;
        font-size: 0.82rem;
    }

    /* Quick Work Hero Mobile */
    .quick-work-hero {
        padding: 1.25rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .qw-text h2 {
        font-size: 1.25rem;
    }

    .qw-text p {
        font-size: 0.85rem;
    }

    /* Situations Roleplay Mobile */
    .situation-card-display {
        padding: 1.25rem;
        border-radius: var(--radius-md);
    }

    .dialogue-line {
        max-width: 92%;
        padding: 0.75rem 0.9rem;
    }

    /* Practice & Workspace Mobile */
    .practice-workspace {
        padding: 1.25rem 1rem;
        border-radius: var(--radius-lg);
    }

    .flashcard-wrapper {
        height: 240px;
    }

    .flashcard-front, .flashcard-back {
        padding: 1.25rem 1rem;
    }

    .quiz-option-btn {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
        min-height: 48px;
    }

    /* Packages Mobile */
    .packages-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.85rem;
    }
}

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

    .dash-mini-stats {
        grid-template-columns: repeat(3, 1fr);
        padding: 0.5rem;
    }

    .m-val {
        font-size: 0.95rem;
    }

    .m-lbl {
        font-size: 0.65rem;
    }
}

/* Toast Notifications System */
.toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid var(--border-accent);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    pointer-events: auto;
}

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

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    animation: scaleUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { font-size: 1.1rem; font-weight: 800; }
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.form-control {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}
