/* ===== ROOT VARIABLES ===== */
:root {
    --bg-main: #080c14;
    --bg-card: #0f1520;
    --bg-card-alt: #131b28;
    --bg-nav: #0d1320;
    --text-white: #ffffff;
    --text-muted: #8c9fbe;
    --text-dim: #4a5a72;
    --accent-gold: #f4c23c;
    --accent-orange: #f0a020;
    --green: #00bfa6;
    --green-bg: rgba(0, 191, 166, 0.15);
    --red: #ff4d4f;
    --red-bg: rgba(255, 77, 79, 0.15);
    --cyan-glow: #5ce0d8;
    --purple-glow: #b87fff;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    background: #000;
    color: var(--text-white);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===== LOADER ===== */
#loader {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #0f1720;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.4s ease;
}
#loader.fade-out {
    opacity: 0;
    pointer-events: none;
}
#loader img {
    max-width: 200px;
    height: auto;
}

/* ===== REVERIFICATION POPUP ===== */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}
.popup-overlay.hide {
    opacity: 0;
    visibility: hidden;
}

.popup-card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(160deg, #131b2e 0%, #0d1420 40%, #0a1018 100%);
    border: 1px solid rgba(244, 194, 60, 0.12);
    border-radius: 20px;
    padding: 30px 24px 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(244, 194, 60, 0.04);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.popup-overlay.show .popup-card {
    transform: scale(1) translateY(0);
}

.popup-header {
    text-align: center;
    margin-bottom: 24px;
}
.popup-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(244, 194, 60, 0.15), rgba(244, 194, 60, 0.05));
    border: 1px solid rgba(244, 194, 60, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 14px;
    font-size: 24px;
    color: var(--accent-gold);
}
.popup-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 6px;
}
.popup-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.popup-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.form-group label i {
    color: var(--accent-gold);
    font-size: 13px;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 13px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-white);
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c9fbe' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px;
    padding-right: 40px;
}
.form-group select option {
    background: var(--bg-card);
    color: var(--text-white);
}
.form-group input::placeholder, .form-group select:invalid {
    color: var(--text-dim);
}
.form-group input:focus, .form-group select:focus {
    border-color: rgba(244, 194, 60, 0.5);
    background: rgba(244, 194, 60, 0.04);
    box-shadow: 0 0 0 3px rgba(244, 194, 60, 0.08);
}

.verify-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #f4c23c 0%, #e8a820 50%, #d4941a 100%);
    color: #0a0e16;
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(244, 194, 60, 0.25);
}
.verify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(244, 194, 60, 0.35);
}
.verify-btn:active {
    transform: translateY(0);
}
.verify-btn i {
    font-size: 18px;
}
.verify-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}
.verify-btn.loading span {
    display: none;
}
.verify-btn.loading::after {
    content: 'Processing...';
    animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.switch-btn {
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(244, 194, 60, 0.3);
    border-radius: 12px;
    background: rgba(244, 194, 60, 0.05);
    color: var(--accent-gold);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    transition: all 0.2s;
}
.switch-btn:hover {
    background: rgba(244, 194, 60, 0.1);
    border-color: rgba(244, 194, 60, 0.5);
}
.switch-btn:active {
    transform: translateY(2px);
}

.popup-footer-text {
    text-align: center;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.popup-footer-text i {
    font-size: 10px;
    color: var(--green);
}

/* ===== AMBIENT BACKGROUND ===== */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse 600px 400px at 50% 20%, rgba(30, 80, 180, 0.12) 0%, transparent 70%),
                radial-gradient(ellipse 400px 300px at 30% 40%, rgba(60, 40, 150, 0.08) 0%, transparent 60%),
                radial-gradient(ellipse 400px 300px at 70% 30%, rgba(20, 100, 200, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

/* ===== APP CONTAINER ===== */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-main);
    padding-bottom: 75px;
    overflow-x: hidden;
    box-shadow: 0 0 80px rgba(30, 80, 200, 0.08);
}

/* ===== HEADER ===== */
.header {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
}
.header-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}
.header-icon:hover { background: rgba(255,255,255,0.15); }

