/* 
 * Overclock Theme - Based on Official Brand Guidelines
 * Source: https://www.overclock.tech/brand-guidelines
 * 
 * Philosophy: "Dark Machine Intelligence"
 * - Deep black backgrounds (Void)
 * - Orange glow represents heat (Signal)
 * - Nothing is static - orbs pulse, rings rotate, particles flow
 */

/* ============================================
   TYPOGRAPHY - Inter & JetBrains Mono
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================
   COLOR SYSTEM - Brand Constants Only
   (Themed colors come from theme.css)
   ============================================ */

:root {
    /* Official Brand Colors - Constants */
    --signal-orange: #FF6B35;
    --void-black: #000000;
    --carbon: #0D0D0D;
    --elevated: #111111;
    --pure-white: #FFFFFF;
    
    /* Semantic Colors */
    --chaos-red: #FF6464;
    --calm-blue: #3B82F6;
    
    /* Orange accent - same in both themes */
    --accent-primary: #FF6B35;
    --accent-hover: #ff8557;
    --accent-dark: #e55a2b;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    
    /* Glow shadows - used in dark mode */
    --glow-sm: 0 0 10px rgba(255, 107, 53, 0.4);
    --glow-md: 0 0 20px rgba(255, 107, 53, 0.5), 0 0 40px rgba(255, 107, 53, 0.3);
    --glow-lg: 0 0 30px rgba(255, 107, 53, 0.6), 0 0 60px rgba(255, 107, 53, 0.4), 0 0 90px rgba(255, 107, 53, 0.2);
}

/* ============================================
   BASE STYLES
   ============================================ */

body {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-primary) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary) !important;
}

/* Technical labels - JetBrains Mono */
.label, .badge, .technical-text, code {
    font-family: var(--font-mono);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Ensure content is above background */
#app, .content-wrapper, main, .lightlink-nav,
.sidebar, .chat-area, .chat-main, .workflow-container,
.card, .container, nav, header, .details-panel {
    position: relative;
    z-index: 1;
}

/* ============================================
   ANIMATED BACKGROUND CONTAINER
   ============================================ */

.animated-dots-background {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 0 !important;
    background: var(--bg-primary) !important;
    overflow: hidden !important;
    pointer-events: none !important;
    transition: background-color 0.3s ease;
}

/* ============================================
   THE ORB - Central Visual Metaphor
   Brand guideline: "pulsing, ring-surrounded sphere"
   ============================================ */

.overclock-orb {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 600px !important;
    height: 600px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 0 !important;
    pointer-events: none !important;
}

/* Orb Glow - Blurred radial gradient behind everything */
.orb-glow {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    background: radial-gradient(circle, 
        rgba(255, 107, 53, 0.08) 0%, 
        rgba(255, 107, 53, 0.04) 30%, 
        rgba(255, 107, 53, 0.02) 50%,
        transparent 70%
    ) !important;
    filter: blur(60px) !important;
    animation: orbPulse 4s ease-in-out infinite !important;
    transition: opacity 0.3s ease;
}

/* Dark mode - more intense glow */
[data-theme="dark"] .orb-glow {
    background: radial-gradient(circle, 
        rgba(255, 107, 53, 0.4) 0%, 
        rgba(255, 107, 53, 0.2) 30%, 
        rgba(255, 107, 53, 0.1) 50%,
        transparent 70%
    ) !important;
}

/* Orb Core - Semi-transparent with breathing animation (4s cycle) */
.orb-core {
    position: absolute !important;
    width: 100px !important;
    height: 100px !important;
    background: radial-gradient(circle, 
        rgba(255, 107, 53, 0.25) 0%, 
        rgba(255, 107, 53, 0.15) 50%, 
        transparent 70%
    ) !important;
    border-radius: 50% !important;
    animation: orbBreatheLight 4s ease-in-out infinite !important;
    box-shadow: 
        0 0 40px rgba(255, 107, 53, 0.18),
        0 0 80px rgba(255, 107, 53, 0.12),
        0 0 120px rgba(255, 107, 53, 0.06) !important;
    transition: all 0.3s ease;
}

/* Dark mode - intense glow */
[data-theme="dark"] .orb-core {
    background: radial-gradient(circle, 
        rgba(255, 107, 53, 0.9) 0%, 
        rgba(255, 107, 53, 0.5) 50%, 
        transparent 70%
    ) !important;
    animation: orbBreathe 4s ease-in-out infinite !important;
    box-shadow: 
        0 0 40px rgba(255, 107, 53, 0.9),
        0 0 80px rgba(255, 107, 53, 0.7),
        0 0 120px rgba(255, 107, 53, 0.5) !important;
}

/* Orb Rings - Three concentric circles, rotating at different speeds */
.orb-ring {
    position: absolute !important;
    border: 1px solid rgba(255, 107, 53, 0.2) !important;
    border-radius: 50% !important;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.1) !important;
    transition: all 0.3s ease;
}

