:root {
    --bg-base: #030712;
    --bg-grad-1: rgba(16, 185, 129, 0.12);
    --bg-grad-2: rgba(6, 182, 212, 0.12);
    --card-bg: rgba(17, 24, 39, 0.55);
    --card-border: rgba(255, 255, 255, 0.06);
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-glow: rgba(16, 185, 129, 0.25);
    --secondary: #06b6d4;
    --secondary-hover: #0891b2;
    --secondary-glow: rgba(6, 182, 212, 0.2);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.2);
    --warning: #fbbf24;
    --warning-glow: rgba(251, 191, 36, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-ar: 'Tajawal', sans-serif;
    --font-en: 'Inter', sans-serif;
}

[data-theme="forest"] {
    --bg-base: #022c22;
    --bg-grad-1: rgba(16, 185, 129, 0.18);
    --bg-grad-2: rgba(52, 211, 153, 0.15);
    --card-bg: rgba(6, 78, 59, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #34d399;
    --primary-hover: #059669;
    --primary-glow: rgba(52, 211, 153, 0.3);
    --secondary: #a7f3d0;
    --secondary-hover: #6ee7b7;
    --secondary-glow: rgba(167, 243, 208, 0.25);
}

[data-theme="ocean"] {
    --bg-base: #0b132b;
    --bg-grad-1: rgba(58, 134, 200, 0.15);
    --bg-grad-2: rgba(0, 245, 212, 0.15);
    --card-bg: rgba(28, 37, 65, 0.55);
    --card-border: rgba(255, 255, 255, 0.06);
    --primary: #3a86c8;
    --primary-hover: #1c72b8;
    --primary-glow: rgba(58, 134, 200, 0.3);
    --secondary: #00f5d4;
    --secondary-hover: #00bbf9;
    --secondary-glow: rgba(0, 245, 212, 0.2);
}

[data-theme="cosmic"] {
    --bg-base: #0f091c;
    --bg-grad-1: rgba(139, 92, 246, 0.15);
    --bg-grad-2: rgba(236, 72, 153, 0.15);
    --card-bg: rgba(32, 18, 58, 0.55);
    --card-border: rgba(255, 255, 255, 0.06);
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-glow: rgba(139, 92, 246, 0.3);
    --secondary: #ec4899;
    --secondary-hover: #db2777;
    --secondary-glow: rgba(236, 72, 153, 0.2);
}

[data-theme="rose"] {
    --bg-base: #1c0d12;
    --bg-grad-1: rgba(244, 63, 94, 0.15);
    --bg-grad-2: rgba(253, 164, 175, 0.15);
    --card-bg: rgba(54, 24, 33, 0.55);
    --card-border: rgba(255, 255, 255, 0.06);
    --primary: #f43f5e;
    --primary-hover: #e11d48;
    --primary-glow: rgba(244, 63, 94, 0.3);
    --secondary: #fda4af;
    --secondary-hover: #fb7185;
    --secondary-glow: rgba(253, 164, 175, 0.2);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(circle at 15% 20%, var(--bg-grad-1), transparent 50%), 
        radial-gradient(circle at 85% 80%, var(--bg-grad-2), transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.5), transparent 100%),
        linear-gradient(rgba(255, 255, 255, 0.004) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.004) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 100% 100%, 35px 35px, 35px 35px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px 16px 95px 16px; /* Space for bottom nav on mobile */
    font-family: var(--font-ar);
    overflow-x: hidden;
}

