/**
 * ════════════════════════════════════════════════════════════════
 * INSTITUTIONAL SESSION TRADING DASHBOARD - STYLES v3.1
 * ════════════════════════════════════════════════════════════════
 * Author: Dr. Sharma (suzansharmaai)
 * Last Updated: 2025-01-20 00:53:56 UTC
 * 
 * FEATURES:
 * ────────────────────────────────────────────────────────────────
 * ✅ Dynamic color coding (Bullish=Green, Bearish=Red, Neutral=Yellow)
 * ✅ Animated highlights and pulsing effects
 * ✅ Dark/Light theme support
 * ✅ Responsive design
 * ✅ Professional gradients
 * ✅ Trade monitor animations
 * ✅ Notification system
 * 
 * ════════════════════════════════════════════════════════════════
 */

/* ════════════════════════════════════════════════════════════════
   ROOT VARIABLES - COLOR SYSTEM
   ════════════════════════════════════════════════════════════════ */

:root {
    /* Dark Theme (Default) */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-card-hover: #2d3748;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --border-color: #334155;
    --border-highlight: #475569;
    
    /* Status Colors - ENHANCED */
    --color-bullish: #10b981;
    --color-bullish-light: #34d399;
    --color-bullish-dark: #059669;
    --color-bullish-glow: rgba(16, 185, 129, 0.3);
    
    --color-bearish: #ef4444;
    --color-bearish-light: #f87171;
    --color-bearish-dark: #dc2626;
    --color-bearish-glow: rgba(239, 68, 68, 0.3);
    
    --color-neutral: #f59e0b;
    --color-neutral-light: #fbbf24;
    --color-neutral-dark: #d97706;
    --color-neutral-glow: rgba(245, 158, 11, 0.3);
    
    --color-armed: #8b5cf6;
    --color-armed-light: #a78bfa;
    --color-armed-dark: #7c3aed;
    --color-armed-glow: rgba(139, 92, 246, 0.3);
    
    --color-live: #06b6d4;
    --color-live-light: #22d3ee;
    --color-live-dark: #0891b2;
    --color-live-glow: rgba(6, 182, 212, 0.3);
    
    /* UI Colors */
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    
    /* Glow Effects */
    --glow-bullish: 0 0 20px var(--color-bullish-glow);
    --glow-bearish: 0 0 20px var(--color-bearish-glow);
    --glow-live: 0 0 25px var(--color-live-glow);
}

/* Light Theme Override */
body.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --border-color: #e2e8f0;
    --border-highlight: #cbd5e1;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

/* ════════════════════════════════════════════════════════════════
   GLOBAL STYLES
   ════════════════════════════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* ════════════════════════════════════════════════════════════════
   HEADER SECTION
   ════════════════════════════════════════════════════════════════ */

.dashboard-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border-highlight);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-live), var(--color-bullish));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.live {
    background: var(--color-bullish);
    box-shadow: var(--glow-bullish);
}

.status-dot.offline {
    background: var(--color-bearish);
    animation: none;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.clock-container {
    display: flex;
    gap: 2rem;
}

.clock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    min-width: 120px;
}

.clock-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.clock-time {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--color-live);
}

.header-right {
    display: flex;
    gap: 0.75rem;
}

.btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.btn-icon.voice-on {
    background: linear-gradient(135deg, var(--color-bullish-dark), var(--color-bullish));
    color: white;
    border-color: var(--color-bullish);
    box-shadow: var(--glow-bullish);
}

.btn-icon.voice-off {
    background: var(--bg-card);
    color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════════
   CONTROL PANEL
   ════════════════════════════════════════════════════════════════ */

.control-panel {
    background: var(--bg-secondary);
    padding: 1.5rem 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-color);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.control-group input,
.control-group select {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: var(--color-live);
    box-shadow: 0 0 0 3px var(--color-live-glow);
}

.control-actions {
    display: flex;
    gap: 0.75rem;
    margin-left: auto;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-live-dark), var(--color-live));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--glow-live);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-bearish-dark), var(--color-bearish));
    color: white;
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--glow-bearish);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

