/*==============================
=            THEME            =
==============================*/
:root {
    --bg-color: #0A192F;
    --primary-color: #64FFDA;
    --accent-color: #BB86FC;
    --warning-color: #FF6584;
    --text-color: #FFFFFF;
    --glass-bg: linear-gradient(135deg, rgba(187, 134, 252, 0.08), rgba(10, 25, 47, 0.4));
    --glass-border: rgba(100, 255, 218, 0.2);
}

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

body {
    background-color: var(--bg-color);
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    overflow-x: hidden;
}

main {
    position: relative;
    z-index: 2;
}

/*==================================
=            BACKGROUND            =
==================================*/
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.background-shapes span {
    position: absolute;
    display: block;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.05;
    filter: blur(3px);
    animation: move-shape 20s linear infinite;
}

@keyframes move-shape {
    0% { transform: translate(var(--x-start), var(--y-start)) rotate(0deg); }
    100% { transform: translate(var(--x-end), var(--y-end)) rotate(360deg); }
}

.background-shapes span:nth-child(1) { --x-start: 10vw; --y-start: 120vh; --x-end: 90vw; --y-end: -20vh; width: 40px; height: 40px; animation-duration: 25s; }
.background-shapes span:nth-child(2) { --x-start: 80vw; --y-start: 110vh; --x-end: 5vw; --y-end: -30vh; width: 15px; height: 15px; animation-duration: 35s; }
.background-shapes span:nth-child(3) { --x-start: 50vw; --y-start: 130vh; --x-end: 50vw; --y-end: -10vh; width: 25px; height: 25px; animation-duration: 20s; }
.background-shapes span:nth-child(4) { --x-start: 30vw; --y-start: -30vh; --x-end: 70vw; --y-end: 120vh; width: 50px; height: 50px; animation-duration: 40s; }
.background-shapes span:nth-child(5) { --x-start: 5vw; --y-start: 50vh; --x-end: 100vw; --y-end: 50vh; width: 20px; height: 20px; animation-duration: 15s; }

/*==============================
=            LOADER            =
==============================*/
#loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 6px solid rgba(10, 25, 47, 0.5);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 100;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/*==============================
=            HEADER            =
==============================*/
#main-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(10, 25, 47, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--glass-border);
}
.logo { font-family: 'Honk', system-ui; font-size: 3rem; font-weight: 700; color: var(--primary-color); text-shadow: 0 0 1px var(--primary-color), 0 0 3px var(--accent-color); filter: brightness(0.9) opacity(0.9); }
#main-header nav { display: flex; gap: 2rem; }
#main-header nav a { color: var(--text-color); text-decoration: none; transition: color 0.3s, transform 0.3s; }
#main-header nav a:hover { color: var(--primary-color); transform: scale(1.1); }

/*==============================
=        HERO & SHOW           =
==============================*/
#hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 450px;
    padding: 2rem;
    background: transparent;
    border: none;
    box-shadow: none;
}

.neural-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 350px;
    font-family: 'Bilbo', cursive;
    font-weight: 400;
}

.effects-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
}

/* --- Initial States --- */
.slogan-line {
    position: absolute;
    margin: 0;
    opacity: 0; /* Hidden by default */
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-color), 0 0 15px rgba(100, 255, 218, 0.5);
    white-space: nowrap;
    transition: opacity 1s ease-in-out;
}

/* Line 1 is now positioned higher to overlap the monitor */
.line-1 { top: 7%; left: 45%; transform: translateX(-50%); font-size: 5rem; z-index: 1; }
.line-2 { top: 35%; left: 10%; font-size: 5.25rem; }
.line-3 { top: 65%; left: 60%; transform: translateX(-50%); font-size: 4.2rem; }
.line-4 { top: 90%; left: 60%; transform: translateX(-50%); font-size: 5.2rem; }

/* --- Monitor Effect (Now bigger) --- */
.monitor-effect {
    position: absolute;
    top: 15%; /* Adjusted for new size */
    left: 2.5%; /* (100% - 95%) / 2 */
    width: 95%; /* Permanently bigger */
    height: 95%; /* Permanently bigger */
    opacity: 0; /* Start hidden */
    pointer-events: auto;
    z-index: -1;
    /* No transform for scaling */
}

.monitor {
    width: 100%;
    height: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 0.8rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}

.monitor .screen {
    width: 100%;
    flex-grow: 1;
    background: #0A192F;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
}