html[lang="en"] body, html[lang="de"] body {
    font-family: var(--font-en);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Header & Top Bar */
.top-bar {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    position: relative;
    z-index: 100;
}

.top-bar-main-row {
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.top-bar-start {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.top-corner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.top-bar-center {
    width: 100%;
    display: flex;
    justify-content: center;
}

.top-bar-end {
    display: flex;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
}

.logo-area i, .home-leaf-icon {
    animation: leafFloating 5s ease-in-out infinite alternate;
    display: inline-block;
    will-change: transform;
}

@keyframes leafFloating {
    0% { transform: rotate(0deg) translateY(0); }
    50% { transform: rotate(5deg) translateY(-2px); }
    100% { transform: rotate(0deg) translateY(0); }
}

.logo-area span {
    color: var(--text-main);
}

.logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

/* Dashboard Corner Language Selector */
.dashboard-lang-selector-corner {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

html[dir="rtl"] .dashboard-lang-selector-corner {
    right: auto;
    left: 14px;
}

.dashboard-lang-selector-corner .lang-picker-btn {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.dashboard-lang-selector-corner .lang-picker-btn.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Main Container & Page Navigation */
.app-container {
    width: 100%;
    max-width: 600px;
    position: relative;
}

.page {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.page.active {
    display: block;
}

/* Prevent Google AdSense 'No slot size for availableWidth=0' crash on hidden pages */
.page:not(.active) {
    display: block !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    width: 100% !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

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

/* Glassmorphic Card Style */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 26px;
    border-radius: 28px;
    border: 1px solid var(--card-border);
    border-top: 1px solid rgba(255, 255, 255, 0.12); /* Light reflection highlight on top border */
    margin-bottom: 22px;
    box-shadow: 0 25px 50px -20px rgba(0, 0, 0, 0.7);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.08);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
    pointer-events: none;
}

/* Headings */
.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

/* Floating Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 500px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    display: flex;
    justify-content: space-around;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: var(--transition);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 4px;
    border-radius: 18px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    gap: 3px;
}

.nav-item i {
    font-size: 1.25rem;
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--text-main);
}

.nav-item.active {
    color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
}

.nav-item.active i {
    transform: scale(1.1);
}

/* Dashboard Specific Styles */
.hero-counter {
    padding: 50px 20px 30px 20px;
    text-align: center;
}

.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.big-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    direction: ltr;
    margin: 25px 0;
}

.time-part {
    background: rgba(10, 15, 30, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 18px 10px;
    min-width: 72px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), inset 0 2px 5px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
}

.time-part:hover {
    transform: translateY(-4px) scale(1.05);
    border-color: rgba(16, 185, 129, 0.35);
}

.time-num {
    font-family: var(--font-en);
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 60%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.1);
}

.time-lbl {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timer-divider {
    font-size: 1.85rem;
    color: var(--primary);
    font-weight: bold;
    animation: blink 1s infinite;
    text-shadow: 0 0 10px var(--primary-glow);
}

@keyframes blink {
    50% { opacity: 0.3; }
}

/* Progress bar style */
.level-progress-wrapper {
    margin-bottom: 24px;
    text-align: right;
}
html[dir="ltr"] .level-progress-wrapper {
    text-align: left;
}

.level-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 700;
}

.level-info span.highlight {
    color: var(--primary);
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    border: 1px solid var(--card-border);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-hover), var(--primary));
    width: 0%;
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Buttons */
.btn-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.btn {
    padding: 15px 22px;
    border-radius: 18px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    box-shadow: 0 8px 20px var(--primary-glow);
}
.btn-primary:hover {
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.45);
    transform: translateY(-3px);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-hover));
    box-shadow: 0 8px 20px var(--secondary-glow);
}
.btn-secondary:hover {
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.45);
    transform: translateY(-3px);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.02);
    border: 1.5px solid var(--card-border);
    color: var(--text-muted);
    box-shadow: none;
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--text-main);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    box-shadow: 0 8px 20px var(--danger-glow);
}
.btn-danger:hover {
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.45);
    transform: translateY(-3px);
}

/* Custom Grid for Badges */
.badges-container {
    margin-top: 10px;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.badge-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 14px 10px;
    text-align: center;
    opacity: 0.35;
    filter: grayscale(100%);
    transition: var(--transition);
}

.badge-card.unlocked {
    opacity: 1;
    filter: grayscale(0%);
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
}

.badge-icon {
    font-size: 2rem;
    margin-bottom: 6px;
}

.badge-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.badge-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Auth & Profile Styles */
.auth-box {
    text-align: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    text-align: right;
}
html[dir="ltr"] .input-group {
    text-align: left;
}

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

.input-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    padding: 14px;
    border-radius: 14px;
    color: white;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.divider {
    margin: 20px 0;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--card-border);
}

.divider::before { margin-left: 12px; }
.divider::after { margin-right: 12px; }

.social-btns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.btn-social {
    background: white;
    color: #1f2937;
    border: none;
    border-radius: 14px;
    padding: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-social:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.btn-social.facebook {
    background: #1877F2;
    color: white;
}
.btn-social.facebook:hover {
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.btn-social img {
    width: 18px;
    height: 18px;
}

/* Profile area inside active Auth state */
.user-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
}

.user-avatar-wrapper {
    position: relative;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
    box-shadow: 0 0 10px var(--primary-glow);
}

.user-meta {
    flex: 1;
    text-align: right;
}
html[dir="ltr"] .user-meta {
    text-align: left;
}

.user-display-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
}

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

/* Journaling Section */
.mood-selector {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.mood-btn {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    font-size: 1.75rem;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.mood-btn:hover {
    transform: scale(1.15) translateY(-3px);
    border-color: rgba(255, 255, 255, 0.15);
}

.mood-btn.active {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--secondary);
    box-shadow: 0 0 12px var(--secondary-glow);
    transform: scale(1.15);
}

textarea.journal-input {
    width: 100%;
    min-height: 120px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    padding: 14px;
    border-radius: 16px;
    color: white;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    margin-bottom: 16px;
    transition: var(--transition);
}

textarea.journal-input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 10px var(--secondary-glow);
}

.journal-history {
    margin-top: 24px;
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
}

.journal-entry {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    padding: 14px;
    border-radius: 16px;
    text-align: right;
}
html[dir="ltr"] .journal-entry {
    text-align: left;
}

.journal-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.journal-entry-mood {
    font-size: 1.1rem;
}

.journal-entry-date {
    font-weight: 700;
}

.journal-entry-body {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-main);
}

/* Box Breathing Section */
.breathing-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 10px;
}

.breathing-circle-outer {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.05);
    border: 2px dashed rgba(6, 182, 212, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 30px;
    transition: all 4s linear;
}

.breathing-circle-inner {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-hover));
    box-shadow: 0 0 30px var(--secondary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 4s ease-in-out;
}

.breathing-circle-inner span {
    font-size: 1.5rem;
}

/* Dynamic classes driven by javascript for breathing states */
.breathing-state-inhale .breathing-circle-outer {
    border-color: rgba(6, 182, 212, 0.6);
}
.breathing-state-inhale .breathing-circle-inner {
    width: 180px;
    height: 180px;
}

