/* ===========================================
   TRADE TIMER PAGE - TradeRune Elite
   Pure Vanilla CSS
=========================================== */

:root {
    --tm-purp-main: #a855f7;
    --tm-purp-light: #c084fc;
    --tm-purp-deep: #7e22ce;
    --tm-purp-glow: rgba(168, 85, 247, 0.4);
    --tm-purp-whisper: rgba(168, 85, 247, 0.08);
    
    --tm-white-pure: #ffffff;
    --tm-white-soft: rgba(255, 255, 255, 0.95);
    --tm-white-muted: rgba(255, 255, 255, 0.6);
    --tm-white-faded: rgba(255, 255, 255, 0.4);
    
    --tm-cyan: #06b6d4;
    --tm-green: #22c55e;
    --tm-red: #ef5350;
    --tm-gold: #fbbf24;

    --tm-bg-card: rgba(14, 12, 18, 0.85);
    --tm-bg-hover: rgba(30, 20, 45, 0.9);
    --tm-border-base: rgba(192, 132, 252, 0.2);
    
    --tm-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Utilities */
.timer-text-cyan { color: var(--tm-cyan); text-shadow: 0 0 10px rgba(6,182,212,0.4); }
.timer-text-green { color: var(--tm-green); text-shadow: 0 0 10px rgba(34,197,94,0.4); }
.timer-text-red { color: var(--tm-red); text-shadow: 0 0 10px rgba(239,83,80,0.4); }
.timer-text-purple { color: var(--tm-purp-light); text-shadow: 0 0 10px var(--tm-purp-glow); }
.timer-text-gold { color: var(--tm-gold); text-shadow: 0 0 10px rgba(251,191,36,0.4); }
.timer-muted-text { color: var(--tm-white-muted); font-size: 11px; font-weight: 500; font-family: 'JetBrains Mono', monospace; }

/* Main Wrapper */
.timer-main-wrapper {
    margin-left: 20px; padding: 30px 40px; font-family: 'Inter', sans-serif;
    color: var(--tm-white-soft); display: flex; flex-direction: column; gap: 24px; min-height: calc(100vh - 100px);
}

/* Header */
.timer-header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 24px; margin-bottom: 8px; }
.timer-subtitle { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--tm-purp-light); text-transform: uppercase; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.timer-pulse-icon { animation: tPulse 2s infinite; opacity: 0.8; }
@keyframes tPulse { 0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; } 50% { transform: scale(1.2) rotate(180deg); opacity: 1; text-shadow: 0 0 15px var(--tm-purp-light); } }

.timer-title { font-size: 42px; font-weight: 900; margin: 0; letter-spacing: -1px; color: var(--tm-white-pure); line-height: 1.1; }
.timer-text-gradient { background: linear-gradient(90deg, var(--tm-white-pure), var(--tm-purp-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 0 30px var(--tm-purp-glow); }
.timer-desc { margin: 8px 0 0 0; color: var(--tm-white-muted); font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* Stats Row */
.timer-stats-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: stretch; }
.timer-stat-card { background: var(--tm-bg-card); backdrop-filter: blur(24px); border: 1px solid var(--tm-border-base); border-radius: 16px; padding: 16px 20px; min-width: 140px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); transition: all 0.4s var(--tm-ease); display: flex; flex-direction: column; justify-content: center; }
.timer-stat-card:hover { transform: translateY(-3px); background: var(--tm-bg-hover); border-color: rgba(168,85,247,0.3); }
.timer-stat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--tm-white-muted); margin-bottom: 6px; }
.timer-stat-val { font-size: 26px; font-weight: 800; color: var(--tm-white-pure); font-family: 'JetBrains Mono', monospace; line-height: 1; transition: color 0.3s; }

/* Glass Card */
.timer-glass-card {
    background: var(--tm-bg-card); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--tm-border-base); border-radius: 20px; padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08); transition: all 0.4s var(--tm-ease);
}
.timer-glass-card:hover { border-color: rgba(192, 132, 252, 0.3); box-shadow: 0 15px 40px rgba(0,0,0,0.5), inset 0 0 20px var(--tm-purp-whisper); }
.timer-panel-title { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--tm-purp-light); text-transform: uppercase; margin: 0 0 16px 0; display: flex; align-items: center; gap: 8px; }
.timer-section-title { font-size: 14px; font-weight: 800; color: var(--tm-white-pure); letter-spacing: 2px; text-transform: uppercase; text-shadow: 0 0 15px var(--tm-purp-glow); margin-bottom: 12px; }