/* Dark mode - more visible rings */
[data-theme="dark"] .orb-ring {
    border: 1px solid rgba(255, 107, 53, 0.4) !important;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.2) !important;
}

/* Ring 1 - 20s rotation */
.orb-ring-1 {
    width: 180px !important;
    height: 180px !important;
    animation: rotateClockwise 20s linear infinite !important;
}

/* Ring 2 - 25s rotation (counter) */
.orb-ring-2 {
    width: 280px !important;
    height: 280px !important;
    animation: rotateCounterClockwise 25s linear infinite !important;
}

/* Ring 3 - 30s rotation */
.orb-ring-3 {
    width: 380px !important;
    height: 380px !important;
    animation: rotateClockwise 30s linear infinite !important;
}

/* ============================================
   HEARTBEAT DOTS - Pulse/Breathe Animation
   Brand guideline: "2-4s cycles"
   ============================================ */

.dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--signal-orange);
    border-radius: 50%;
    opacity: 0;
    /* Light mode - subtle, no glow */
    box-shadow: 
        0 0 6px rgba(255, 107, 53, 0.15),
        0 0 12px rgba(255, 107, 53, 0.08),
        0 0 20px rgba(255, 107, 53, 0.05);
    animation: dotFloat 12s ease-in-out infinite;
    transition: box-shadow 0.3s ease;
}

/* Dark mode - full glow effect */
[data-theme="dark"] .dot {
    box-shadow: 
        0 0 6px rgba(255, 107, 53, 0.8),
        0 0 12px rgba(255, 107, 53, 0.5),
        0 0 20px rgba(255, 107, 53, 0.3);
}

/* Heartbeat dots - extra pulse effect */
.dot.heartbeat {
    animation: dotHeartbeat 12s ease-in-out infinite;
}

/* Dot positioning */
.dot:nth-child(2) { left: 10%; top: 20%; animation-delay: 0s; }
.dot:nth-child(3) { left: 20%; top: 80%; animation-delay: 2s; }
.dot:nth-child(4) { left: 30%; top: 40%; animation-delay: 4s; }
.dot:nth-child(5) { left: 40%; top: 60%; animation-delay: 1s; }
.dot:nth-child(6) { left: 50%; top: 30%; animation-delay: 3s; }
.dot:nth-child(7) { left: 60%; top: 70%; animation-delay: 5s; }
.dot:nth-child(8) { left: 70%; top: 50%; animation-delay: 2.5s; }
.dot:nth-child(9) { left: 80%; top: 25%; animation-delay: 4.5s; }
.dot:nth-child(10) { left: 90%; top: 85%; animation-delay: 1.5s; }
.dot:nth-child(11) { left: 15%; top: 65%; animation-delay: 3.5s; }
.dot:nth-child(12) { left: 25%; top: 15%; animation-delay: 5.5s; }
.dot:nth-child(13) { left: 35%; top: 90%; animation-delay: 0.5s; }
.dot:nth-child(14) { left: 45%; top: 45%; animation-delay: 2.8s; }
.dot:nth-child(15) { left: 55%; top: 55%; animation-delay: 4.2s; }
.dot:nth-child(16) { left: 65%; top: 35%; animation-delay: 1.8s; }
.dot:nth-child(17) { left: 75%; top: 75%; animation-delay: 3.2s; }
.dot:nth-child(18) { left: 85%; top: 10%; animation-delay: 5.8s; }
.dot:nth-child(19) { left: 95%; top: 95%; animation-delay: 0.8s; }
.dot:nth-child(20) { left: 12%; top: 50%; animation-delay: 2.2s; }
.dot:nth-child(21) { left: 88%; top: 60%; animation-delay: 4.8s; }