.breathing-state-hold .breathing-circle-inner {
    width: 180px;
    height: 180px;
    box-shadow: 0 0 45px var(--secondary-glow);
    animation: subtle-pulse 1s infinite alternate;
}

.breathing-state-exhale .breathing-circle-inner {
    width: 100px;
    height: 100px;
}

.breathing-state-hold-empty .breathing-circle-inner {
    width: 100px;
    height: 100px;
    opacity: 0.6;
}

@keyframes subtle-pulse {
    from { transform: scale(1); }
    to { transform: scale(1.03); }
}

.breathing-instruction {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    text-shadow: 0 0 10px var(--secondary-glow);
    margin-bottom: 8px;
    min-height: 2.25rem;
}

.breathing-timer {
    font-family: var(--font-en);
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 700;
}

/* Energy & Workout Tracker */
.quick-workout-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.btn-quick-workout {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.btn-quick-workout:hover {
    background: rgba(251, 191, 36, 0.1);
    border-color: var(--warning);
}

.workout-log-input {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.workout-log-input input {
    flex: 2;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 12px;
    color: white;
    outline: none;
    font-size: 0.95rem;
}

.workout-log-input input:focus {
    border-color: var(--warning);
    box-shadow: 0 0 10px var(--warning-glow);
}

.workout-log-input button {
    flex: 1;
}

/* Mini custom chart wrapper using SVG */
.chart-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 16px;
    margin-top: 20px;
}

.chart-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
}

.chart-svg-wrapper {
    width: 100%;
    height: 120px;
}

/* Leaderboard Page */
.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.lb-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    text-align: right;
}
html[dir="ltr"] .lb-table {
    text-align: left;
}

.lb-table th {
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid var(--card-border);
}

.lb-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    transition: var(--transition);
}

.lb-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.lb-row td {
    padding: 12px;
    vertical-align: middle;
}

.lb-row td:first-child {
    border-radius: 0 14px 14px 0;
}
.lb-row td:last-child {
    border-radius: 14px 0 0 14px;
}
html[dir="ltr"] .lb-row td:first-child {
    border-radius: 14px 0 0 14px;
}
html[dir="ltr"] .lb-row td:last-child {
    border-radius: 0 14px 14px 0;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-weight: 800;
    font-family: var(--font-en);
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.rank-1 .rank-badge {
    background: linear-gradient(135deg, #ffe066, #f59f00);
    color: #000;
    box-shadow: 0 0 10px rgba(245, 159, 0, 0.4);
}
.rank-2 .rank-badge {
    background: linear-gradient(135deg, #e2e8f0, #94a3b8);
    color: #000;
}
.rank-3 .rank-badge {
    background: linear-gradient(135deg, #b45309, #78350f);
    color: white;
}

.lb-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
}

.rank-1 .lb-avatar { border-color: var(--warning); }

.lb-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.lb-score {
    font-weight: 800;
    color: var(--primary);
    font-size: 0.85rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #0f172a;
    border: 1px solid var(--card-border);
    padding: 30px;
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.8);
    animation: modalSlide 0.3s ease-out forwards;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-icon {
    font-size: 3rem;
    color: var(--danger);
    margin-bottom: 16px;
    text-shadow: 0 0 20px var(--danger-glow);
}

.modal-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 12px;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 24px;
}

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

.modal-actions button {
    flex: 1;
}

/* Timeline & Educational Library */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    padding-right: 20px;
    border-right: 2px solid var(--card-border);
    margin-top: 15px;
    text-align: right;
}
html[dir="ltr"] .timeline {
    padding-right: 0;
    padding-left: 20px;
    border-right: none;
    border-left: 2px solid var(--card-border);
    text-align: left;
}

.timeline-item {
    position: relative;
}

.timeline-dot {
    position: absolute;
    top: 4px;
    right: -27px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--card-border);
    border: 2px solid var(--bg-base);
    transition: var(--transition);
}
html[dir="ltr"] .timeline-dot {
    right: auto;
    left: -27px;
}

.timeline-item.active .timeline-dot {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.timeline-day {
    font-weight: 800;
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.timeline-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.timeline-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}



/* Settings & Configurations */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

.setting-info {
    text-align: right;
}
html[dir="ltr"] .setting-info {
    text-align: left;
}

.setting-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
}

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

.setting-control select {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: 1px solid var(--card-border);
    padding: 8px 12px;
    border-radius: 10px;
    outline: none;
    font-family: inherit;
    font-weight: bold;
    cursor: pointer;
}

/* Responsive adjustments */
@media(min-width: 600px) {
    body {
        padding-top: 40px;
        position: relative;
    }
    
    .top-bar {
        margin-bottom: 40px;
        max-width: 100%;
        padding: 0 40px;
    }
    
    .logo-area {
        font-size: 1.5rem;
    }
    
    .top-bar-center {
        justify-content: flex-start;
    }
    
    .header-actions {
        justify-content: flex-start;
    }
}

/* Settings clickable rows */
.setting-row.link-row {
    cursor: pointer;
    transition: var(--transition);
}
.setting-row.link-row:hover {
    background: rgba(255, 255, 255, 0.03);
    padding-right: 8px;
}
html[dir="ltr"] .setting-row.link-row:hover {
    padding-right: 0;
    padding-left: 8px;
}
.arrow-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: var(--transition);
}
.setting-row.link-row:hover .arrow-icon {
    color: var(--primary);
    transform: translateX(-4px);
}
html[dir="ltr"] .setting-row.link-row:hover .arrow-icon {
    transform: translateX(4px);
}