/* ===== CAROUSEL (FIXED) ===== */
.carousel-section {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
}
.carousel-track {
    display: flex;
    width: 600%; /* 6 slides x 100% */
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
.slide {
    width: calc(100% / 6); /* Each slide = 1/6 of track */
    height: 100%;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.slide-inner {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 55px 18px 20px;
    position: relative;
}
.slide-text-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
}
.slide-text-block.full-width { flex: 1.5; }

.slide-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.3;
}
.glow-cyan {
    color: var(--cyan-glow);
    text-shadow: 0 0 20px rgba(92, 224, 216, 0.4);
}
.glow-purple {
    color: var(--purple-glow);
    text-shadow: 0 0 20px rgba(184, 127, 255, 0.4);
}
.outline-text {
    color: #fff;
    text-shadow: 0 0 8px rgba(100, 140, 255, 0.5);
    text-align: center;
    font-size: 18px;
}
.centered { text-align: center; }

.slide-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 10px;
}
.slide-subtitle.bold { font-weight: 600; }

.slide-badge {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    max-width: fit-content;
}
.cyan-badge {
    background: linear-gradient(135deg, rgba(92, 224, 216, 0.3), rgba(60, 180, 200, 0.2));
    color: #fff;
}
.red-badge {
    background: linear-gradient(135deg, rgba(255, 80, 80, 0.4), rgba(200, 50, 80, 0.3));
    color: #fff;
}
.gray-badge {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
}

.stats-badges {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.stat-badge {
    background: linear-gradient(135deg, rgba(40, 80, 120, 0.6), rgba(30, 70, 100, 0.4));
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 10px;
    color: #fff;
    font-weight: 500;
}
.highlight-yellow {
    color: var(--accent-gold);
    font-weight: 700;
}

.slide-graphic {
    flex: 0 0 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}
.btc-3d {
    font-size: 70px;
    color: #f7a600;
    text-shadow: 0 4px 30px rgba(247, 166, 0, 0.5), 0 0 60px rgba(247, 166, 0, 0.2);
    font-weight: 800;
    animation: float 3s ease-in-out infinite;
}
.btc-3d.small { font-size: 50px; }
.btc-3d.tiny { font-size: 35px; }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.dsj-label {
    font-size: 10px;
    color: rgba(255,255,255,0.6);
    text-align: center;
    font-weight: 700;
    letter-spacing: 1px;
}
.dsj-label.small { font-size: 8px; }

.rocket-icon { font-size: 50px; animation: float 2.5s ease-in-out infinite; }
.shield-icon { font-size: 50px; }
.robot-icon { font-size: 55px; animation: float 3s ease-in-out infinite; }

/* Announcement slide specific */
.announcement-slide {
    flex-direction: column;
    align-items: center;
    padding-top: 45px !important;
    overflow-y: auto;
}
.announcement-badge {
    background: rgba(120, 80, 200, 0.35);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 10px;
    color: #fff;
    margin: 6px 0 8px;
    text-align: center;
}
.announcement-card {
    background: rgba(15, 25, 45, 0.8);
    border-radius: 10px;
    padding: 10px;
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
}
.announcement-intro { margin-bottom: 6px; }
.pillar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 6px;
}
.pillar {
    background: rgba(20, 35, 60, 0.8);
    padding: 6px;
    border-radius: 6px;
    font-size: 8px;
    line-height: 1.4;
}
.pillar strong { color: var(--text-white); font-size: 8.5px; }
.announcement-footer {
    text-align: right;
    font-size: 8px;
    color: var(--text-dim);
}

