/* TradeGuard Dashboard Styles */
/* Dark theme optimized for traders */

:root {
    /* Color Palette - Deep Navy Theme */
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-card-hover: #1f2a3d;
    
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #3b82f6;
    --accent-secondary: #6366f1;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    
    --border-color: #2d3748;
    --border-light: #374151;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    
    /* Typography */
    --font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2rem;
    --font-size-3xl: 2.5rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.5;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: -0.5px;
}

.version {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-left: var(--space-sm);
}

.nav-menu {
    list-style: none;
    padding: var(--space-md);
    flex: 1;
}

.nav-item {
    margin-bottom: var(--space-xs);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active .nav-link {
    background: var(--accent-primary);
    color: white;
}

/* Override active styles when session-active-purple is present */
#thoughtsNavItem.session-active-purple.active .nav-link {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.2) 0%, rgba(138, 43, 226, 0.1) 100%) !important;
    color: #8a2be2 !important;
}

/* Neon glow for Place Trade nav button when in session */
#placeTradeNavItem.session-active .nav-link {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.2) 0%, rgba(0, 255, 0, 0.1) 100%);
    border: 2px solid #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4), 0 0 30px rgba(0, 255, 0, 0.2), inset 0 0 15px rgba(0, 255, 0, 0.1);
    animation: neonNavPulse 2s ease-in-out infinite;
    color: #00ff00;
    font-weight: 600;
}

#placeTradeNavItem.session-active .nav-link .nav-icon {
    filter: drop-shadow(0 0 5px rgba(0, 255, 0, 0.8));
}

/* Orange neon glow for Plans nav button 15 minutes before session */
#plansNavItem.session-active .nav-link {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.2) 0%, rgba(255, 140, 0, 0.1) 100%);
    border: 2px solid #ff8c00;
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.4), 0 0 30px rgba(255, 140, 0, 0.2), inset 0 0 15px rgba(255, 165, 0, 0.1);
    animation: neonNavPulseOrange 2s ease-in-out infinite;
    color: #ff8c00;
    font-weight: 600;
}

#plansNavItem.session-active .nav-link .nav-icon {
    filter: drop-shadow(0 0 5px rgba(255, 165, 0, 0.8));
}

@keyframes neonNavPulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(0, 255, 0, 0.4), 0 0 30px rgba(0, 255, 0, 0.2), inset 0 0 15px rgba(0, 255, 0, 0.1);
    }
    50% {
        box-shadow: 0 0 25px rgba(0, 255, 0, 0.6), 0 0 50px rgba(0, 255, 0, 0.4), inset 0 0 25px rgba(0, 255, 0, 0.2);
    }
}

@keyframes neonNavPulseOrange {
    0%, 100% {
        box-shadow: 0 0 15px rgba(255, 165, 0, 0.4), 0 0 30px rgba(255, 140, 0, 0.2), inset 0 0 15px rgba(255, 165, 0, 0.1);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 165, 0, 0.6), 0 0 50px rgba(255, 140, 0, 0.4), inset 0 0 25px rgba(255, 165, 0, 0.2);
    }
}

/* Purple neon glow for Thoughts nav button 18 minutes before session */
/* CRITICAL: Higher specificity to override .nav-item.active .nav-link */
#thoughtsNavItem.session-active-purple .nav-link,
#thoughtsNavItem.session-active-purple.active .nav-link {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.2) 0%, rgba(138, 43, 226, 0.1) 100%) !important;
    border: 2px solid #8a2be2 !important;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.4), 0 0 30px rgba(138, 43, 226, 0.2), inset 0 0 15px rgba(138, 43, 226, 0.1) !important;
    animation: neonNavPulsePurple 2s ease-in-out infinite !important;
    color: #8a2be2 !important;
    font-weight: 600 !important;
    z-index: 10 !important;
    position: relative !important;
}