/* ════════════════════════════════════════════════════════════════
   COUNTDOWN SECTION
   ════════════════════════════════════════════════════════════════ */

.countdown-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: var(--bg-primary);
}

.countdown-card {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.countdown-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-live);
}

.countdown-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.countdown-time {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--color-live);
}

.countdown-card.event-card .countdown-time {
    font-size: 1.25rem;
    color: var(--color-armed);
}

/* ════════════════════════════════════════════════════════════════
   DASHBOARD GRID
   ════════════════════════════════════════════════════════════════ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1800px;
    margin: 0 auto;
}

/* ════════════════════════════════════════════════════════════════
   CARD STYLES - ENHANCED
   ════════════════════════════════════════════════════════════════ */

.card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-highlight);
}

.card-header {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.btn-copy {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: var(--bg-card-hover);
    color: var(--color-live);
    border-color: var(--color-live);
}

.card-content {
    padding: 1.5rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.data-row:last-child {
    border-bottom: none;
}

.data-row:hover {
    background: rgba(255, 255, 255, 0.02);
    padding-left: 0.5rem;
}

.data-row .label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-row .value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.data-row .value.rationale {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════════
   STATUS COLOR SYSTEM - DYNAMIC
   ════════════════════════════════════════════════════════════════ */

/* Bullish (Green) */
.status-bullish,
.value.status-bullish {
    color: var(--color-bullish) !important;
    font-weight: 700;
    text-shadow: 0 0 10px var(--color-bullish-glow);
}

/* Bearish (Red) */
.status-bearish,
.value.status-bearish {
    color: var(--color-bearish) !important;
    font-weight: 700;
    text-shadow: 0 0 10px var(--color-bearish-glow);
}

/* Neutral (Yellow) */
.status-neutral,
.value.status-neutral {
    color: var(--color-neutral) !important;
    font-weight: 700;
    text-shadow: 0 0 10px var(--color-neutral-glow);
}

/* Armed (Purple) */
.status-armed,
.value.status-armed {
    color: var(--color-armed) !important;
    font-weight: 700;
    text-shadow: 0 0 10px var(--color-armed-glow);
}

/* Live (Cyan) */
.status-live,
.value.status-live {
    color: var(--color-live) !important;
    font-weight: 700;
    text-shadow: 0 0 10px var(--color-live-glow);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        text-shadow: 0 0 10px var(--color-live-glow);
    }
    50% {
        text-shadow: 0 0 20px var(--color-live-glow), 0 0 30px var(--color-live-glow);
    }
}

/* ════════════════════════════════════════════════════════════════
   SPECIAL CARD HIGHLIGHTS
   ════════════════════════════════════════════════════════════════ */

/* Final Decision Card - Highlight */
.card-highlight {
    border: 2px solid var(--color-armed);
    box-shadow: var(--shadow-lg), 0 0 30px var(--color-armed-glow);
}

.card-highlight .card-header {
    background: linear-gradient(135deg, var(--color-armed-dark), var(--color-armed));
    color: white;
}

.card-highlight .card-header h3 {
    color: white;
}

/* Pulse Animation for Live Setups */
.card-pulse {
    animation: card-pulse 2s ease-in-out infinite;
}

@keyframes card-pulse {
    0%, 100% {
        box-shadow: var(--shadow-lg), 0 0 20px var(--color-live-glow);
    }
    50% {
        box-shadow: var(--shadow-xl), 0 0 40px var(--color-live-glow), 0 0 60px var(--color-live-glow);
    }
}

/* Active Trade Card */
.card-trade.trade-active {
    border: 2px solid var(--color-live);
    box-shadow: var(--shadow-xl), var(--glow-live);
    background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
}

.card-trade.trade-active .card-header {
    background: linear-gradient(135deg, var(--color-live-dark), var(--color-live));
    color: white;
}

.card-trade.trade-active .card-header h3 {
    color: white;
}

/* P&L Display */
.pnl-row {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem !important;
    border-radius: 8px;
    margin: 0.5rem 0;
}

.pnl-value.profit {
    color: var(--color-bullish) !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    text-shadow: 0 0 15px var(--color-bullish-glow);
    animation: profit-pulse 1.5s ease-in-out infinite;
}

.pnl-value.loss {
    color: var(--color-bearish) !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    text-shadow: 0 0 15px var(--color-bearish-glow);
}

@keyframes profit-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ════════════════════════════════════════════════════════════════
   CONFLUENCE TEXT DISPLAY
   ════════════════════════════════════════════════════════════════ */

.confluence-text {
    white-space: pre-line;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.8;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid var(--color-armed);
}

/* ════════════════════════════════════════════════════════════════
   TAKE TRADE BUTTON
   ════════════════════════════════════════════════════════════════ */

.btn-take-trade {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-bullish-dark), var(--color-bullish));
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    animation: button-glow 2s ease-in-out infinite;
}