/* Smaller accent dots */
.dot:nth-child(n+22) { width: 2px; height: 2px; }
.dot:nth-child(22) { left: 5%; top: 10%; animation-delay: 1.2s; }
.dot:nth-child(23) { left: 15%; top: 85%; animation-delay: 3.4s; }
.dot:nth-child(24) { left: 25%; top: 25%; animation-delay: 5.6s; }
.dot:nth-child(25) { left: 35%; top: 75%; animation-delay: 0.7s; }
.dot:nth-child(26) { left: 45%; top: 5%; animation-delay: 2.9s; }
.dot:nth-child(27) { left: 55%; top: 95%; animation-delay: 4.1s; }
.dot:nth-child(28) { left: 65%; top: 40%; animation-delay: 1.3s; }
.dot:nth-child(29) { left: 75%; top: 80%; animation-delay: 3.5s; }
.dot:nth-child(30) { left: 85%; top: 30%; animation-delay: 5.7s; }
.dot:nth-child(31) { left: 95%; top: 70%; animation-delay: 0.9s; }

/* ============================================
   FLOWING PARTICLES
   Brand guideline: "Flow - data movement"
   ============================================ */

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 107, 53, 0.3);
    border-radius: 50%;
    bottom: 0;
    animation: particleFlow 20s ease-in-out infinite;
    box-shadow: 0 0 4px rgba(255, 107, 53, 0.15);
    transition: all 0.3s ease;
}

/* Dark mode - brighter particles */
[data-theme="dark"] .particle {
    background: rgba(255, 107, 53, 0.6);
    box-shadow: 0 0 4px rgba(255, 107, 53, 0.5);
}

/* ============================================
   ANIMATIONS - Per Brand Guidelines
   ============================================ */

/* Orb pulse - scale 1.0 → 1.05 → 1.0 */
@keyframes orbPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Orb breathe - 4s cycle (dark mode) */
@keyframes orbBreathe {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.7;
        box-shadow: 
            0 0 30px rgba(255, 107, 53, 0.6),
            0 0 60px rgba(255, 107, 53, 0.4),
            0 0 90px rgba(255, 107, 53, 0.2);
    }
    50% { 
        transform: scale(1.05); 
        opacity: 1;
        box-shadow: 
            0 0 40px rgba(255, 107, 53, 0.8),
            0 0 80px rgba(255, 107, 53, 0.6),
            0 0 120px rgba(255, 107, 53, 0.4);
    }
}

/* Orb breathe - light mode (subtle but visible) */
@keyframes orbBreatheLight {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.6;
        box-shadow: 
            0 0 30px rgba(255, 107, 53, 0.15),
            0 0 60px rgba(255, 107, 53, 0.1),
            0 0 90px rgba(255, 107, 53, 0.05);
    }
    50% { 
        transform: scale(1.05); 
        opacity: 0.8;
        box-shadow: 
            0 0 40px rgba(255, 107, 53, 0.22),
            0 0 80px rgba(255, 107, 53, 0.15),
            0 0 120px rgba(255, 107, 53, 0.08);
    }
}

/* Rotation - 20-30s per revolution */
@keyframes rotateClockwise {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotateCounterClockwise {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* Dot float with subtle movement */
@keyframes dotFloat {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    15% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) translateX(15px);
    }
    85% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) translateX(-10px);
    }
}

/* Heartbeat effect - 2s pulse cycle within float */
@keyframes dotHeartbeat {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(1);
    }
    10% {
        opacity: 0.8;
        transform: translateY(-5px) translateX(3px) scale(1.2);
    }
    15% {
        transform: translateY(-8px) translateX(5px) scale(1);
    }
    25% {
        opacity: 1;
        transform: translateY(-15px) translateX(8px) scale(1.3);
    }
    30% {
        transform: translateY(-18px) translateX(10px) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) translateX(15px) scale(1.2);
    }
    55% {
        transform: translateY(-33px) translateX(13px) scale(1);
    }
    75% {
        opacity: 0.6;
        transform: translateY(-45px) translateX(5px) scale(1.1);
    }
    80% {
        transform: translateY(-48px) translateX(3px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) translateX(-10px) scale(1);
    }
}