#thoughtsNavItem.session-active-purple .nav-link .nav-icon,
#thoughtsNavItem.session-active-purple.active .nav-link .nav-icon {
    filter: drop-shadow(0 0 5px rgba(138, 43, 226, 0.8)) !important;
}

@keyframes neonNavPulsePurple {
    0%, 100% {
        box-shadow: 0 0 15px rgba(138, 43, 226, 0.4), 0 0 30px rgba(138, 43, 226, 0.2), inset 0 0 15px rgba(138, 43, 226, 0.1);
    }
    50% {
        box-shadow: 0 0 25px rgba(138, 43, 226, 0.6), 0 0 50px rgba(138, 43, 226, 0.4), inset 0 0 25px rgba(138, 43, 226, 0.2);
    }
}

}

.nav-icon {
    font-size: var(--font-size-lg);
}

.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.sync-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

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

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

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 220px;
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-xl);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Toggle Buttons */
.toggle-group {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 2px;
}

.toggle-btn {
    padding: var(--space-xs) var(--space-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* Content Area */
.content-area {
    padding: var(--space-xl);
    flex: 1;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-wide {
    grid-column: span 2;
}

.card-full {
    grid-column: span 4;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-body {
    padding: var(--space-lg);
}

.card-actions {
    display: flex;
    gap: var(--space-sm);
}

/* Discipline Score Card */
.score-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.score-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--accent-success);
}

.score-value.warning {
    color: var(--accent-warning);
}

.score-value.danger {
    color: var(--accent-danger);
}

.score-label {
    font-size: var(--font-size-lg);
    color: var(--text-muted);
    margin-left: var(--space-xs);
}

.score-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-danger) 0%, var(--accent-warning) 50%, var(--accent-success) 100%);
    transition: width 0.5s ease;
}

.criteria-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    justify-content: center;
}

.chip {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}

.chip.passed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.chip.failed {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}

