/* =========================================================================
   DIGITALHAUSA UNIFIED DESIGN TOKENS
   Single source of truth for colors, spacing, and typography.
   ========================================================================= */

:root {
    /* Brand Colors */
    --primary-green: #2E7D32;
    --primary-green-hover: #225C25;
    --brand-green: #1e5235;
    --brand-green-light: #eef7f2;
    --accent-gold: #C99700;
    --status-success: #2e7d32;
    --tag-blue: #2563eb;

    /* Surfaces */
    --bg-warm: #FAF9F6;
    --bg-main: #f8f9fa;
    --surface-white: #FFFFFF;
    --surface-card: #ffffff;

    /* Text */
    --text-dark: #263238;
    --text-main: #1f2937;
    --text-secondary: #607D8B;
    --text-muted: #4b5563;

    /* Borders & Shadows */
    --border-light: rgba(0, 0, 0, 0.08);
    --border-color: #e5e7eb;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.04);

    /* Radii */
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Special */
    --code-bg: #1e1e24;
}

/* =========================================================================
   GLOBAL RESET & BASE STYLES (extracted from style.css + profile.css)
   ========================================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-warm);
    color: var(--text-dark);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* =========================================================================
   SHARED COMPONENTS (used across multiple pages)
   ========================================================================= */

/* --- App Bar / Header --- */
.dash-app-bar, .main-header {
    background-color: var(--surface-white);
    border-bottom: 1px solid var(--border-light);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
}

.brand-identity, .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo, .logo-icon { font-size: 1.4rem; }

.brand-name, .logo-text {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.4px;
}

/* --- Language Toggle --- */
.lang-toggle-badge, .lang-toggle, .btn-lang {
    background-color: var(--bg-warm);
    border: 1px solid var(--border-light);
    color: var(--text-dark);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
}

/* --- Bottom Navigation --- */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--surface-white);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    padding: 10px 6px 20px 6px;
    z-index: 999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.02);
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    flex: 1;
    min-width: 0;
    color: var(--text-secondary);
}

.tab-icon {
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.tab-text {
    font-size: 0.7rem;
    font-weight: 700;
}

.active-tab .tab-icon { transform: translateY(-2px); }
.active-tab .tab-text { color: var(--primary-green); }

/* --- Cards & Surfaces --- */
.welcome-surface-card, .stat-card, .resume-learning-panel,
.metric-card, .paths-list-wrapper, .dict-card,
.profile-identity-card, .settings-list-wrapper,
.visual-card, .category-block, .track-card, .progress-card {
    background-color: var(--surface-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
}

/* --- Progress Bars --- */
.goal-progress-bar, .mini-bar, .sidebar-progress-bar {
    background-color: var(--bg-warm);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.goal-progress-fill, .mini-fill, .sidebar-progress-fill {
    height: 100%;
    background-color: var(--primary-green);
    border-radius: var(--radius-full);
}

.mini-fill.complete-bg, .complete-bg {
    background-color: var(--accent-gold);
}

/* --- Buttons --- */
.btn-primary, .resume-btn {
    background-color: var(--primary-green);
    color: var(--surface-white);
    text-decoration: none;
    padding: 14px;
    border-radius: var(--radius-xl);
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-primary:hover, .resume-btn:hover {
    background-color: var(--primary-green-hover);
}

.btn-secondary {
    background-color: var(--surface-white);
    color: var(--text-dark);
    border: 1px solid rgba(0, 0, 0, 0.15);
    padding: 14px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

/* --- Utility --- */
.hidden { display: none !important; }

/* --- Responsive --- */
@media (min-width: 768px) {
    .dash-workspace, .dict-workspace, .profile-workspace {
        max-width: 540px;
    }
}

/* =========================================================================
   PROFILE PAGE STYLES (merged from profile.css)
   ========================================================================= */

/* --- Core Layout Profile Layout Extensions --- */

.profile-workspace {
    max-width: 540px;
    margin: 0 auto;
    padding: 20px 16px 100px 16px; 
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- Profile Identity Card --- */
.profile-identity-card {
    background-color: var(--surface-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 20px;
}

.avatar-frame {
    width: 64px;
    height: 64px;
    background-color: var(--bg-warm);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: 1px solid var(--border-light);
}

.user-meta-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-username {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.3px;
}

.profile-role-badge {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-green);
    background-color: rgba(46, 125, 50, 0.08);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    align-self: flex-start;
}

/* --- Internal Core Profile Performance Stats Layout --- */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    text-align: center;
    padding-top: 4px;
}

.profile-stat-node {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 4px;
}

.profile-stat-node:not(:last-child) {
    border-right: 1px solid var(--border-light);
}

.profile-stat-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-dark);
}

.profile-stat-lbl {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* --- Interactive Settings Lists System --- */
.settings-list-wrapper {
    background-color: var(--surface-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 8px 16px;
    box-shadow: var(--shadow-soft);
}

.settings-row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.settings-row-item:last-child {
    border-bottom: none;
}

.settings-row-item:active {
    opacity: 0.6;
}

.settings-left-side {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-icon {
    font-size: 1.1rem;
}

.settings-label-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
}

.settings-arrow {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: bold;
}

/* Dangerous Log Out Action Override styles */
.text-danger .settings-label-text,
.text-danger .settings-arrow {
    color: #c62828;
}