.monitor .screen ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 400%; /* 4 screens */
    animation: slide-status 4s ease-in-out infinite; /* Slower slides */
}

.monitor .screen li {
    width: 100%;
    height: 25%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    font-family: 'Orbitron', sans-serif;
}

.status-buying { background-color: rgba(50, 205, 50, 0.1); color: #32CD32; }
.status-selling { background-color: rgba(255, 101, 132, 0.1); color: #FF6584; }
.status-timeout { background-color: rgba(255, 165, 0, 0.1); color: #FFA500; }
.status-waiting { background-color: rgba(255, 255, 0, 0.1); color: #FFFF00; }

@keyframes slide-status {
    0%, 24% { transform: translateY(0%); }      /* Screen 1 */
    25%, 49% { transform: translateY(-25%); }   /* Screen 2 */
    50%, 74% { transform: translateY(-50%); }   /* Screen 3 */
    75%, 100% { transform: translateY(-75%); }  /* Screen 4 */
}

/* --- Other Effects --- */
.globe-effect, .particle-container {
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.globe-effect {
    position: absolute;
    top: 60%; left: 65%;
    width: 150px; height: 150px;
    transform: translate(-50%, -50%);
    z-index: 2; /* In front of particles */
}

.globe-effect .globe {
    width: 100%; height: 100%; border-radius: 50%;
    background-image: url('https://i.postimg.cc/9QCCCVsQ/earth.png');
    background-repeat: repeat-x; background-size: cover;
    animation: earth-rotation 20s linear infinite;
    box-shadow: 0 0 20px -5px var(--primary-color), inset 0 0 30px -5px var(--primary-color);
}

.particle-container {
    position: absolute;
    top: 100%; /* Adjusted a few pixels down */
    left: 80%; /* Adjusted a few pixels right */
    transform: translate(-50%, -50%); /* Match globe for perfect centering */
    width: 300px; height: 300px; /* Make container bigger to surround globe */
}
.particle-container i {
    position: absolute; width: 4px; height: 4px;
    background: var(--primary-color); border-radius: 50%;
    opacity: 0;
}
.particle-container.visible i { animation: particle-burst 1.5s ease-out forwards; }

/* --- Animation Control Classes & Keyframes --- */
.visible { opacity: 1 !important; }

.line-4.visible { animation: glitch-in 0.3s forwards, final-glow 2s 0.3s infinite; }
.line-4.visible::before, .line-4.visible::after {
    content: 'For Traders';
    position: absolute; top: 0; left: 0;
    background: transparent; overflow: hidden;
    opacity: 0;
    animation: glitch-anim 0.8s steps(2, end) forwards;
}
.line-4.visible::before { color: var(--accent-color); text-shadow: -2px 0 var(--primary-color); }
.line-4.visible::after { color: var(--primary-color); text-shadow: 2px 0 var(--accent-color); animation-direction: reverse; }

/* New, simple fade keyframes for the monitor */
@keyframes monitor-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes monitor-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}


@keyframes fade-slide-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes glitch-in { to { opacity: 1; } }
@keyframes glitch-anim { 0% { clip-path: inset(50% 0 50% 0); opacity: 1; } 100% { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes final-glow { 0%, 100% { text-shadow: 0 0 8px var(--primary-color), 0 0 20px var(--primary-color); } 50% { text-shadow: 0 0 12px var(--primary-color), 0 0 30px var(--primary-color); } }
@keyframes earth-rotation { from { background-position: 0 0; } to { background-position: -199% 0; } }
@keyframes particle-burst { 0% { opacity: 0.8; transform: scale(0.5) translate(0,0); } 100% { opacity: 0; transform: scale(1.5) translate(var(--x), var(--y)); } }

/* Particle positions */
.particle-container i:nth-child(1) { --x: -80px; --y: -60px; } .particle-container i:nth-child(2) { --x: 80px; --y: -70px; } .particle-container i:nth-child(3) { --x: -60px; --y: 70px; } .particle-container i:nth-child(4) { --x: 70px; --y: 50px; } .particle-container i:nth-child(5) { --x: -120px; --y: 0px; } .particle-container i:nth-child(6) { --x: 130px; --y: -20px; } .particle-container i:nth-child(7) { --x: -20px; --y: 100px; } .particle-container i:nth-child(8) { --x: 40px; --y: -90px; } .particle-container i:nth-child(9) { --x: -100px; --y: -40px; } .particle-container i:nth-child(10) { --x: 100px; --y: 60px; } .particle-container i:nth-child(11) { --x: -70px; --y: -80px; } .particle-container i:nth-child(12) { --x: 90px; --y: -90px; } .particle-container i:nth-child(13) { --x: -40px; --y: 110px; } .particle-container i:nth-child(14) { --x: 50px; --y: 90px; } .particle-container i:nth-child(15) { --x: -110px; --y: -30px; } .particle-container i:nth-child(16) { --x: 140px; --y: 10px; } .particle-container i:nth-child(17) { --x: 10px; --y: 120px; } .particle-container i:nth-child(18) { --x: 20px; --y: -100px; } .particle-container i:nth-child(19) { --x: -110px; --y: 20px; } .particle-container i:nth-child(20) { --x: 120px; --y: 80px; }

/*==============================
=        MAIN SECTIONS         =
==============================*/
.section-title {
    text-align: left;
    font-weight: 700;
    font-size: 2rem; /* Larger than card-title */
    margin-bottom: 2rem;
    color: var(--text-color);
}

#live-section, #historical-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    opacity: 0; /* Hidden by default for animation */
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

/*==============================
=             CARD             =
==============================*/
.card { background: var(--glass-bg); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); border: 1px solid var(--glass-border); border-radius: 1rem; box-shadow: 0 20px 30px rgba(0, 0, 0, 0.2); transition: all 400ms ease; padding: 2rem; }
.card:hover { transform: translateY(-5px); box-shadow: 0 25px 35px rgba(0, 0, 0, 0.3); border-color: rgba(100, 255, 218, 0.4); }
.inner-card { background: transparent; border: none; box-shadow: none; padding: 0; }
.card-title { text-align: center; font-weight: 700; font-size: 1.5rem; margin-bottom: 1.5rem; color: var(--text-color); }

/*==============================
=           INSIGHT            =
==============================*/
#live-section .card { padding: 0; }
#insight { padding: 1.5rem; border-bottom: 1px solid var(--glass-border); }
.insight-header { display: flex; justify-content: flex-start; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.insight-header .fa-robot { font-size: 2.5rem; color: var(--primary-color); }
#insight-text {
    font-size: 1.3rem;
    flex-grow: 1;
    color: var(--text-color);
    min-height: 150px;
    padding: 1rem;
}
#insight-timestamp { font-size: 0.9rem; font-family: 'Roboto Mono', monospace; color: #c0c0c0; }
.timestamp-updated { animation: flash 0.7s ease-out; }
@keyframes flash { 0% { text-shadow: 0 0 12px var(--primary-color), 0 0 22px var(--primary-color); } 100% { text-shadow: none; } }

/*==============================
=             TIMER            =
==============================*/
.timer-container { text-align: center; margin-left: auto; opacity: 0; transition: opacity 0.5s; }
.timer-label { font-size: 0.8rem; color: #c0c0c0; margin-bottom: 0.5rem; }
.timer { position: relative; width: 70px; height: 70px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at center, var(--accent-color) 50%, var(--primary-color) 85%); animation: pulse 2s infinite ease-in-out; }
.timer::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%; background: conic-gradient(transparent var(--progress, 0%), var(--bg-color) 0); transform: rotate(-90deg); }
.timer::before { content: ''; position: absolute; width: 85%; height: 85%; background: var(--bg-color); border-radius: 50%; z-index: 1; }
.timer span { position: relative; font-size: 1.3rem; font-weight: 700; color: var(--text-color); z-index: 2; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/*==============================
=             TABLE            =
==============================*/
.table-responsive { max-height: 400px; overflow-y: auto; border-radius: 0.5rem; }
#trades-table { width: 100%; border-collapse: collapse; }
#trades-table th, #trades-table td { padding: 15px; background-color: transparent; color: var(--text-color); transition: background-color 400ms; }
#trades-table thead th { background-color: rgba(10, 25, 47, 0.8); position: sticky; top: 0; z-index: 1; }
#trades-table tbody tr:hover { background-color: rgba(100, 255, 218, 0.1); }

/*==============================
=            FOOTER            =
==============================*/
footer { padding: 2rem 1rem; text-align: center; color: var(--text-color); font-size: 0.9rem; position: relative; z-index: 2; }
footer a { color: var(--primary-color); text-decoration: none; cursor: pointer; }

/*==============================
=         RESPONSIVE         =
==============================*/
@media (max-width: 768px) {
    body {
        overflow-x: clip;
        -webkit-overflow-scrolling: touch; /* Smoother scrolling on iOS */
    }

    main {
        position: relative; /* Establish stacking context */
        z-index: 2;
    }

    #main-header { flex-direction: column; gap: 1rem; }
    #hero h1 { font-size: 2.5rem; }
    #live-section, #historical-section { padding: 1rem; }
    
    .neural-container { height: 400px; }
    .slogan-line { left: 50%; transform: translateX(-50%); text-align: center; }
    .line-1 { top: 5%; font-size: 2.5rem; }
    .line-2 { top: 30%; font-size: 3rem; }
    .line-3 { top: 50%; font-size: 2.2rem; }
    .line-4 { top: 70%; font-size: 3rem; }

    .monitor-effect { top: 20%; height: 70%; }
    .monitor .screen li { font-size: 1.8rem; }

    /* .particle-container { display: none; } */ /* Re-enabled for the show */
    .particle-container {
        left: 97%; /* Nudge to the right on mobile */
			top: 100%;
    }

    /* --- FINAL MOBILE FIXES --- */
    /* Make charts taller for better readability */
    #chart1-container,
    #chart2-container {
        min-height: 45vh; /* 45% of the viewport height */
    }
}
/*==============================
=         NOTIFICATION         =
==============================*/
.notification {
    position: fixed;
    top: 100px; /* Below the header */
    left: 50%;
    transform: translateX(-50%);
    padding: 0.8rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    color: var(--primary-color);
    font-size: 1rem;
    opacity: 0;
    animation: fade-in-out 4s ease-in-out forwards;
}

/*==============================
=             MODAL            =
==============================*/
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 47, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    visibility: hidden; /* Add visibility */
    transition: opacity 0.3s ease-in-out, visibility 0.3s; /* Transition both */
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible; /* Add visibility */
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    padding: 3rem;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease-in-out;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
}

.modal-close:hover {
    color: var(--warning-color);
    transform: rotate(90deg);
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-content h3 {
    color: var(--accent-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.modal-content p, .modal-content li {
    color: var(--text-color);
    line-height: 1.7;
}

.modal-content ul {
    list-style-position: inside;
    padding-left: 1rem;
}

.modal-content strong {
    color: var(--primary-color);
    font-weight: 700;
}

/*==============================
=        COOKIE BANNER         =
==============================*/
#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    padding: 0.5rem 1rem; /* Keep the smallest padding */
    display: flex;
    justify-content: space-between; /* Revert to space-between */
    align-items: center;
    /* Robust hiding mechanism */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(100%);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out, visibility 0.5s;
}

#cookie-consent-banner.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

#cookie-consent-banner p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.75rem; /* Keep the smallest font */
    flex-grow: 1;
}

#cookie-consent-banner .cookie-buttons {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem; /* Restore left margin */
}

#cookie-consent-banner button {
    background: var(--primary-color);
    color: var(--bg-color);
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s, transform 0.3s;
}

#cookie-consent-banner button:hover {
    transform: scale(1.05);
}

#cookie-consent-banner #cookie-decline-btn {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--glass-border);
}

@keyframes flash-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(100, 255, 218, 0.5); }
  50% { box-shadow: 0 0 20px rgba(100, 255, 218, 1), 0 0 30px rgba(100, 255, 218, 0.8); }
}

#cookie-consent-banner button.flashing {
  animation: flash-glow 0.7s ease-out;
}

@keyframes fade-in-out {
    0% { opacity: 0; top: 80px; }
    20% { opacity: 1; top: 100px; }
    80% { opacity: 1; top: 100px; }
    100% { opacity: 0; top: 80px; }
}

/*==============================
=      MOBILE UX FIXES         =
==============================*/

.mobile-logo {
    display: none; /* Hidden by default on desktop */
    height: 40px;  /* Control the height of the mobile logo */
    width: auto;   /* Maintain aspect ratio */
}

@media (max-width: 768px) {
    /* Fix scrolling issue by allowing pointer events to pass through overlays */
    .background-shapes,
    .effects-layer {
        pointer-events: none;
    }

    /* Logo swapping logic */
    .desktop-logo {
        display: none; /* Hide text logo on mobile */
    }

    .mobile-logo {
        display: block; /* Show image logo on mobile */
    }
}
