:root {
    --bg-primary: #0b0f19;
    --card-bg: rgba(17, 24, 39, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --accent: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.25);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --glass-highlight: rgba(255, 255, 255, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: 'Outfit', 'Hind Siliguri', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

/* Background decorative blurs */
body::before,
body::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(150px);
    z-index: -1;
    opacity: 0.4;
}

body::before {
    background: var(--accent);
    top: 10%;
    left: -100px;
}

body::after {
    background: #0284c7;
    bottom: 10%;
    right: -100px;
}

.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 5px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

@media (max-width: 640px) {
    .container {
        padding: 20px 5px;
    }
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Glass Card styling */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 30px;
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(16, 185, 129, 0.2);
}

/* Form Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

select,
input[type="text"],
input[type="number"] {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

select:focus,
input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px var(--accent-glow);
}

select option {
    background-color: var(--bg-primary);
    color: var(--text-main);
}

/* Select wrapper styling for custom arrow */
.select-wrapper {
    position: relative;
}

/* Shreni categories (Chips selection) */
.shreni-section {
    margin-top: 30px;
}

.shreni-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 15px;
}

/* Selectors Grid (Division, District, Upazila side-by-side) */
.selectors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 25px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.shreni-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

@media (max-width: 900px) {
    .selectors-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .shreni-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .selectors-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .shreni-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .shreni-btn {
        padding: 10px 8px !important;
        font-size: 0.88rem !important;
    }
}


.shreni-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    backdrop-filter: blur(5px);
}

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

.shreni-btn.active {
    background: var(--accent);
    color: #0b0f19;
    font-weight: 600;
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Calculator Section */
.calc-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 640px) {
    .calc-section {
        grid-template-columns: 1fr;
    }
}

.rate-display,
.amount-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.readonly-input {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
    color: var(--accent) !important;
    font-weight: 600;
    font-size: 1.2rem;
}

/* Result panel styling */
.result-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-card h4 {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

/* Disclaimer / Note */
.disclaimer {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.6;
    margin-top: 10px;
}

/* Footer Section */
footer {
    text-align: center;
    padding: 20px 15px;
    margin-top: auto;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    text-decoration: underline;
}

.footer-copyright {
    margin-bottom: 8px;
}

.footer-info {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
}

.footer-divider {
    color: rgba(255, 255, 255, 0.15);
}

@media (max-width: 640px) {
    .footer-info {
        flex-direction: column;
        gap: 4px;
    }

    .footer-divider {
        display: none;
    }

    footer {
        padding: 20px 10px;
        font-size: 0.75rem;
    }
}

/* Info Banner bottom */
.info-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.info-banner a.btn {
    background: var(--accent);
    color: #0b0f19;
    padding: 8px 18px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.info-banner a.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* App-like Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100vw;
    background: rgba(11, 15, 25, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: stretch;
    z-index: 999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    padding-bottom: env(safe-area-inset-bottom, 0);
    overflow: hidden;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
    outline: none;
    gap: 5px;
    padding: 10px 5px;
    min-width: 0;
    overflow: hidden;
}

.bottom-nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex-shrink: 0;
    transition: var(--transition);
}

.bottom-nav-item:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.04);
}

.bottom-nav-item.active {
    color: var(--accent);
    border-top: 2px solid var(--accent);
    background: rgba(16, 185, 129, 0.07);
}

.bottom-nav-item:active {
    transform: scale(0.94);
}

/* Add extra padding at the bottom of container to avoid overlap with bottom nav */
.container {
    padding-bottom: 90px !important;
}

/* Responsive Hide rules */
@media (max-width: 640px) {
    .info-banner {
        display: none !important;
    }
}

@media (min-width: 641px) {
    .bottom-nav {
        display: none !important;
    }
}

/* ===== Mobile / Desktop Visibility ===== */
.mobile-only { display: none !important; }
.desktop-only { display: block; }

@media (max-width: 640px) {
    .mobile-only { display: flex !important; flex-direction: column; }
    .desktop-only { display: none !important; }

    /* Container reset for mobile full-screen wizard */
    .container {
        padding: 0 !important;
        max-width: 100vw;
    }

    /* Mobile Performance: Disable expensive backdrop-filters to fix lag & jank */
    .bottom-nav {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: #0b0f19 !important;
    }
    .wizard-header {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: #111827 !important;
    }
    .shreni-btn {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    .card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* ===== Mobile Wizard Layout ===== */
.mobile-wizard {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px; /* above bottom nav */
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
    z-index: 10;
}

/* Wizard Header */
.wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(17, 24, 39, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.wizard-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.step-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.step-dot.active {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    width: 26px;
    border-radius: 5px;
}

/* Steps container scrollable */
.wizard-steps {
    flex: 1;
    overflow-y: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

/* Individual Step */
.wizard-step {
    display: none;
    padding: 20px 18px;
    animation: fadeSlideIn 0.3s ease;
    min-height: 100%;
}

.wizard-step.active {
    display: block;
}

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

.step-label {
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.step-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
}

/* Mobile grid variants */
.mobile-grid-2 {
    grid-template-columns: repeat(2, 1fr) !important;
}

.mobile-grid-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* Wizard navigation buttons */
.wizard-next-btn {
    margin-top: 20px;
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #0b0f19;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.wizard-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.wizard-next-btn:active {
    transform: scale(0.97);
}

.wizard-back-btn {
    flex: 1;
    padding: 13px;
    background: rgba(255,255,255,0.07);
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.wizard-back-btn:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-main);
}

/* Mobile rate display box */
.mobile-rate-box {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 14px;
    padding: 15px;
    text-align: center;
}

.mobile-rate-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

/* Result Grid - two boxes side by side */
.mobile-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
}

.mobile-result-box {
    border-radius: 14px;
    padding: 15px 10px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
}

.mobile-result-box.accent {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
}

.mobile-result-box.warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}

.mobile-result-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    font-weight: 600;
}

.mobile-result-value {
    font-size: 1.1rem;
    font-weight: 800;
    word-break: break-all;
}

.mobile-result-box.accent .mobile-result-value {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.mobile-result-box.warning .mobile-result-value {
    color: #f59e0b;
}

/* ===== Custom Splash Screen ===== */
.custom-splash {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.custom-splash.hide-splash {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
    animation: splashFadeUp 0.8s ease-out;
}

.splash-logo {
    width: 80px; height: 80px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 0 25px var(--accent-glow);
}

.splash-content h2 {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 30px;
}

.splash-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 5px 0;
    font-weight: 500;
}

@keyframes splashFadeUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}