/* Empty State */
.timer-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; background: rgba(0,0,0,0.3); border: 1px dashed rgba(255,255,255,0.1); border-radius: 20px; text-align: center; }
.timer-empty-state i { font-size: 32px; color: var(--tm-purp-light); opacity: 0.5; margin-bottom: 12px; }
.timer-empty-state p { color: var(--tm-white-muted); font-size: 12px; font-family: monospace; }

/* Layout Grid */
.timer-content-layout { display: flex; gap: 24px; align-items: flex-start; }
.timer-main-col { flex: 1; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.timer-sidebar { width: 320px; display: flex; flex-direction: column; gap: 24px; flex-shrink: 0; }
.timer-insights-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

@media (max-width: 1024px) {
    .timer-content-layout { flex-direction: column; }
    .timer-sidebar { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
    .timer-insights-row { grid-template-columns: 1fr; }
}

/* LIVE TIMERS */
.timer-live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }
.timer-live-card { background: linear-gradient(145deg, rgba(20,15,30,0.9), rgba(10,8,15,0.95)); border: 1px solid var(--tm-border-base); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; transition: all 0.4s var(--tm-ease); position: relative; overflow: hidden; animation: cardEntry 0.4s var(--tm-ease) backwards; }
@keyframes cardEntry { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.timer-live-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.timer-live-card.win { border-color: rgba(34,197,94,0.4); box-shadow: inset 0 0 20px rgba(34,197,94,0.05); }
.timer-live-card.loss { border-color: rgba(239,83,80,0.4); box-shadow: inset 0 0 20px rgba(239,83,80,0.05); }

.tl-top { display: flex; justify-content: space-between; align-items: flex-start; }
.tl-sym { font-size: 18px; font-weight: 900; color: #fff; font-family: monospace; }
.tl-dir { font-size: 9px; padding: 2px 6px; border-radius: 4px; font-weight: 800; letter-spacing: 1px; }
.tl-dir.long { background: rgba(34,197,94,0.1); color: var(--tm-green); border: 1px solid rgba(34,197,94,0.2); }
.tl-dir.short { background: rgba(239,83,80,0.1); color: var(--tm-red); border: 1px solid rgba(239,83,80,0.2); }

.tl-clock { font-size: 32px; font-weight: 900; font-family: 'JetBrains Mono', monospace; text-align: center; margin: 5px 0; line-height: 1; }
.timer-live-card.win .tl-clock { color: var(--tm-green); text-shadow: 0 0 15px rgba(34,197,94,0.4); }
.timer-live-card.loss .tl-clock { color: var(--tm-red); text-shadow: 0 0 15px rgba(239,83,80,0.4); }
.timer-live-card.be .tl-clock { color: var(--tm-gold); text-shadow: 0 0 15px rgba(251,191,36,0.4); }

.tl-bot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 10px; }
.tl-bracket { font-size: 9px; font-weight: 800; color: var(--tm-white-muted); background: rgba(0,0,0,0.3); padding: 4px 8px; border-radius: 4px; }
.tl-btn-close { background: rgba(239,83,80,0.1); border: 1px solid rgba(239,83,80,0.3); color: var(--tm-red); padding: 4px 12px; border-radius: 6px; font-size: 10px; font-weight: 800; cursor: pointer; transition: 0.2s; }
.tl-btn-close:hover { background: var(--tm-red); color: #fff; box-shadow: 0 0 10px rgba(239,83,80,0.4); }

/* SVG CHARTS */
.timer-dist-wrapper { flex: 1; width: 100%; position: relative; }
.timer-svg-container { width: 100%; height: 100%; position: absolute; inset: 0; }

/* SVG Tooltip */
.timer-svg-tooltip { position: fixed; display: none; padding: 10px; background: rgba(10, 8, 15, 0.95); backdrop-filter: blur(8px); border: 1px solid var(--tm-purp-light); border-radius: 8px; color: #fff; font-family: monospace; font-size: 11px; z-index: 50; pointer-events: none; box-shadow: 0 10px 20px rgba(0,0,0,0.8); }

/* Patience Score Gauge */
.timer-score-gauge { position: relative; width: 100%; max-width: 250px; margin: 0 auto; aspect-ratio: 2/1; margin-top: 10px; }
.timer-gauge-svg { width: 100%; height: 100%; overflow: visible; }
.timer-gauge-bg { stroke: rgba(255,255,255,0.05); }
.timer-gauge-fill { stroke: var(--tm-purp-main); transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.5s; }
.timer-gauge-val { position: absolute; bottom: 0; left: 0; width: 100%; text-align: center; font-size: 42px; font-weight: 900; font-family: 'JetBrains Mono', monospace; color: #fff; text-shadow: 0 0 20px var(--tm-purp-glow); line-height: 0.8; }

/* Patterns List */
.timer-patterns-list { display: flex; flex-direction: column; gap: 12px; }
.tp-card { background: rgba(0,0,0,0.3); border: 1px solid var(--tm-border-base); padding: 16px; border-radius: 12px; display: flex; gap: 12px; align-items: flex-start; transition: 0.3s; }
.tp-card:hover { transform: translateX(4px); border-color: var(--tm-purp-light); background: rgba(168,85,247,0.05); }
.tp-icon { font-size: 16px; color: var(--tm-purp-main); }
.tp-card.warning .tp-icon { color: var(--tm-red); }
.tp-card.success .tp-icon { color: var(--tm-green); }
.tp-card.insight .tp-icon { color: var(--tm-cyan); }
.tp-text { flex: 1; font-size: 12px; color: var(--tm-white-soft); line-height: 1.5; }
.tp-action { font-size: 10px; color: var(--tm-purp-light); font-weight: 800; margin-top: 8px; cursor: pointer; display: inline-block; }
.tp-action:hover { text-decoration: underline; }

/* Setup List */
.timer-setup-list { display: flex; flex-direction: column; gap: 8px; }
.ts-row { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px dashed rgba(255,255,255,0.05); font-size: 12px; }
.ts-name { font-weight: 800; color: #fff; }
.ts-stats { font-family: monospace; color: var(--tm-white-muted); display: flex; gap: 16px; text-align: right; }
.ts-stats strong { color: var(--tm-purp-light); font-size: 13px; }

/* History Table */
.timer-filter-bar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.timer-select { background: rgba(0,0,0,0.3); border: 1px solid var(--tm-border-base); color: #fff; padding: 8px 12px; border-radius: 8px; font-size: 11px; font-weight: 600; outline: none; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>"); background-repeat: no-repeat; background-position-x: 95%; background-position-y: 50%; padding-right: 28px; }
.timer-table { background: rgba(0,0,0,0.3); border: 1px solid var(--tm-border-base); border-radius: 12px; overflow: hidden; }
.timer-thead { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 0.5fr; padding: 12px 16px; background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--tm-border-base); font-size: 9px; font-weight: 800; color: var(--tm-white-muted); letter-spacing: 1px; }
.timer-tbody { overflow-y: auto; }
.timer-tr { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 0.5fr; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.03); align-items: center; font-size: 11px; font-family: monospace; transition: 0.2s; cursor: pointer; }
.timer-tr:hover { background: rgba(255,255,255,0.05); }

/* Scrollbars */
.custom-scroll::-webkit-scrollbar { width: 4px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: var(--tm-purp-light); }

/* ===========================================
   ENHANCED SESSION TIMER STYLES
   =========================================== */

/* Session Timer Card */
.timer-session-card {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    align-items: center;
    padding: 24px;
    margin-bottom: 24px;
}

.ts-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ts-elapsed-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--tm-white-muted);
}
.ts-elapsed-time {
    font-size: 36px;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
    color: #fff;
}
.ts-progress-wrapper {
    height: 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    overflow: hidden;
}
.ts-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--tm-green), var(--tm-cyan));
    border-radius: 4px;
    transition: width 0.5s ease;
}
.ts-time-goal {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--tm-white-muted);
}
.ts-time-goal strong {
    color: var(--tm-purp-light);
}

