:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #64748b;
    --secondary-hover: #475569;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: rgba(51, 65, 85, 0.5);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --radius-lg: 12px;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at top left, #1e293b, #0f172a);
    color: var(--text-primary);
    min-height: 100vh;
}

.dark-theme {
    background-color: var(--bg-dark);
}

.glass-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo h1 span {
    color: var(--primary);
}

.icon-logo {
    color: var(--primary);
    width: 32px;
    height: 32px;
}

.badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.badge.connecting { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid var(--warning); }
.badge.connected { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid var(--success); }
.badge.disconnected { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid var(--danger); }

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: blink 2s infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.status-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s;
}

.status-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header i { color: var(--primary); }
.card-header h3 { font-size: 1.1rem; margin: 0; color: var(--text-secondary); }

.card-content p { font-size: 1.5rem; font-weight: 700; margin: 0.5rem 0 0.25rem; }
.card-content small { color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn.primary { background: var(--primary); color: white; width: 100%; }
.btn.primary:hover { background: var(--primary-hover); }

.btn.secondary { background: var(--secondary); color: white; width: 100%; }
.btn.secondary:hover { background: var(--secondary-hover); }

.watchlist-section { margin-top: 2rem; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.section-header h2 { font-size: 1.5rem; margin: 0; position: relative; }
.section-header h2::after { content: ''; position: absolute; bottom: -8px; left: 0; width: 40px; height: 3px; background: var(--primary); }

.watchlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.tick-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.price-info { text-align: right; }
.price-info .price { font-size: 1.25rem; font-weight: 700; font-family: 'JetBrains Mono', monospace; margin: 0; }
.price-info .change { font-size: 0.8rem; margin: 0; }
.change.up { color: var(--success); }
.change.down { color: var(--danger); }

.symbol-name { font-weight: 600; font-size: 1.1rem; margin: 0; }
.symbol-exchange { font-size: 0.7rem; color: var(--text-secondary); margin: 0; text-transform: uppercase; }

.empty-state { grid-column: 1 / -1; text-align: center; padding: 3rem; color: var(--text-secondary); }

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-dark);
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90%; max-width: 450px;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.2);
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-header h2 { margin: 0; font-size: 1.25rem; }
.close-modal { background: none; border: none; color: var(--text-secondary); cursor: pointer; }

.input-group input {
    width: 100%; padding: 0.75rem; border-radius: 8px; border: 1px solid var(--border);
    background: rgba(255,255,255,0.05); color: white; margin-bottom: 1.5rem; box-sizing: border-box;
}

.hidden { display: none !important; }

.status-card.expired {
    border-color: var(--danger);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

.status-card.expired .btn.primary {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 0 15px var(--primary); }
    100% { transform: scale(1); }
}

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

/* Toast styles */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2000;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