/* Risk Card */
.risk-metrics {
    display: flex;
    justify-content: space-around;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.metric {
    text-align: center;
}

.metric-value {
    display: block;
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.metric-label {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.risk-bar-container {
    margin-top: var(--space-md);
}

.risk-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    position: relative;
    overflow: visible;
}

.risk-fill {
    height: 100%;
    background: var(--accent-success);
    border-radius: 4px;
    transition: width 0.5s, background 0.5s;
}

.risk-fill.warning {
    background: var(--accent-warning);
}

.risk-fill.danger {
    background: var(--accent-danger);
}

.risk-limit {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    background: var(--accent-danger);
}

.risk-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* Stats */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: var(--font-size-xl);
    font-weight: 600;
}

.stat-max {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.stat-value.pnl {
    color: var(--accent-success);
}

.stat-value.pnl.negative {
    color: var(--accent-danger);
}

/* Balance Card */
.balance-display {
    text-align: center;
}

.balance-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.balance-label {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.balance-secondary {
    text-align: center;
    margin-top: var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Charts */
.chart-container {
    height: 250px;
    position: relative;
}

.chart-summary {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.summary-stats {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
    justify-content: center;
}

.summary-item {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.summary-item.positive {
    color: var(--accent-success);
}

.summary-item.negative {
    color: var(--accent-danger);
}

/* ==================== Tag Styles ==================== */

.tag-chip {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: white;
    margin-right: var(--space-xs);
    margin-bottom: var(--space-xs);
    white-space: nowrap;
    cursor: default;
}

.tag-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    align-items: center;
}

.tag-placeholder {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-style: italic;
}

.tags-cell {
    cursor: pointer;
    padding: var(--space-sm) !important;
}

.tags-cell:hover {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

/* Tag Selector (in modal) */
.tag-selector {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 300px;
    overflow-y: auto;
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

.tag-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.tag-checkbox:hover {
    background-color: var(--bg-card);
}

.tag-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.tag-selector-container {
    margin-bottom: var(--space-lg);
}

/* Color Picker */
.color-picker {
    width: 60px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.color-display {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    vertical-align: middle;
    margin-right: var(--space-xs);
}

.color-code {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-family: monospace;
}

/* Trades Remaining Styles */
.trades-remaining-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    padding: var(--space-md);
}

.trades-remaining-item {
    text-align: center;
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: border-color 0.2s, background-color 0.2s;
}

.trades-remaining-item:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.trades-remaining-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trades-remaining-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    line-height: 1.2;
}

.trades-remaining-value .trades-remaining-zero {
    color: var(--accent-danger);
    animation: pulse 1.5s ease-in-out infinite;
}

.trades-remaining-max {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    font-weight: 400;
}

.trades-remaining-session-name {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
    font-style: italic;
}

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

/* Tag Editor Modal */
.tag-editor-modal {
    max-width: 500px;
}

/* Notes Styles */
.notes-cell {
    cursor: pointer;
    padding: var(--space-sm) !important;
    max-width: 200px;
}

.notes-preview {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notes-placeholder {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-style: italic;
}

.notes-editor-modal {
    max-width: 600px;
}

.notes-textarea {
    width: 100%;
    min-height: 200px;
    resize: vertical;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

/* Sentiment Styles */
.sentiment-cell {
    text-align: center;
    padding: var(--space-sm) !important;
}

.sentiment-indicator {
    font-size: var(--font-size-lg);
    display: inline-block;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    cursor: default;
}

.sentiment-positive {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.sentiment-negative {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}

.sentiment-neutral {
    background-color: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

.form-row {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-end;
}

.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

/* Tags Page Styles */
.tags-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.tag-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.tag-count {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.summary-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.data-table td {
    font-size: var(--font-size-sm);
}

.data-table tr:hover {
    background: var(--bg-card-hover);
}

.data-table .positive {
    color: var(--accent-success);
}

.data-table .negative {
    color: var(--accent-danger);
}

.criteria-score {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.criteria-score .checkmarks {
    display: flex;
    gap: 2px;
}

.criteria-score .check {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.criteria-score .check.pass {
    background: var(--accent-success);
}

.criteria-score .check.fail {
    background: var(--accent-danger);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-sm {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--accent-danger);
    color: white;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.btn-icon:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.form-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-size-md);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.select-sm {
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    cursor: pointer;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: var(--font-size-md);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: var(--font-size-xl);
    cursor: pointer;
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-color);
}

/* Criteria Page */
.criteria-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.session-groups {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
}

.session-group {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.group-title {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.slot-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.slot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
}

.slot-item.inactive {
    opacity: 0.5;
}

.slot-time {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
}

.criteria-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.criteria-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.criteria-item.inactive {
    opacity: 0.5;
}

.criteria-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.criteria-name {
    font-weight: 500;
}

.criteria-value {
    font-size: var(--font-size-lg);
    color: var(--accent-primary);
}

.criteria-actions {
    display: flex;
    gap: var(--space-xs);
}

/* Criteria Summary (for place trade page) */
.criteria-summary-section {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    background: var(--bg-secondary);
}

.criteria-summary-section:last-child {
    margin-bottom: 0;
}

.criteria-summary-section h3 {
    margin: 0 0 var(--space-md) 0;
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: var(--space-sm);
}

.criteria-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-light);
}

.criteria-summary-item:last-child {
    border-bottom: none;
}

.criteria-summary-label {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.criteria-summary-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: var(--font-size-sm);
}

.page-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
}

/* Links */
.link {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: var(--font-size-sm);
}

.link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card-wide {
        grid-column: span 2;
    }
    
    .card-full {
        grid-column: span 2;
    }
    
    .session-groups {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-header,
    .nav-link span:not(.nav-icon),
    .sidebar-footer .status-text {
        display: none;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .card-wide,
    .card-full {
        grid-column: span 1;
    }
    
    .session-groups {
        grid-template-columns: 1fr;
    }
}

/* Chips */
.criteria-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-md);
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.chip.pass {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
}

.chip.fail {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
}

.chip.neutral {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

/* Empty States */
.empty-cell {
    text-align: center;
    padding: var(--space-xl) !important;
    color: var(--text-muted);
    font-style: italic;
}

/* Color States for Text */
.positive {
    color: var(--accent-success) !important;
}

.negative {
    color: var(--accent-danger) !important;
}

.warning {
    color: var(--accent-warning) !important;
}

/* Plan Status Styles */
.plan-status,
a.plan-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.plan-status:hover,
a.plan-status:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.plan-status-unplanned {
    background-color: #64748b;
    color: white;
}

.plan-status-planned {
    background-color: #3b82f6;
    color: white;
}

.plan-status-update {
    background-color: #f59e0b;
    color: white;
    animation: pulse 2s infinite;
}

.plan-status-failed {
    background-color: #ef4444;
    color: white;
}

.plan-status-worked {
    background-color: #10b981;
    color: white;
}

.plan-status-sl-hit-worked {
    background-color: #8b5cf6;
    color: white;
}

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

/* Session Breach Highlight */
tr.session-breach {
    background-color: rgba(255, 82, 82, 0.15) !important;
    border-left: 3px solid rgba(255, 107, 0, 0.8);
    box-shadow: 0 0 8px rgba(255, 107, 0, 0.3);
}

tr.session-breach:hover {
    background-color: rgba(255, 82, 82, 0.25) !important;
    box-shadow: 0 0 12px rgba(255, 107, 0, 0.4);
}

/* Stop Discipline Card */
.stop-discipline-card .stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.stop-discipline-card #widenedStopsToday,
.stop-discipline-card #widenedStopsWeek {
    font-weight: 600;
    color: var(--text-primary);
}

.stop-discipline-card .card-note {
    margin-top: var(--space-md);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-style: italic;
}

/* SL Moves Column */
.sl-moves-cell {
    text-align: center;
    padding: var(--space-sm) !important;
}

.sl-meta {
    font-size: var(--font-size-xs);
    opacity: 0.85;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.sl-meta-fixed {
    color: var(--accent-success);
    font-weight: 500;
    background: rgba(16, 185, 129, 0.1);
}

.sl-meta-moved {
    color: var(--accent-warning);
    background: rgba(245, 158, 11, 0.1);
}

.sl-meta-widened {
    color: var(--accent-danger);
    font-weight: 600;
    background: rgba(239, 68, 68, 0.1);
}

/* ==================== Plan Styles ==================== */

.plan-preview {
    color: var(--accent-primary);
    cursor: pointer;
    text-decoration: underline;
    font-size: var(--font-size-sm);
}

.plan-preview:hover {
    color: var(--accent-secondary);
}

.plan-placeholder {
    color: var(--text-muted);
    font-style: italic;
    cursor: pointer;
    font-size: var(--font-size-xs);
}

.plan-placeholder:hover {
    color: var(--accent-primary);
}

.plan-cell {
    cursor: pointer;
    padding: var(--space-sm) !important;
}

.plan-cell:hover {
    background-color: var(--bg-card-hover);
}

/* ==================== Calendar Styles ==================== */

.plans-page {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}

.calendar-weekday {
    text-align: center;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-muted);
    padding: var(--space-sm);
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-xs);
}

.calendar-day {
    position: relative;
    aspect-ratio: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    cursor: pointer;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    position: relative;
    transition: background-color 0.2s, border-color 0.2s;
    min-height: 80px;
}

.calendar-day:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.calendar-day.today {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.calendar-day.empty {
    cursor: default;
    background: transparent;
    border: none;
}

.calendar-day.empty:hover {
    background: transparent;
    border: none;
}

.day-number {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.plan-badge {
    position: absolute;
    top: var(--space-xs);
    right: var(--space-xs);
    background: var(--accent-primary);
    color: white;
    border-radius: 12px;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    padding: 0 8px;
}

/* Status breakdown container - shows below the main badge */
.plan-status-breakdown {
    position: absolute;
    top: calc(var(--space-xs) + 32px); /* Below the main badge */
    right: var(--space-xs);
    display: flex;
    flex-direction: column;
    gap: 3px;
    z-index: 2;
    max-width: 140px;
    min-width: 100px;
}

/* Individual status badge with count */
.plan-status-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1.2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.plan-status-badge .status-label {
    opacity: 0.95;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 4px;
}

.plan-status-badge .status-count {
    font-weight: 700;
    margin-left: 4px;
}

/* Status badge colors */
.plan-status-badge.plan-status-unplanned {
    background-color: #64748b;
    color: white;
}

.plan-status-badge.plan-status-planned {
    background-color: #3b82f6;
    color: white;
}

.plan-status-badge.plan-status-update {
    background-color: #f59e0b;
    color: white;
}

.plan-status-badge.plan-status-failed {
    background-color: #ef4444;
    color: white;
}

.plan-status-badge.plan-status-worked {
    background-color: #10b981;
    color: white;
}

.plan-status-badge.plan-status-sl-hit-worked {
    background-color: #8b5cf6;
    color: white;
}

.plan-status-indicator,
a.plan-status-indicator {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    z-index: 3;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    display: block;
    cursor: pointer;
}

a.plan-status-indicator:hover {
    transform: scale(1.3);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

.plan-status-indicator.plan-status-unplanned {
    background-color: #64748b;
}

.plan-status-indicator.plan-status-planned {
    background-color: #3b82f6;
}

.plan-status-indicator.plan-status-update {
    background-color: #f59e0b;
    animation: pulse-dot 2s infinite;
}

.plan-status-indicator.plan-status-failed {
    background-color: #ef4444;
}

.plan-status-indicator.plan-status-worked {
    background-color: #10b981;
}

.plan-status-indicator.plan-status-sl-hit-worked {
    background-color: #8b5cf6;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

.calendar-day {
    position: relative;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 700;
}

.plans-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.plan-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.plan-header h4 {
    color: var(--text-primary);
    font-size: var(--font-size-lg);
}

.plan-actions {
    display: flex;
    gap: var(--space-sm);
}

.plan-details {
    display: flex;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.plan-detail {
    display: flex;
    gap: var(--space-xs);
}

.detail-label {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.detail-value {
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.plan-notes {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

.modal-large {
    max-width: 600px;
}

.plan-selector-container {
    margin-bottom: var(--space-lg);
}

.plan-editor-modal {
    max-width: 500px;
}

.symbol-selector-container {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.symbol-selector-container select {
    flex: 1;
}

.favorite-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-size-lg);
    transition: all 0.2s;
    flex-shrink: 0;
}

.favorite-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent-primary);
}

.favorite-btn #favoriteIcon {
    color: var(--text-muted);
    transition: color 0.2s;
}

.favorite-btn:hover #favoriteIcon {
    color: #fbbf24;
}

.favorite-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.favorite-btn:disabled:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.favorite-btn:disabled #favoriteIcon {
    color: var(--text-muted);
}

select optgroup {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

select option {
    padding: var(--space-sm);
}

/* Max Trades Reached - Neon Red Flash */
.max-trades-flash {
    animation: neonRedFlash 0.5s ease-in-out 3 !important;
    border: 2px solid #ff0000 !important;
}

@keyframes neonRedFlash {
    0%, 100% {
        border-color: var(--border-color) !important;
        box-shadow: var(--shadow-md) !important;
    }
    50% {
        border-color: #ff0000 !important;
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.8), 0 0 40px rgba(255, 0, 0, 0.6), 0 0 60px rgba(255, 0, 0, 0.4) !important;
    }
}

.place-trade-page.max-trades-flash {
    animation: neonRedFlashPage 0.5s ease-in-out 3 !important;
}

body.max-trades-flash {
    animation: neonRedFlashBody 0.5s ease-in-out 3 !important;
}

@keyframes neonRedFlashPage {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(255, 0, 0, 0.15) !important;
    }
}

@keyframes neonRedFlashBody {
    0%, 100% {
        background-color: var(--bg-primary);
    }
    50% {
        background-color: rgba(255, 0, 0, 0.1) !important;
    }
}

/* Max Trades Modal */
.max-trades-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}

.max-trades-modal-content {
    background: var(--bg-card);
    border: 2px solid #ff0000;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.6), 0 0 60px rgba(255, 0, 0, 0.4);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.max-trades-modal-header h2 {
    color: #ff0000;
    margin: 0 0 var(--space-md) 0;
    font-size: var(--font-size-xl);
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
}

.max-trades-modal-body {
    margin-bottom: var(--space-lg);
}

.max-trades-modal-body p {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.max-trades-modal-hint {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-style: italic;
    margin-top: var(--space-md);
}

.max-trades-modal-footer {
    text-align: center;
}

.max-trades-modal-footer .btn {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-md);
    cursor: pointer;
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent-primary);
    color: white;
    transition: all 0.2s;
}

.max-trades-modal-footer .btn:hover {
    background: var(--accent-secondary);
    transform: scale(1.05);
}


/* ============================================
   Thoughts Page - Box Breathing Visualization
   ============================================ */

.thoughts-page {
    min-height: calc(100vh - 200px);
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.box-breathing-container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
}

.breathing-square {
    position: relative;
    width: 400px;
    height: 400px;
    margin: var(--space-xl) 0;
    opacity: 0;
    animation: fadeInSquare 1s ease-in forwards;
}

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

.square-side {
    position: absolute;
    background: linear-gradient(135deg, #e0e0e0 0%, #c0c0c0 100%);
    transition: all 0.3s ease;
}

.side-top {
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    border-radius: 4px 4px 0 0;
}

.side-right {
    top: 0;
    right: 0;
    width: 8px;
    height: 100%;
    border-radius: 0 4px 4px 0;
}

.side-bottom {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    border-radius: 0 0 4px 4px;
}

.side-left {
    top: 0;
    left: 0;
    width: 8px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.square-side.active {
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(255, 255, 255, 0.4);
    z-index: 10;
}

.breathing-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    border: 3px solid rgba(255, 255, 255, 0.6);
    animation: breathe 16s linear;
    animation-iteration-count: 3; /* Repeat 3 times */
}

@keyframes breathe {
    /* 4 seconds in (0% to 25%) */
    0% {
        transform: translate(-50%, -50%) scale(0.6);
        opacity: 0.6;
    }
    25% {
        transform: translate(-50%, -50%) scale(2.0);
        opacity: 1;
    }
    /* 4 seconds hold (25% to 50%) */
    50% {
        transform: translate(-50%, -50%) scale(2.0);
        opacity: 1;
    }
    /* 8 seconds out (50% to 100%) */
    100% {
        transform: translate(-50%, -50%) scale(0.6);
        opacity: 0.6;
    }
}

.breathing-controls {
    text-align: center;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    align-items: center;
}

.counter-display {
    font-size: 6rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    font-family: var(--font-family);
    min-width: 120px;
}

.round-indicator {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    font-weight: 500;
}

.side-indicator {
    font-size: var(--font-size-xl);
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.breathing-instructions {
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    line-height: 1.8;
    max-width: 500px;
}

.breathing-instructions p {
    margin-bottom: var(--space-sm);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .breathing-square {
        width: 300px;
        height: 300px;
    }
    
    .breathing-circle {
        width: 150px;
        height: 150px;
    }
    
    .counter-display {
        font-size: 4rem;
    }
}

/* Breathing Mantra Text */
.breathing-mantra {
    text-align: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg) 0;
}

.mantra-text {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5), 0 0 40px rgba(255, 255, 255, 0.3);
    letter-spacing: 0.05em;
    line-height: 1.4;
    margin: 0;
    font-family: var(--font-family);
}

@media (max-width: 768px) {
    .mantra-text {
        font-size: var(--font-size-xl);
    }
}