/* Market Hours */
.ts-center {
    text-align: center;
}
.ts-market-hours {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--tm-border-base);
    border-radius: 12px;
    padding: 16px;
}
.ts-market-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--tm-white-muted);
    margin-bottom: 8px;
}
.ts-market-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}
.ts-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tm-green);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.ts-session-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--tm-green);
}
.ts-time-remaining {
    font-size: 11px;
    color: var(--tm-white-muted);
}
.ts-time-remaining small {
    display: block;
    font-size: 9px;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.ts-time-remaining span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

/* Break Reminder */
.ts-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.ts-break-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--tm-white-muted);
}
.ts-break-time {
    font-size: 24px;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
    color: var(--tm-cyan);
}
.ts-break-controls {
    display: flex;
    gap: 8px;
}
.ts-btn-config, .ts-btn-snooze {
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--tm-border-base);
    border-radius: 6px;
    color: var(--tm-white-muted);
    font-size: 10px;
    cursor: pointer;
    transition: 0.2s;
}
.ts-btn-config:hover, .ts-btn-snooze:hover {
    background: rgba(168,85,247,0.2);
    color: #fff;
}
.ts-session-alert {
    background: rgba(251,191,36,0.1);
    border: 1px solid rgba(251,191,36,0.3);
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--tm-gold);
    font-size: 11px;
    font-weight: 600;
}