/* Sub-tabs inside Benefits/Library page */
.sub-tab-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 12px;
}

.sub-tab-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 10px 16px;
    border-radius: 14px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.sub-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.sub-tab-btn.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px var(--primary-glow);
}

.sub-page {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.sub-page.active {
    display: block;
}

/* Large Modals with scrollable body */
.modal-content.modal-large {
    max-width: 500px;
    padding: 24px;
}
.modal-body-scroll::-webkit-scrollbar {
    width: 4px;
}
.modal-body-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* Articles list layout */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: right;
    direction: rtl;
    max-height: 480px;
    overflow-y: auto;
    padding-left: 4px;
}
html[dir="ltr"] .articles-list {
    text-align: left;
    direction: ltr;
    padding-left: 0;
    padding-right: 4px;
}

.article-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.article-card:hover {
    background: rgba(16, 185, 129, 0.03);
    border-color: rgba(16, 185, 129, 0.25);
    transform: translateY(-2px);
}

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

.article-badge {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(6, 182, 212, 0.15);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

.article-card.read .article-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary);
    border-color: rgba(16, 185, 129, 0.15);
}

.article-card-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

.article-card-snippet {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Active Expanded Article View */
.article-full-view {
    animation: fadeIn 0.3s ease forwards;
}

.article-back-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    transition: var(--transition);
    padding: 4px 0;
}

.article-back-btn:hover {
    color: var(--primary-hover);
    transform: translateX(4px);
}
html[dir="ltr"] .article-back-btn:hover {
    transform: translateX(-4px);
}

.article-content {
    line-height: 1.7;
    font-size: 0.92rem;
    color: var(--text-main);
}

.article-content h1 {
    font-size: 1.35rem;
    margin-bottom: 12px;
    color: var(--primary);
}
.article-content h2 {
    font-size: 1.15rem;
    margin-top: 18px;
    margin-bottom: 8px;
    color: var(--text-main);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 4px;
}
.article-content p {
    margin-bottom: 12px;
    color: #e5e7eb;
}
.article-content ul, .article-content ol {
    margin-bottom: 16px;
    padding-right: 20px;
}
html[dir="ltr"] .article-content ul, html[dir="ltr"] .article-content ol {
    padding-right: 0;
    padding-left: 20px;
}
.article-content li {
    margin-bottom: 6px;
    color: #d1d5db;
}

/* Header Modal Navigation Buttons */
.header-link-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-family: inherit;
    margin: 4px;
}

.header-link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-color: var(--primary);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Dashboard Inline Language Selector */
.dashboard-lang-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.lang-picker-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.lang-picker-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    transform: translateY(-1px);
}

.lang-picker-btn.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

/* Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 95px; /* Above mobile bottom nav */
    left: 50%;
    transform: translateX(-50%) translateY(180px);
    width: 90%;
    max-width: 500px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--card-border);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    z-index: 998;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner.active {
    transform: translateX(-50%) translateY(0);
}

.cookie-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

@media (min-width: 480px) {
    .cookie-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: right;
        gap: 16px;
    }
    html[dir="ltr"] .cookie-content {
        text-align: left;
    }
}

.cookie-icon {
    font-size: 1.5rem;
    color: var(--warning);
    text-shadow: 0 0 10px var(--warning-glow);
}

#cookieText {
    font-size: 0.8rem;
    color: var(--text-main);
    flex: 1;
    line-height: 1.45;
}

.cookie-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

@media (min-width: 480px) {
    .cookie-actions {
        width: auto;
        justify-content: flex-end;
    }
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 10px;
}

/* --- PROFESSIONAL MOTION & MICRO-ANIMATIONS --- */

/* Smooth transitions for interactive elements */
.btn, .mood-btn, .lang-picker-btn, .nav-item, .header-link-btn, .icon-btn, .btn-quick-workout {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

/* Shimmer Glare Sweep on Primary CTA */
.btn-primary, .pulse-btn {
    position: relative;
    overflow: hidden;
}

.btn-primary::after, .pulse-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 30%;
    height: 200%;
    background: rgba(255, 255, 255, 0.16);
    transform: rotate(30deg);
    transition: none;
    pointer-events: none;
    opacity: 0;
}

.btn-primary:hover::after, .pulse-btn:hover::after {
    animation: shineSweep 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 1;
}

@keyframes shineSweep {
    0% { left: -60%; }
    100% { left: 140%; }
}

/* Tactile button feedback (shrink slightly on click) */
.btn:active, .mood-btn:active, .lang-picker-btn:active, .header-link-btn:active, .icon-btn:active, .btn-quick-workout:active {
    transform: scale(0.95) !important;
}

/* Smooth input transitions */
.input-group input, textarea.journal-input {
    transition: border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.25s ease;
}

/* Smooth Card Hover Glows */
.card {
    transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    border-color: rgba(16, 185, 129, 0.22) !important;
    box-shadow: 0 35px 70px -15px rgba(0, 0, 0, 0.85), 0 0 20px rgba(16, 185, 129, 0.08) !important;
    transform: translateY(-6px) scale(1.005);
}

/* Breathing Box Transition Styles */
#tools-breathing-section {
    transition: background 1s ease, border-color 1s ease;
}

