:root {
    /* DARK THEME (DEFAULT) - BLUE/CYAN */
    --bg-overlay: rgba(11, 15, 25, 0.85); /* Затенение фона */
    --card-bg: rgba(22, 29, 45, 0.55);
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --accent: #3b82f6; /* Blue */
    --accent-glow: rgba(59, 130, 246, 0.4);
    --border-color: rgba(255, 255, 255, 0.1);
    --btn-gradient: linear-gradient(135deg, #06b6d4, #3b82f6);
    --input-bg: rgba(11, 15, 25, 0.6);
}

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

body {
    font-family: 'Nunito', sans-serif;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    padding: 24px 16px;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: color 0.3s ease;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('bg.png');
    background-size: cover;
    background-position: center;
    background-color: var(--bg-overlay);
    background-blend-mode: overlay;
    z-index: -1;
    transition: background-color 0.3s ease;
}

.app-container {
    width: 100%;
    max-width: 540px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 1;
}

/* Top Navigation Bar */
.nav-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px;
    animation: fadeInDown 0.4s ease-out;
}

.nav-arrow {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 20px;
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    flex-shrink: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding-bottom: 2px;
}

.nav-arrow.visible {
    opacity: 1;
    visibility: visible;
}

.nav-arrow:hover {
    color: var(--text-main);
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.top-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    width: 100%;
    scroll-behavior: smooth;
}

.top-nav::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

.nav-item {
    white-space: nowrap;
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-item:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-item.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Header, Logo & Theme Switch */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeInDown 0.5s ease-out;
    padding: 0 4px;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.brand-title {
    font-weight: 900;
    font-size: 24px;
    letter-spacing: -0.5px;
}

.brand-title .highlight {
    color: var(--accent);
}

/* Toggle Switch Styles */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
}
.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider.round {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}
.slider.round:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
input:checked + .slider.round {
    background-color: rgba(255,255,255,0.4);
}
input:checked + .slider.round:before {
    transform: translateX(28px);
}
.icon {
    font-size: 14px;
    z-index: 1;
}

/* Hero Stats Section */
.hero-stats {
    text-align: center;
    margin: 10px 0 20px;
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

.hero-title {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 4px;
    color: var(--accent);
}

.hero-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-weight: 600;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.stat-item {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 12px 0;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.stat-value {
    font-size: 18px;
    font-weight: 900;
    color: var(--accent);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

/* Main Card */
.card.glass {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.5s ease-out 0.1s both;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"], input[type="number"] {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 16px;
    border-radius: 16px;
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.currency-input-wrapper {
    position: relative;
}

.currency-symbol {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 800;
    color: var(--accent);
    pointer-events: none;
}

/* Range Slider */
.range-wrapper {
    padding: 10px 0;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
}

input[type=range]:focus {
    outline: none;
    box-shadow: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: var(--border-color);
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

input[type=range]::-webkit-slider-thumb {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--text-main);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: 3px solid var(--accent);
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 8px;
}

/* Calculator Totals */
.price-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.05);
    border-radius: 16px;
    padding: 16px 20px;
    margin: 24px 0 8px;
}

.price-label {
    font-size: 16px;
    font-weight: 600;
}

.total-price {
    font-size: 26px;
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent-glow);
}

.rate-tag {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    margin-bottom: 24px;
}

/* Primary Button */
.btn-primary {
    width: 100%;
    background: var(--btn-gradient);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 900;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    box-shadow: 0 8px 20px var(--accent-glow);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Quick Amounts */
.quick-amounts {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.quick-chip {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}
.quick-chip:hover, .quick-chip:active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.active {
    opacity: 1; visibility: visible;
}
.modal.bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 0; right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    border-radius: 24px 24px 0 0;
    padding: 24px;
    z-index: 11;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    max-height: 90vh;
    overflow-y: auto;
}
.modal.bottom-sheet.active {
    bottom: 0;
}
.modal-drag-handle {
    width: 40px; height: 4px;
    background: var(--border-color);
    border-radius: 4px;
    margin: 0 auto 16px;
}
.modal-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px;
}
.modal-header h3 { font-size: 20px; font-weight: 800; }
.back-btn {
    background: transparent; border: none;
    color: var(--text-main); font-size: 24px;
    cursor: pointer; padding: 4px;
    font-family: inherit;
}
.method-card {
    display: flex; align-items: center; gap: 16px;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-color);
    padding: 16px; border-radius: 16px;
    margin-bottom: 12px; cursor: pointer;
    transition: all 0.2s ease;
}
.method-card:hover, .method-card:active { border-color: var(--accent); background: rgba(59, 130, 246, 0.1); }
.method-icon { font-size: 32px; filter: drop-shadow(0 0 10px rgba(255,255,255,0.2)); }
.method-info h4 { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.method-info p { font-size: 13px; color: var(--text-muted); }

/* Gamepass & Roblox Plus Elements */
.user-preview {
    display: flex; align-items: center; gap: 16px;
    background: rgba(0,0,0,0.15);
    padding: 12px 16px; border-radius: 16px; margin-bottom: 20px;
}
.user-preview img { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--accent); }
.user-details h4 { font-size: 18px; font-weight: 800; }
.user-details p { font-size: 13px; color: var(--accent); font-weight: 600; }
.gp-instruction { margin-bottom: 24px; }
.gp-instruction p { font-size: 15px; }
.gp-instruction strong { color: var(--accent); }
.tax-box {
    background: rgba(59, 130, 246, 0.1); border: 1px solid var(--accent);
    padding: 16px; border-radius: 16px; margin: 16px 0; text-align: center;
}
.tax-box span { font-size: 13px; color: var(--text-main); display: block; margin-bottom: 8px; }
.highlight-price { font-size: 32px; font-weight: 900; color: var(--accent); }
.small-text { font-size: 12px; color: var(--text-muted); text-align: center; display: block; }
