:root {
    --primary: #4d2773;
    --accent: #dba32a;
    --bg-dark: #0f0a15;
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Tajawal', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Desktop container logic (70% width) */
@media (min-width: 1024px) {
    body {
        max-width: 70%;
        margin: 0 auto;
        border-left: 1px solid var(--glass-border);
        border-right: 1px solid var(--glass-border);
        box-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
        position: relative;
    }

    .bottom-nav {
        left: 50% !important;
        transform: translateX(-50%);
        width: 50% !important;
        max-width: 100%;
        bottom: 30px !important;
        border-radius: 100px;
        border: 1px solid var(--glass-border);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
        background: rgba(20, 15, 30, 0.9);
        padding: 10px 10px !important;
    }
}

/* Background Blooms (Design 1 style) */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    z-index: -1;
    filter: blur(100px);
    opacity: 0.15;
    pointer-events: none;
}

body::before {
    background: var(--primary);
    top: -10%;
    right: -10%;
}

body::after {
    background: var(--accent);
    bottom: -10%;
    left: -10%;
}

/* App Header */
.app-header {
    padding: 30px 24px 20px;
    background: linear-gradient(to bottom, rgba(77, 39, 115, 0.2), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -1.5px;
    margin-bottom: 2px;
    background: linear-gradient(90deg, #fff 0%, var(--accent) 25%, #fff 50%, var(--accent) 75%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerLoop 3s linear infinite;
}

@keyframes shimmerLoop {
    to {
        background-position: 200% center;
    }
}

.app-header .status-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
}

/* Scrollable Content Area */
.app-content {
    flex: 1;
    padding: 0 20px 100px;
}

.app-section-title {
    font-size: 14px;
    color: var(--text-muted);
    margin: 10px 0 10px;
    font-weight: 500;
}

/* Horizontal Visa Types - Holographic Redesign */
.types-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 72px 20px 20px;
    /* High top padding for pop-out icons */
    scrollbar-width: none;
}

.types-scroll::-webkit-scrollbar {
    display: none;
}

.mobile-type-card {
    min-width: 140px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 30px 16px 20px;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: visible;
    /* CRITICAL for pop-out */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.mobile-type-card.active {
    background: linear-gradient(135deg, rgba(77, 39, 115, 0.2), rgba(219, 163, 42, 0.1));
    border-color: var(--accent);
    transform: translateY(5px);
    box-shadow: 0 0 30px rgba(219, 163, 42, 0.15);
}

.mobile-type-card .icon {
    font-size: 45px;
    position: absolute;
    top: -45px;
    /* Floating outside the card */
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 15px 15px rgba(0, 0, 0, 0.5));
    display: block;
    z-index: 5;
}

.mobile-type-card.active .icon {
    top: -55px;
    /* Higher pop-out on active */
    transform: translateX(-50%) scale(1.2) rotate(-5deg);
    filter: drop-shadow(0 0 10px var(--accent));
}

.mobile-type-card .label {
    font-size: 14px;
    font-weight: 800;
    display: block;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

/* Input Group */
.app-input-group {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    margin-top: 12px;
}

.mode-switcher {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.mode-item {
    flex: 1;
    text-align: center;
    padding: 8px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}

input:checked+.mode-item {
    background: var(--accent);
    color: var(--bg-dark);
    font-weight: 700;
}

input[type="text"],
textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    color: white;
    font-size: 16px;
    margin-bottom: 20px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 10, 21, 0.8);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 12px 24px calc(12px + var(--safe-area-bottom));
    display: flex;
    justify-content: center;
    z-index: 100;
}

.main-action-btn {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 16px 32px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.5px;
    width: 100%;
    max-width: 95%;
    /* Cap width for desktop */
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.main-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--btn-p, 0%);
    background: linear-gradient(90deg, #d4a017, #f7c34b, #d4a017);
    /* Premium Gold Gradient */
    background-size: 200% 100%;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 0;
}

.main-action-btn span,
.main-action-btn div {
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.main-action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.main-action-btn:active {
    transform: translateY(-1px);
}

.main-action-btn.processing {
    border-color: #d4a017;
    box-shadow: 0 0 25px rgba(212, 160, 23, 0.25);
}

/* Tablet / Desktop Overrides */
@media (min-width: 768px) {
    .main-action-btn {
        padding: 10px 41px;
        font-size: 16px;
        border-radius: 24px;
    }
}

/* Enhanced Progress Dashboard Styles */
/* --- Elite Progress Dashboard UI (Professional Redesign) --- */
.elite-dashboard {
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.02);
    animation: dashboardEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dashboardEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dashboard-backdrop {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--primary) 0%, transparent 60%);
    opacity: 0.1;
    pointer-events: none;
    animation: auroraRotate 20s linear infinite;
}

@keyframes auroraRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.brand-badge {
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(219, 163, 42, 0.2);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    animation: dotPulse 1.5s infinite;
}

@keyframes dotPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.dashboard-timer {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: white;
}

/* Main Progress Bar */
.main-progress-bar {
    position: relative;
    margin-bottom: 30px;
}

.bar-background {
    height: 16px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 100px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.bar-fill-glow {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #fff, var(--accent));
    background-size: 200% auto;
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 20px rgba(219, 163, 42, 0.5);
    position: relative;
    animation: flowGradient 2s linear infinite;
}

.scan-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: scanMove 1.5s infinite;
}

@keyframes scanMove {
    from {
        left: -40px;
    }

    to {
        left: 100%;
    }
}

.percentage-overlay {
    position: absolute;
    top: -25px;
    right: 0;
}

#progressPercent {
    font-weight: 900;
    font-size: 14px;
    color: var(--accent);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* col-12 on mobile */
    gap: 15px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        /* col-6 on laptop */
    }
}

.stat-chip {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    font-size: 24px;
}

.stat-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.full-width-chip {
    grid-column: span 2;
    min-height: 80px;
    align-items: flex-start !important;
}

.active-tasks-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-top: 8px;
}

.task-unit {
    background: rgba(255, 157, 0, 0.08);
    border: 1px solid rgba(255, 157, 0, 0.15);
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    color: var(--accent);
    text-align: center;
    animation: taskItemEnter 0.4s ease-out;
}

@keyframes taskItemEnter {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Status Footer */
.status-footer {
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spinner-modern {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(219, 163, 42, 0.2);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

#currentStatus {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

input[type="radio"] {
    position: absolute;
    opacity: 0;
}