/* Dynamic backgrounds depending on breath state */
#tools-breathing-section.breathing-state-inhale {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.2);
}
#tools-breathing-section.breathing-state-hold {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}
#tools-breathing-section.breathing-state-exhale {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.15);
}
#tools-breathing-section.breathing-state-hold-empty {
    background: rgba(251, 191, 36, 0.05);
    border-color: rgba(251, 191, 36, 0.15);
}

/* Outer Breathing Circle transitions */
#breathingCircleOuter {
    transition: transform 4s linear, border-color 1s ease, box-shadow 1s ease;
}

#tools-breathing-section.breathing-state-inhale #breathingCircleOuter {
    transform: scale(1.22);
    border-color: var(--secondary);
    box-shadow: 0 0 35px var(--secondary-glow);
    animation: breathingPulse 4s infinite alternate;
}
#tools-breathing-section.breathing-state-hold #breathingCircleOuter {
    transform: scale(1.22);
    border-color: var(--primary);
    box-shadow: 0 0 35px var(--primary-glow);
}
#tools-breathing-section.breathing-state-exhale #breathingCircleOuter {
    transform: scale(1.0);
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 15px var(--danger-glow);
}
#tools-breathing-section.breathing-state-hold-empty #breathingCircleOuter {
    transform: scale(1.0);
    border-color: rgba(251, 191, 36, 0.3);
    box-shadow: 0 0 15px var(--warning-glow);
}

/* Inner Breathing Circle transitions matching the 4-second counts */
#breathingCircleInner {
    transition: transform 4s linear, background 1s ease, box-shadow 1s ease;
}

#tools-breathing-section.breathing-state-inhale #breathingCircleInner {
    transform: scale(1.4);
    background: linear-gradient(135deg, var(--secondary), #06b6d4);
    box-shadow: 0 0 30px var(--secondary-glow);
}
#tools-breathing-section.breathing-state-hold #breathingCircleInner {
    transform: scale(1.4);
    background: linear-gradient(135deg, var(--primary), #059669);
    box-shadow: 0 0 30px var(--primary-glow);
}
#tools-breathing-section.breathing-state-exhale #breathingCircleInner {
    transform: scale(1.0);
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 0 15px var(--danger-glow);
}
#tools-breathing-section.breathing-state-hold-empty #breathingCircleInner {
    transform: scale(1.0);
    background: linear-gradient(135deg, #fbbf24, #d97706);
    box-shadow: 0 0 15px var(--warning-glow);
}

@keyframes breathingPulse {
    0% { box-shadow: 0 0 25px var(--secondary-glow); }
    100% { box-shadow: 0 0 45px rgba(6, 182, 212, 0.4); }
}

/* ==========================================================================
   PREMIUM VISUAL REDESIGN STYLES (UI/UX REDESIGN UPGRADES)
   ========================================================================== */

/* 1. Ambient Background Orbs */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.12;
    z-index: -2;
    pointer-events: none;
    transition: var(--transition);
    will-change: transform;
    backface-visibility: hidden;
    transform: translate3d(0,0,0);
}
.orb-1 {
    width: 320px;
    height: 320px;
    background: var(--primary);
    top: -60px;
    left: -60px;
    animation: floatOrb1 24s ease-in-out infinite alternate;
}
.orb-2 {
    width: 420px;
    height: 420px;
    background: var(--secondary);
    bottom: -120px;
    right: -120px;
    animation: floatOrb2 28s ease-in-out infinite alternate;
}
.orb-3 {
    width: 280px;
    height: 280px;
    background: var(--warning);
    top: 35%;
    left: 55%;
    animation: floatOrb3 20s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(70px, 50px) scale(1.15); }
}
@keyframes floatOrb2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-90px, -60px) scale(1.2); }
}
@keyframes floatOrb3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, -80px) scale(0.9); }
}

/* 2. Enhanced Card Glassmorphism & Spacing */
.card {
    background: rgba(10, 15, 30, 0.65) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}



/* 4. Confetti Celebration Effect */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99999;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    width: 8px;
    height: 12px;
    border-radius: 2px;
    opacity: 0.9;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(105vh) rotate(720deg) translateX(40px);
        opacity: 0;
    }
}

/* 5. Skeleton Loader Shimmer */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 25%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0.02) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 6px;
    display: inline-block;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-text {
    height: 14px;
    width: 90%;
    margin: 4px 0;
}
.skeleton-text.short {
    width: 50%;
}
.skeleton-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
}

.skeleton-row td {
    padding: 16px 12px;
    vertical-align: middle;
}

/* Footer Styles */
.app-footer {
    width: 100%;
    max-width: 600px;
    margin-top: 40px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    z-index: 50;
    text-align: center;
}

.footer-divider {
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--card-border), transparent);
    margin-bottom: 8px;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.footer-links button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.footer-links button:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

.footer-separator {
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.8rem;
    user-select: none;
}

.footer-rights {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: var(--transition);
}

.footer-socials {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.instagram-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white !important;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(220, 39, 67, 0.25);
    transition: var(--transition);
}

.instagram-badge i {
    font-size: 1.05rem;
}

.instagram-badge:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(220, 39, 67, 0.4);
}

.instagram-badge:active {
    transform: translateY(-1px) scale(0.98);
}

.telegram-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #0088cc 0%, #229ed9 100%);
    color: white !important;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.25);
    transition: var(--transition);
}

