/* style.css */

/* === IMPORTS === */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

:root {
    --primary: #3b82f6;
    --dark: #0f172a;
    --light: #f1f5f9;
    --white: #ffffff;
    --green: #10b981;
    --green-bg: #ecfdf5;
    --green-border: #6ee7b7;
    --red: #ef4444;
    --red-bg: #fef2f2;
    --red-border: #fca5a5;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --nav-height: 70px;
}

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

body {
    background: var(--light);
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    padding-top: var(--nav-height);
    -webkit-tap-highlight-color: transparent;
    display: flex; flex-direction: column; min-height: 100vh;
}

/* --- NAVIGATION --- */
.navbar {
    background: var(--white);
    height: var(--nav-height);
    display: flex; justify-content: center; align-items: center;
    position: fixed; top: 0; width: 100%; z-index: 1000;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.nav-container {
    display: flex; justify-content: space-between;
    align-items: center;
    width: 100%; max-width: 1200px; padding: 0 20px;
}

.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 18px; color: var(--dark); }
.logo img { width: 28px; height: 28px; }
.highlight { color: var(--primary); }

.nav-menu { display: flex; align-items: center; gap: 25px; list-style: none; }
.nav-link { text-decoration: none; color: #64748b; font-weight: 600; font-size: 14px; transition: 0.2s; }
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-btn { padding: 8px 18px; background: var(--dark); color: white; border-radius: 50px; text-decoration: none; font-size: 13px; font-weight: 600; transition: transform 0.2s; }
.nav-btn:hover { transform: translateY(-1px); }

/* Mobile Menu Toggle */
.menu-toggle { display: none; cursor: pointer; padding: 10px; z-index: 1001; }
.bar { display: block; width: 24px; height: 2.5px; margin: 5px auto; background: var(--dark); transition: 0.3s; border-radius: 2px; }

/* --- HERO --- */
.hero { text-align: center; padding: 40px 15px 25px; }
h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.8px; margin-bottom: 10px; color: var(--dark); }
.sub-text { color: #64748b; font-size: 15px; margin-bottom: 25px; }

.controls { display: flex; justify-content: center; gap: 12px; margin-bottom: 15px; flex-wrap: wrap; }
.btn {
    padding: 10px 22px; border: none; border-radius: 12px;
    font-weight: 600; color: white; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); font-size: 14px;
    display: flex; align-items: center; gap: 8px; transition: transform 0.2s;
}
.btn:active { transform: scale(0.96); }
.btn-gainers { background: var(--green); }
.btn-losers { background: var(--red); }

/* --- MARKET GRID --- */
.market-section { padding: 10px; margin-bottom: 30px; }
.section-header { text-align: center; margin-bottom: 25px; }
h2 { font-size: 20px; display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }

.container {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 15px; max-width: 1200px; margin: 0 auto;
}

/* --- BUBBLE DESIGN --- */
.bubble {
    width: 130px; height: 130px;
    background: var(--white);
    border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 8px 16px -4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    border: 3px solid transparent;
    position: relative;
    z-index: 1;
}

#gainers-wrapper .bubble, .bubble.force-gainer { background: var(--green-bg); border-color: var(--green-border); }
#losers-wrapper .bubble, .bubble.force-loser { background: var(--red-bg); border-color: var(--red-border); }
.bubble:hover { transform: translateY(-5px); z-index: 10; }

.bubble img { width: 40px; height: 40px; border-radius: 50%; margin-bottom: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.symbol { font-weight: 800; color: var(--dark); font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
.percent { font-weight: 700; font-size: 13px; }
.gainer-percent { color: #15803d; }
.loser-percent { color: #b91c1c; }

/* --- FOOTER --- */
footer { margin-top: auto; background: var(--dark); color: #94a3b8; padding: 50px 20px 30px; text-align: center; }
.footer-content { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.footer-logo { font-weight: 800; font-size: 20px; color: var(--white); margin-bottom: 15px; display: flex; align-items: center; gap: 8px; }
.footer-logo img { width: 24px; }
.copyright { font-size: 12px; margin-top: 30px; opacity: 0.6; border-top: 1px solid #334155; padding-top: 20px; width: 100%; }

/* --- MOBILE & LOADER --- */
@media (max-width: 768px) {
    .menu-toggle { display: block; margin-left: auto; }
    .nav-menu { position: fixed; left: 0; top: var(--nav-height); flex-direction: column; background: var(--white); width: 100%; height: 0; overflow: hidden; transition: height 0.3s ease; box-shadow: 0 10px 20px rgba(0,0,0,0.05); padding: 0; gap: 0; }
    .nav-menu.active { height: auto; padding-bottom: 20px; border-bottom: 1px solid #eee; }
    .nav-item { width: 100%; text-align: center; }
    .nav-link { display: block; padding: 15px; border-bottom: 1px solid #f8fafc; font-size: 16px; }
    
    .menu-toggle.active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .container { gap: 10px; padding: 0 10px; }
    .bubble { width: 95px; height: 95px; border-width: 2px; }
    .bubble img { width: 30px; height: 30px; }
}

#loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--white); z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.spinner { width: 40px; height: 40px; border: 4px solid #e2e8f0; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 15px; }
@keyframes spin { to { transform: rotate(360deg); } }

.select-wrapper { position: relative; display: inline-block; }
.btn-sort { background: #475569; color: white; appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 10px; cursor: pointer; }

/* Paste this at the bottom of dexmovers-main/style.css */

/* === MODAL STYLES === */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}

.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-content {
    background: white; width: 90%; max-width: 400px;
    border-radius: 24px; padding: 25px;
    position: relative;
    transform: translateY(20px); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.active .modal-content { transform: translateY(0); }

.close-modal {
    position: absolute; top: 15px; right: 20px;
    background: none; border: none; font-size: 28px; color: #94a3b8; cursor: pointer;
}

.modal-header { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; }
.modal-header img { width: 48px; height: 48px; border-radius: 50%; }
.modal-header h2 { font-size: 20px; margin: 0; color: #0f172a; }
.modal-header span { font-size: 14px; color: #64748b; font-weight: 600; }
.modal-price { margin-left: auto; font-size: 20px; font-weight: 800; color: #0f172a; }

.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.stat-box { background: #f8fafc; padding: 12px; border-radius: 12px; text-align: center; }
.stat-box .label { display: block; font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.stat-box .value { font-weight: 700; color: #334155; font-size: 14px; }

.modal-history { margin-bottom: 25px; }
.modal-history h3 { font-size: 13px; color: #94a3b8; margin-bottom: 10px; font-weight: 600; text-transform: uppercase; }
.history-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.history-row:last-child { border: none; }

.percent-tag { font-weight: 700; }
.percent-tag.green { color: #16a34a; }
.percent-tag.red { color: #dc2626; }
.percent-tag.gray { color: #94a3b8; }

.modal-actions { display: flex; gap: 10px; }
.action-btn { flex: 1; padding: 12px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 14px; transition: transform 0.2s; }
.action-btn:hover { transform: translateY(-2px); filter: brightness(110%); }
.cg-btn { background: #8CC542; box-shadow: 0 4px 10px rgba(140, 197, 66, 0.3); color: #0f172a; }
.tv-btn { background: #0f172a; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); color: white; }

/* Fix for GIF Logo Flickering */
.bubble img { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    margin-bottom: 6px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    
    /* New Stability Rules */
    object-fit: cover; /* Ensures aspect ratio stays solid */
    will-change: transform; /* Hints browser to optimize rendering */
    transform: translateZ(0); /* Forces GPU layer */
}