/* Slide Backgrounds */
.slide-1 { background: linear-gradient(135deg, #0b1628 0%, #142a44 50%, #1a3352 100%); }
.slide-2 { background: linear-gradient(135deg, #0b1628 0%, #0f2035 50%, #132840 100%); }
.slide-3 { background: linear-gradient(135deg, #0e0f20 0%, #1a1535 50%, #221a40 100%); }
.slide-4 { background: linear-gradient(135deg, #0d1025 0%, #15183a 50%, #1a1d45 100%); }
.slide-5 { background: linear-gradient(135deg, #0b1628 0%, #142a44 50%, #1a3352 100%); }
.slide-6 { background: linear-gradient(135deg, #0b1222 0%, #101e35 50%, #152840 100%); }

/* Carousel Dots */
.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}
.dot {
    width: 14px; height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.2);
    transition: all 0.3s;
    cursor: pointer;
}
.dot.active { background: var(--text-white); width: 18px; }

/* ===== ANNOUNCEMENT BAR ===== */
.announcement-bar {
    background: var(--bg-card-alt);
    padding: 10px 16px;
}
.announce-row-1 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.announce-icon {
    color: var(--accent-gold);
    font-size: 14px;
}
.announce-title {
    flex: 1;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}
.announce-arrow {
    color: var(--text-dim);
    font-size: 12px;
}
.announce-row-2 {
    overflow: hidden;
}
.marquee-wrapper {
    overflow: hidden;
    white-space: nowrap;
}
.marquee-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 18s linear infinite;
    font-size: 12px;
    color: var(--text-muted);
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 22px 10px 18px;
}
.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.action-item span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}
.action-circle {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.12);
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-gold);
    font-size: 18px;
    transition: all 0.25s;
}
.action-circle.filled {
    background: rgba(244, 194, 60, 0.12);
    border-color: rgba(244, 194, 60, 0.25);
}
.action-item:hover .action-circle {
    background: rgba(244, 194, 60, 0.1);
    border-color: rgba(244, 194, 60, 0.3);
    transform: scale(1.05);
}

/* ===== QUICK BUY BANNER ===== */
.quick-buy-banner {
    margin: 0 16px 20px;
    padding: 18px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f0a020 0%, #f8c146 60%, #ffb347 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}
.quick-buy-banner:hover { transform: scale(1.01); }
.quick-buy-banner::before {
    content: '';
    position: absolute;
    top: -30px; right: -20px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.quick-buy-banner::after {
    content: '';
    position: absolute;
    bottom: -20px; right: 40px;
    width: 60px; height: 60px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.buy-text h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 3px;
}
.buy-text p {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}
.buy-arrow-btn {
    width: 42px; height: 42px;
    border-radius: 50%;
    border: none;
    background: #ff6b35;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}
.buy-arrow-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
}

/* ===== MARKETS SECTION ===== */
.markets-section {
    padding: 0 16px 20px;
}

/* Tabs */
.market-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 12px;
}
.m-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}
.m-tab.active {
    color: var(--accent-gold);
    font-weight: 700;
}
.m-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px; height: 3px;
    border-radius: 2px;
    background: var(--accent-gold);
}

/* Market Header */
.market-header {
    display: flex;
    padding: 0 4px 10px;
    font-size: 12px;
    color: var(--text-dim);
}
.mh-pair { flex: 1.5; }
.mh-price { flex: 1; text-align: center; }
.mh-change { flex: 1; text-align: right; }

/* Market List */
.market-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.market-row {
    display: flex;
    align-items: center;
    padding: 12px 4px;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    transition: background 0.2s;
}
.market-row:hover { background: rgba(255,255,255,0.04); }

.mr-pair {
    flex: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
}
.coin-logo {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.pair-label { display: flex; align-items: baseline; gap: 3px; }
.pair-name { font-size: 15px; font-weight: 700; color: var(--text-white); }
.pair-base { font-size: 11px; color: var(--text-dim); }

.mr-price {
    flex: 1;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-white);
}

.mr-change {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}
.change-badge {
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    min-width: 80px;
    text-align: center;
    color: #fff;
}
.change-badge.up { background: var(--green); }
.change-badge.down { background: var(--red); }
.change-badge.neutral { background: rgba(255,255,255,0.08); color: var(--text-muted); }
.turnover-text {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    text-align: right;
    padding: 6px 0;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: var(--bg-nav);
    border-top: 1px solid rgba(255,255,255,0.04);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 18px;
    z-index: 100;
}
.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    padding: 2px 12px;
}
.nav-tab i { font-size: 20px; }
.nav-tab.active { color: var(--text-white); }
.nav-tab:hover { color: var(--text-muted); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 0; height: 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 500px) {
    .app-container { max-width: 100%; }
    .bottom-nav { max-width: 100%; }
}