.telegram-badge i {
    font-size: 1.05rem;
}

.telegram-badge:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

.telegram-badge:active {
    transform: translateY(-1px) scale(0.98);
}

.youtube-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white !important;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.25);
    transition: var(--transition);
}

.youtube-badge i {
    font-size: 1.05rem;
}

.youtube-badge:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

.youtube-badge:active {
    transform: translateY(-1px) scale(0.98);
}

/* Header & Top Bar Auth Corner styles */
.header-actions-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-corner {
    position: relative;
}

.btn-auth-top {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px var(--primary-glow);
    transition: var(--transition);
}

.btn-auth-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4);
}

/* User Menu & Avatar Button */
.user-avatar-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 4px 8px;
    border-radius: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.user-avatar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.top-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.avatar-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Dropdown Menu */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    width: 180px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    padding: 8px;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out forwards;
}

html[dir="rtl"] .user-dropdown-menu {
    right: auto;
    left: 0;
}

.user-dropdown-menu.active {
    display: flex;
}

.dropdown-header {
    padding: 6px 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

html[dir="ltr"] .dropdown-header {
    text-align: left;
}

.dropdown-username {
    display: block;
}

.dropdown-divider {
    height: 1px;
    background: var(--card-border);
    margin: 6px 0;
}

.dropdown-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: right;
    cursor: pointer;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    transition: var(--transition);
}

html[dir="ltr"] .dropdown-item {
    text-align: left;
}

.dropdown-item i {
    font-size: 0.95rem;
    color: var(--primary);
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.dropdown-item.danger {
    color: var(--danger);
}
.dropdown-item.danger i {
    color: var(--danger);
}
.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Preset avatars for settings */
.avatar-presets {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.preset-avatar-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.preset-avatar-img:hover {
    transform: scale(1.1);
}

.preset-avatar-img.active {
    border-color: var(--primary);
}

.avatar-presets-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.settings-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--card-border);
    padding: 12px;
    border-radius: 14px;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.settings-select:focus {
    border-color: var(--primary);
}

/* Live Subscriber Counter Widget */
.live-counter-widget {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 14px auto 10px auto;
    width: fit-content;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.05);
    animation: pulseGlow 3s infinite alternate;
}

.live-dot {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

.live-dot::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    animation: pulseDot 1.6s infinite ease-out;
}

.live-count-num {
    color: var(--primary);
    font-weight: 800;
    font-size: 0.95rem;
    text-shadow: 0 0 8px var(--primary-glow);
}

@keyframes pulseDot {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes pulseGlow {
    from {
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.05);
        border-color: rgba(16, 185, 129, 0.15);
    }
    to {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
        border-color: rgba(16, 185, 129, 0.3);
    }
}

/* Home Page / Landing Styles */
.hero-banner {
    text-align: center;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.12), transparent 70%), var(--card-bg) !important;
}

.home-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
}

.home-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 480px;
}

.pulse-btn {
    animation: buttonPulse 2.5s infinite;
}

@keyframes buttonPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.quote-card {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.05), rgba(17, 24, 39, 0.45)) !important;
}

.features-grid {
    margin-top: 16px;
}

.feature-item {
    background: rgba(17, 24, 39, 0.45) !important;
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.feature-icon-wrapper {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

/* GTA VI Scroll Reveal Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Delays for staggered reveal */
.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.25s;
}

.reveal-delay-3 {
    transition-delay: 0.4s;
}

/* User Stats Grid (Direction-Aware) */
.user-stats-grid {
    display: flex;
    justify-content: space-around;
    font-size: 0.9rem;
    width: 100%;
}
.user-stat-item {
    flex: 1;
    text-align: center;
}
.user-stat-item.border-start {
    border-inline-start: 1px solid var(--card-border);
}

/* Aligned Leaderboard Column */
.lb-score-cell {
    text-align: left;
}
html[dir="ltr"] .lb-score-cell {
    text-align: right;
}

/* Nav Item text truncation on mobile screen width */
.nav-item span {
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Naqaa Tree SVG & Leaf Animations */
.naqaa-tree-container {
    width: 140px;
    height: 140px;
    margin: 0 auto 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 12px var(--primary-glow));
    transition: var(--transition);
}

.tree-leaf {
    transform-origin: center bottom;
    transition: opacity 1s ease, transform 1s ease, fill 1s ease;
    animation: leafSway 4s ease-in-out infinite alternate;
    will-change: transform;
}

.tree-leaf:nth-child(even) {
    animation-duration: 6s;
    animation-delay: 1.5s;
}

@keyframes leafSway {
    0% { transform: rotate(-2deg); }
    100% { transform: rotate(4deg); }
}

/* Daily Challenges Card */
.challenges-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.challenge-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(10, 15, 30, 0.4);
    border: 1px solid var(--card-border);
    transition: var(--transition);
}

.challenge-item.completed {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.05);
}

.challenge-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: transparent;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.challenge-item.completed .challenge-checkbox {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.challenge-details {
    flex: 1;
    text-align: right;
}

html[dir="rtl"] .challenge-details {
    text-align: left;
}

.challenge-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    transition: var(--transition);
}

.challenge-item.completed .challenge-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.challenge-action-btn {
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    transition: var(--transition);
}

.challenge-action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}

.challenge-item.completed .challenge-action-btn {
    display: none;
}

