/* ========================================
   RESET & VARIABLES
   ======================================== */

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

:root {
    --color-bg: #000000;
    --color-long: #00ff88;
    --color-short: #ff0055;
    --color-text: #ffffff;
    --color-text-dim: #888888;
    --color-border: #222222;
    --font-primary: 'Inter', sans-serif;
    --font-display: 'Orbitron', monospace;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   MAIN LAYOUT
   ======================================== */

.main-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========================================
   COIN SECTION (TOP HALF)
   ======================================== */

.coin-section {
    flex: 0 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 40px 20px;
}

/* Countdown Display */
.countdown-display {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease-out;
}

.countdown-label {
    font-family: var(--font-display);
    font-size: 14px;
    letter-spacing: 4px;
    color: var(--color-text-dim);
    font-weight: 500;
    margin-bottom: 15px;
}

.countdown-timer {
    font-family: var(--font-display);
    font-size: 72px;
    font-weight: 900;
    color: var(--color-text);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    letter-spacing: 8px;
}

.countdown-subtitle {
    font-size: 13px;
    color: var(--color-text-dim);
    margin-top: 10px;
    letter-spacing: 2px;
}

/* Coin Wrapper */
.coin-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 1s ease-out 0.3s both;
}

/* Coin */
.coin {
    width: 350px;
    height: 350px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 2.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.coin:hover {
    transform: scale(1.05);
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 6px solid;
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.1),
                inset 0 0 40px rgba(255, 255, 255, 0.05);
    transition: box-shadow 0.3s ease;
}

.coin-long {
    background: radial-gradient(circle at 30% 30%, var(--color-long), #00aa55);
    border-color: var(--color-long);
    z-index: 2;
}

.coin-short {
    background: radial-gradient(circle at 30% 30%, var(--color-short), #aa0033);
    border-color: var(--color-short);
    transform: rotateY(180deg);
}

.coin-icon {
    font-size: 120px;
    margin-bottom: 20px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

.coin-label {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 8px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

/* Coin flip animations */
.coin.flipping {
    animation: coinFlipSpin 2.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.coin.flip-long {
    transform: rotateY(1800deg);
}

.coin.flip-short {
    transform: rotateY(1980deg);
}

@keyframes coinFlipSpin {
    0% {
        transform: rotateY(0deg) scale(1);
    }
    50% {
        transform: rotateY(900deg) scale(1.2);
    }
    100% {
        transform: rotateY(var(--final-rotation)) scale(1);
    }
}

/* Coin Glow */
.coin-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 70%);
    filter: blur(40px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.coin-glow.glow-long {
    background: radial-gradient(circle, var(--color-long), transparent 70%);
    opacity: 0.4;
}

.coin-glow.glow-short {
    background: radial-gradient(circle, var(--color-short), transparent 70%);
    opacity: 0.4;
}

/* Connection Status */
.connection-status {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 12px;
    letter-spacing: 1px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-dim);
    animation: pulse 2s infinite;
}

.connection-status.connected .status-dot {
    background: var(--color-long);
}

.connection-status.disconnected .status-dot {
    background: var(--color-short);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ========================================
   DATA SECTION (BOTTOM HALF)
   ======================================== */

.data-section {
    flex: 1;
    padding: 60px 40px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Data Cards */
.data-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.data-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: #333333;
}

.card-header h2 {
    font-family: var(--font-display);
    font-size: 16px;
    letter-spacing: 3px;
    color: var(--color-text-dim);
    margin-bottom: 25px;
    font-weight: 700;
}

/* Position Card */
.position-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 25px;
}

.position-item {
    text-align: center;
}

.position-label {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--color-text-dim);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.position-value {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
}

.position-status {
    color: var(--color-text-dim);
}

.position-side-long {
    color: var(--color-long) !important;
    text-shadow: 0 0 20px var(--color-long);
}

.position-side-short {
    color: var(--color-short) !important;
    text-shadow: 0 0 20px var(--color-short);
}

.position-pnl.positive {
    color: var(--color-long);
}

.position-pnl.negative {
    color: var(--color-short);
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--color-text-dim);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 900;
    color: var(--color-text);
}

.stat-value.positive {
    color: var(--color-long);
}

.stat-value.negative {
    color: var(--color-short);
}

.stat-best {
    color: var(--color-long);
}

/* Table */
.table-wrapper {
    overflow-x: auto;
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
}

.trades-table thead th {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-text-dim);
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.trades-table tbody td {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 14px;
}

.trades-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.trades-table tbody tr:last-child td {
    border-bottom: none;
}

.no-data {
    text-align: center !important;
    color: var(--color-text-dim) !important;
    padding: 40px !important;
}

/* Table badges */
.side-long {
    color: var(--color-long);
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 2px;
}

.side-short {
    color: var(--color-short);
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 2px;
}

.pnl-positive {
    color: var(--color-long);
    font-weight: 700;
}

.pnl-negative {
    color: var(--color-short);
    font-weight: 700;
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px 30px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(20px);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    max-width: 350px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    border-color: var(--color-long);
    color: var(--color-long);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.2);
}

.toast.error {
    border-color: var(--color-short);
    color: var(--color-short);
    box-shadow: 0 0 30px rgba(255, 0, 85, 0.2);
}

.toast.info {
    border-color: #00aaff;
    color: #00aaff;
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.2);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .countdown-timer {
        font-size: 48px;
    }
    
    .coin-wrapper {
        width: 300px;
        height: 300px;
    }
    
    .coin {
        width: 280px;
        height: 280px;
    }
    
    .coin-icon {
        font-size: 80px;
    }
    
    .coin-label {
        font-size: 32px;
    }
    
    .data-section {
        padding: 40px 20px;
    }
    
    .position-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .connection-status {
        top: 20px;
        right: 20px;
        font-size: 10px;
    }
    
    .trades-table {
        font-size: 12px;
    }
    
    .trades-table thead th,
    .trades-table tbody td {
        padding: 12px 10px;
    }
}

@media (max-width: 480px) {
    .countdown-timer {
        font-size: 36px;
    }
    
    .coin-wrapper {
        width: 240px;
        height: 240px;
    }
    
    .coin {
        width: 220px;
        height: 220px;
    }
    
    .coin-icon {
        font-size: 60px;
    }
    
    .coin-label {
        font-size: 24px;
    }
    
    .position-value {
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 24px;
    }
}
/* ========================================
   X LOGO (SOCIAL LINK)
   ======================================== */

.x-logo {
    position: fixed;
    top: 30px;
    left: 30px;
    width: 40px;
    height: 40px;
    color: var(--color-text-dim);
    transition: all 0.3s ease;
    opacity: 0.6;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.x-logo:hover {
    color: var(--color-long);
    opacity: 1;
    transform: scale(1.15);
}

.x-logo svg {
    width: 100%;
    height: 100%;
}

/* Responsive X Logo */
@media (max-width: 768px) {
    .x-logo {
        width: 32px;
        height: 32px;
        top: 20px;
        left: 20px;
    }
}

@media (max-width: 480px) {
    .x-logo {
        width: 28px;
        height: 28px;
        top: 15px;
        left: 15px;
    }
}