.btn-take-trade:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl), var(--glow-bullish);
}

@keyframes button-glow {
    0%, 100% {
        box-shadow: var(--shadow-md);
    }
    50% {
        box-shadow: var(--shadow-lg), 0 0 30px var(--color-bullish-glow);
    }
}

/* ════════════════════════════════════════════════════════════════
   NOTIFICATION SYSTEM
   ════════════════════════════════════════════════════════════════ */

.notification-overlay {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.notification {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-xl);
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 100%;
    word-wrap: break-word;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--color-success);
    background: linear-gradient(135deg, var(--bg-card), rgba(16, 185, 129, 0.1));
}

.notification-error {
    border-left: 4px solid var(--color-error);
    background: linear-gradient(135deg, var(--bg-card), rgba(239, 68, 68, 0.1));
}

.notification-warning {
    border-left: 4px solid var(--color-warning);
    background: linear-gradient(135deg, var(--bg-card), rgba(245, 158, 11, 0.1));
}

.notification-info {
    border-left: 4px solid var(--color-info);
    background: linear-gradient(135deg, var(--bg-card), rgba(59, 130, 246, 0.1));
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 1024px) {
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-left,
    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .control-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-actions {
        margin-left: 0;
        flex-wrap: wrap;
    }
    
    .countdown-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-header h1 {
        font-size: 1.25rem;
    }
    
    .clock-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .countdown-section {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .notification-overlay {
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
    }
}

@media (max-width: 480px) {
    .dashboard-header {
        padding: 1rem;
    }
    
    .control-panel {
        padding: 1rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .data-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .data-row .value {
        max-width: 100%;
        text-align: left;
    }
}

/* ════════════════════════════════════════════════════════════════
   SCROLLBAR STYLING
   ════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-highlight);
}

/* ════════════════════════════════════════════════════════════════
   SELECTION STYLING
   ════════════════════════════════════════════════════════════════ */

::selection {
    background: var(--color-live);
    color: white;
}

::-moz-selection {
    background: var(--color-live);
    color: white;
}

/* ════════════════════════════════════════════════════════════════
   LOADING STATES
   ════════════════════════════════════════════════════════════════ */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--color-live);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ════════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ════════════════════════════════════════════════════════════════ */

.btn:focus-visible,
.btn-icon:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--color-live);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ════════════════════════════════════════════════════════════════
   PRINT STYLES
   ════════════════════════════════════════════════════════════════ */

@media print {
    .dashboard-header,
    .control-panel,
    .countdown-section,
    .btn-copy,
    .notification-overlay {
        display: none;
    }
    
    .dashboard-grid {
        display: block;
    }
    
    .card {
        page-break-inside: avoid;
        margin-bottom: 1rem;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* ════════════════════════════════════════════════════════════════
   END OF STYLESHEET
   ════════════════════════════════════════════════════════════════ */