/* Timeline Card */
.timer-timeline-card {
    margin-bottom: 24px;
    padding: 20px;
}
.ttl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.ttl-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--tm-white-muted);
    margin: 0;
}
.ttl-session-info {
    display: flex;
    gap: 12px;
    font-size: 11px;
}
.ttl-session-name {
    font-weight: 700;
    color: var(--tm-gold);
}
.ttl-session-time {
    color: var(--tm-white-muted);
}
.ttl-bar {
    position: relative;
    height: 32px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    display: flex;
    overflow: hidden;
}
.ttl-segment {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    border-right: 1px solid rgba(255,255,255,0.05);
}
.ttl-segment:last-child { border-right: none; }
.ttl-segment.pre-market { background: rgba(102,102,102,0.3); color: rgba(255,255,255,0.5); }
.ttl-segment.first-hour { background: rgba(34,197,94,0.2); color: #22c55e; }
.ttl-segment.mid-session { background: rgba(251,191,36,0.1); color: rgba(255,255,255,0.7); }
.ttl-segment.close-hour { background: rgba(245,158,11,0.2); color: #f59e0b; }
.ttl-segment.after-hours { background: rgba(239,83,80,0.2); color: #ef5350; }
.ttl-cursor {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    background: #fff;
    box-shadow: 0 0 10px #fff;
    transition: left 1s linear;
    z-index: 10;
}
.ttl-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 9px;
    color: var(--tm-white-muted);
}

/* Session Summary */
.timer-session-summary {
    margin-top: 24px;
}
.tss-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-top: 16px;
}
.tss-item {
    text-align: center;
    padding: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
}
.tss-item small {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--tm-white-muted);
    margin-bottom: 4px;
}
.tss-item span {
    font-size: 18px;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
}

/* Break Modal */
.tm-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}
.tm-modal-backdrop.show {
    opacity: 1;
    pointer-events: all;
}
.tm-modal {
    background: linear-gradient(145deg, rgba(20,15,30,0.98), rgba(10,8,15,0.99));
    border: 1px solid rgba(168,85,247,0.3);
    border-radius: 24px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 32px 64px rgba(0,0,0,0.8);
}
.tm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--tm-border-base);
}
.tm-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}
.tm-modal-close {
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--tm-white-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}
.tm-modal-body {
    padding: 24px;
}
.tm-form-group {
    margin-bottom: 20px;
}
.tm-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--tm-white-soft);
    margin-bottom: 8px;
}
.tm-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--tm-border-base);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    outline: none;
}
.tm-form-group input[type="checkbox"] {
    margin-right: 8px;
}
.tm-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--tm-border-base);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.tm-btn-secondary {
    padding: 10px 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--tm-border-base);
    color: var(--tm-white-muted);
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}
.tm-btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--tm-purp-deep), var(--tm-purp-main));
    border: 1px solid var(--tm-purp-light);
    color: #fff;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}