/* Relapse Trigger Stats Chart */
.trigger-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.trigger-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trigger-name {
    width: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

html[dir="ltr"] .trigger-name {
    text-align: left;
}

.trigger-bar-wrapper {
    flex: 1;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.trigger-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 6px;
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px var(--primary-glow);
}

.trigger-percent {
    font-family: var(--font-en);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 45px;
    text-align: left;
}

html[dir="rtl"] .trigger-percent {
    text-align: right;
}

/* Theme Selector Grid */
.theme-selector-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: transparent;
    border: none;
    outline: none;
}

.theme-color-preview {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.theme-btn:hover .theme-color-preview {
    transform: scale(1.1);
}

.theme-btn.active .theme-color-preview {
    border-color: white;
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.theme-btn span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.theme-btn.active span {
    color: var(--text-main);
    font-weight: 700;
}

/* Relapse Trigger Modal Selection */
.trigger-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 16px;
    margin-bottom: 20px;
}

.trigger-option-btn {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    transition: var(--transition);
    text-align: center;
}

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

.trigger-option-btn.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}





/* --- DETAILED RECOVERY STATS TABLE & SCIENTIFIC TIMELINE --- */
.stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    text-align: center;
    margin-top: 10px;
}
.stats-table th {
    padding: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--card-border);
}
.stats-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    transition: var(--transition, 0.3s ease);
}
.stats-row:hover {
    background: rgba(255, 255, 255, 0.05);
}
.stats-row td {
    padding: 12px 10px;
    font-size: 0.9rem;
    color: var(--text-main);
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}
.stats-row td:first-child {
    border-left: 1px solid var(--card-border);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.stats-row td:last-child {
    border-right: 1px solid var(--card-border);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}
/* RTL adjustment for table borders */
html[dir="rtl"] .stats-row td:first-child {
    border-left: none;
    border-right: 1px solid var(--card-border);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}
html[dir="rtl"] .stats-row td:last-child {
    border-right: none;
    border-left: 1px solid var(--card-border);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

/* Science Section Styles */
.science-card {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 16px;
    padding: 10px 5px;
}
.science-intro {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 20px;
}
.science-section {
    margin-bottom: 30px;
    border-left: 3px solid var(--primary);
    padding-left: 18px;
    margin-top: 20px;
}
html[dir="rtl"] .science-section {
    border-left: none;
    border-right: 3px solid var(--primary);
    padding-left: 0;
    padding-right: 18px;
}
.science-section-title {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 15px;
}
.science-point {
    margin-bottom: 20px;
}
.science-point-sub {
    color: var(--secondary);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.science-point-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.65;
}
.science-sources-list {
    list-style-type: decimal;


/* --- DETAILED RECOVERY STATS TABLE & SCIENTIFIC TIMELINE --- */
.stats-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    text-align: center;
    margin-top: 10px;
}
.stats-table th {
    padding: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--card-border);
}
.stats-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    transition: var(--transition, 0.3s ease);
}
.stats-row:hover {
    background: rgba(255, 255, 255, 0.05);
}
.stats-row td {
    padding: 12px 10px;
    font-size: 0.9rem;
    color: var(--text-main);
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}
.stats-row td:first-child {
    border-left: 1px solid var(--card-border);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.stats-row td:last-child {
    border-right: 1px solid var(--card-border);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}
/* RTL adjustment for table borders */
html[dir="rtl"] .stats-row td:first-child {
    border-left: none;
    border-right: 1px solid var(--card-border);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}
html[dir="rtl"] .stats-row td:last-child {
    border-right: none;
    border-left: 1px solid var(--card-border);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

/* Science Section Styles */
.science-card {
    background: rgba(255, 255, 255, 0.01);
    border-radius: 16px;
    padding: 10px 5px;
}
.science-intro {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 20px;
}
.science-section {
    margin-bottom: 30px;
    border-left: 3px solid var(--primary);
    padding-left: 18px;
    margin-top: 20px;
}
html[dir="rtl"] .science-section {
    border-left: none;
    border-right: 3px solid var(--primary);
    padding-left: 0;
    padding-right: 18px;
}
.science-section-title {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 15px;
}
.science-point {
    margin-bottom: 20px;
}
.science-point-sub {
    color: var(--secondary);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.science-point-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.65;
}
.science-sources-list {
    list-style-type: decimal;
    padding-left: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.7;
}
html[dir="rtl"] .science-sources-list {
    padding-left: 0;
    padding-right: 20px;
}
.science-sources-list li {
    margin-bottom: 12px;
}

/* ==========================================================================
   PREMIUM FEATURES & ANIMATIONS UPGRADES
   ========================================================================== */

/* 1. Interactive SVG Donut Chart */
.relapse-chart-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.donut-chart-container {
    position: relative;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.svg-donut-chart {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-segment {
    fill: none;
    stroke-width: 14px;
    cursor: pointer;
    transition: stroke-width 0.3s ease, filter 0.3s ease;
}

.donut-segment:hover {
    stroke-width: 18px;
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 70%;
    pointer-events: none;
    user-select: none;
}

.donut-center-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.donut-center-val {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    margin-top: 4px;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 180px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--card-border);
}

.legend-item.highlighted {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    flex: 1;
}

.legend-pct {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-muted);
}

/* 2. Anonymous Support Wall */
.support-post-box {
    background: rgba(10, 15, 30, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.support-post-box textarea {
    width: 100%;
    height: 90px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    outline: none;
    box-sizing: border-box;
    transition: var(--transition);
}

.support-post-box textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.post-box-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.char-counter {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
}

.support-posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.support-card {
    background: rgba(30, 41, 59, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.support-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.support-avatar-wrapper {
    flex-shrink: 0;
}

.support-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.support-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
}

html[dir="ltr"] .support-content {
    text-align: left;
}

.support-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.support-author {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary);
}

.support-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.support-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-main);
    word-break: break-word;
}

.support-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.support-like-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 6px 12px;
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
}

.support-like-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.support-like-btn.liked {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    cursor: default;
}

.support-like-btn i {
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.support-like-btn:active i {
    transform: scale(1.4);
}

/* 3. Hero's Journey Map */
.journey-map-wrapper {
    position: relative;
    width: 100%;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid var(--card-border);
    border-radius: 22px;
    padding: 16px;
    margin-top: 16px;
    box-sizing: border-box;
    overflow: hidden;
}

.journey-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

.journey-node {
    cursor: pointer;
    transition: var(--transition);
}

.journey-node circle {
    transition: var(--transition);
}

.journey-node:hover circle {
    transform: scale(1.18);
    transform-origin: center;
}

.journey-node.locked circle {
    fill: rgba(30, 41, 59, 0.65);
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 1.2px;
}

.journey-node.active-pulse circle {
    fill: var(--warning);
    stroke: #fbbf24;
    stroke-width: 1.5px;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.7));
    animation: nodePulse 2s infinite ease-in-out;
}