/* Particle flow toward center */
@keyframes particleFlow {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0);
    }
    20% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
        transform: translateY(-50vh) translateX(calc(50vw - var(--x, 0)));
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh);
    }
}

/* ============================================
   CARDS & CONTAINERS
   ============================================ */

.card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    background: var(--bg-elevated) !important;
    border-color: var(--border-color-hover) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Light mode specific */
:root .card:hover {
    box-shadow: var(--shadow-md);
}

/* Dark mode specific */
[data-theme="dark"] .card:hover {
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.2), var(--shadow-md);
}

/* ============================================
   BUTTONS - With Orange Glow
   ============================================ */

button, .btn {
    background: var(--signal-orange) !important;
    color: var(--pure-white) !important;
    border: none !important;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover, .btn:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-accent);
}

button:active, .btn:active {
    transform: translateY(0);
}

button:disabled, .btn:disabled {
    background: var(--bg-tertiary) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.5;
}

button.secondary, .btn.secondary {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none;
    color: var(--text-primary) !important;
}

button.secondary:hover, .btn.secondary:hover {
    border-color: var(--signal-orange) !important;
    background: var(--bg-secondary) !important;
}

/* Light mode - subtle shadow on primary buttons */
:root button:hover, :root .btn:hover {
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.25);
}

/* Dark mode - glow effect */
[data-theme="dark"] button:hover, [data-theme="dark"] .btn:hover {
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] button.secondary:hover, [data-theme="dark"] .btn.secondary:hover {
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

/* ============================================
   INPUTS & FORMS
   ============================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    background: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font-primary);
    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none !important;
    border-color: var(--signal-orange) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15) !important;
}

/* Light mode - subtle shadow */
:root input:focus,
:root textarea:focus,
:root select:focus {
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1), 0 2px 8px rgba(255, 107, 53, 0.1) !important;
}

/* Dark mode - glow */
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2), 0 0 10px rgba(255, 107, 53, 0.3) !important;
}

/* ============================================
   STATUS BADGES - Technical Typography
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.status-badge.connected,
.status-badge.synced {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-badge.disconnected {
    background: rgba(255, 100, 100, 0.15);
    color: var(--chaos-red);
    border: 1px solid rgba(255, 100, 100, 0.3);
}

.status-badge.syncing {
    background: rgba(255, 107, 53, 0.15);
    color: var(--signal-orange);
    border: 1px solid var(--border-color);
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color-hover);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--signal-orange);
}

/* Light mode - subtle scrollbar */
:root ::-webkit-scrollbar-thumb:hover {
    background: var(--signal-orange);
    box-shadow: none;
}

/* Dark mode - glowing scrollbar */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--signal-orange);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.4);
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.loader, .sync-spinner {
    border: 3px solid var(--border-color);
    border-top-color: var(--signal-orange);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

/* Dark mode - glowing spinner */
[data-theme="dark"] .loader, [data-theme="dark"] .sync-spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-accent { color: var(--signal-orange) !important; }
.text-glow { text-shadow: 0 0 20px rgba(255, 107, 53, 0.6); }
.border-accent { border-color: var(--signal-orange) !important; }
.bg-accent { background: var(--signal-orange) !important; }
.glow-orange { box-shadow: var(--glow-md); }

/* ============================================
   FADE IN ANIMATION
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.5s ease; }

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

@media (max-width: 768px) {
    .card { padding: 16px; }
    button, .btn { padding: 10px 20px; font-size: 14px; }
    .overclock-orb { width: 300px; height: 300px; }
    .orb-core { width: 50px; height: 50px; }
    .orb-ring-1 { width: 100px; height: 100px; }
    .orb-ring-2 { width: 150px; height: 150px; }
    .orb-ring-3 { width: 200px; height: 200px; }
}