.journey-node.unlocked circle {
    fill: var(--primary);
    stroke: var(--primary-glow);
    stroke-width: 1.5px;
    filter: drop-shadow(0 0 5px var(--primary-glow));
}

@keyframes nodePulse {
    0%, 100% { transform: scale(1); transform-origin: center; }
    50% { transform: scale(1.15); transform-origin: center; filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.9)); }
}

.journey-node text {
    font-family: inherit;
    font-weight: 700;
    font-size: 2.2px;
    fill: #9ca3af;
    fill: var(--text-muted);
    text-anchor: middle;
    pointer-events: none;
    user-select: none;
    transition: fill 0.3s ease, font-weight 0.3s ease;
}

.journey-node.unlocked text,
.journey-node.active-pulse text {
    fill: #f9fafb;
    fill: var(--text-main);
    font-weight: 800;
}

/* Dashboard Side-by-Side Row Layout */
.dashboard-two-columns {
    display: flex;
    gap: 20px;
    margin-top: 24px;
    width: 100%;
}

.dashboard-two-columns > .card {
    flex: 1;
    margin-top: 0 !important;
}

@media (max-width: 360px) {
    .dashboard-two-columns {
        flex-direction: column;
        gap: 12px;
    }
}

/* Mobile optimizations to allow cards to be side-by-side cleanly */
@media (max-width: 600px) {
    .card {
        padding: 14px 12px !important;
        border-radius: 18px !important;
        margin-bottom: 14px !important;
    }
    .dashboard-two-columns {
        gap: 10px !important;
        margin-top: 14px !important;
    }
    .stats-table th, .stats-row td {
        padding: 6px 4px !important;
        font-size: 0.72rem !important;
    }
    .badges-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
    }
    .badge-card {
        padding: 8px 4px !important;
        border-radius: 12px !important;
    }
    .badge-icon {
        font-size: 1.3rem !important;
        margin-bottom: 3px !important;
    }
    .badge-title {
        font-size: 0.65rem !important;
        line-height: 1.1 !important;
    }
    .badge-desc {
        font-size: 0.6rem !important;
    }
}

.journey-benefit-card {
    background: rgba(30, 41, 59, 0.25);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 16px;
    margin-top: 16px;
    transition: var(--transition);
    animation: fadeIn 0.4s ease forwards;
}

.journey-benefit-card.highlight-pulse {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.benefit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
    flex-wrap: wrap;
}

.benefit-badge {
    background: rgba(16, 185, 129, 0.12);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.benefit-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.benefit-text {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
}

/* 4. Circular Progress Timer & Pulse Glow (Removed as requested to align the counter directly below the badge) */

/* 5. Scroll-Linked Timeline Progress Line */
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: -2px;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--primary-glow));
    transform-origin: top;
    transform: scaleY(var(--timeline-scroll, 0));
    filter: drop-shadow(0 0 6px var(--primary-glow));
    transition: transform 0.05s linear;
}

html[dir="ltr"] .timeline::before {
    right: auto;
    left: -2px;
}

.timeline-item {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    opacity: 0.5;
    transform: scale(0.96);
}

.timeline-item.active {
    opacity: 1;
    transform: scale(1);
}

.timeline-item.active .timeline-dot {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
    transform: scale(1.25);
}

.timeline-item.active-pulse {
    animation: timelinePulse 0.3s ease;
}

@keyframes timelinePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); filter: brightness(1.2); }
    100% { transform: scale(1); }
}

/* Ad Container Styling */
.ad-container {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--card-border);
    border-radius: 16px;
    padding: 10px;
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-sizing: border-box;
}

.ad-label {
    position: absolute;
    top: -8px;
    background: #1e293b;
    border: 1px solid var(--card-border);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 700;
}
