/* ==========================================
   PREMARKET COMPONENTS CSS
   Enhanced Pre-Market Blueprint Styles
   ========================================== */

/* Override for premarket page layout */
#premarket-page {
    max-width: 1400px;
    margin: 0 auto;
}

/* Component Containers */
.premarket-component {
    background: rgba(9, 9, 11, 0.6);
    border: 1px solid rgba(192, 132, 252, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Grid Layouts */
.premarket-top-row {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.premarket-middle-row {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .premarket-top-row,
    .premarket-middle-row {
        grid-template-columns: 1fr;
    }
}

/* Section Titles */
.premarket-section-title {
    color: #c084fc;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.premarket-section-title i {
    color: #c084fc;
}

/* Scenario Cards */
.scenario-card {
    position: relative;
    background: rgba(39, 39, 42, 0.4);
    border: 1px solid rgba(63, 63, 70, 0.4);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.scenario-card:hover {
    border-color: rgba(192, 132, 252, 0.4);
    transform: translateY(-2px);
}

.scenario-card.active {
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
}

.scenario-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #c084fc, transparent);
    border-radius: 12px 0 0 12px;
}

/* Status Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-primary {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-secondary {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.status-no_trade {
    background: rgba(113, 113, 122, 0.2);
    color: #71717a;
}

/* R:R Badges */
.rr-badge {
    font-weight: 700;
}

.rr-good {
    color: #22c55e;
}

.rr-ok {
    color: #f59e0b;
}

.rr-bad {
    color: #ef4444;
}

/* Action Badges */
.action-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.action-active {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
}

.action-wait {
    background: rgba(113, 113, 122, 0.2);
    color: #71717a;
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th {
    text-align: left;
    color: #71717a;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 10px;
    border-bottom: 1px solid rgba(63, 63, 70, 0.4);
}

.comparison-table td {
    color: #a1a1aa;
    font-size: 13px;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(63, 63, 70, 0.2);
}

.comparison-table tr:hover td {
    background: rgba(168, 85, 247, 0.05);
}

/* Risk Dashboard */
.risk-stat-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.risk-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.risk-stat-label {
    font-size: 9px;
    color: #52525b;
    text-transform: uppercase;
}

/* Progress Bar */
.progress-bar {
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

/* Streak Widget */
.streak-display {
    text-align: center;
    padding: 20px;
}

.streak-number {
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
}

.streak-fire {
    font-size: 48px;
}

/* Week Calendar */
.week-day {
    text-align: center;
    padding: 8px 5px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    flex: 1;
}

.week-day.completed {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.week-day.missed {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.week-day-name {
    font-size: 9px;
    font-weight: 600;
    color: #52525b;
}

.week-day-num {
    font-size: 16px;
    font-weight: 700;
    color: #a1a1aa;
}

/* Badge Pills */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* Buttons */
.premarket-btn {
    background: linear-gradient(135deg, #7e22ce, #a855f7);
    border: none;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.premarket-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(126, 34, 206, 0.4);
}

.premarket-btn-secondary {
    background: rgba(63, 63, 70, 0.3);
    border: 1px solid rgba(63, 63, 70, 0.5);
    color: #a1a1aa;
}

.premarket-btn-secondary:hover {
    background: rgba(63, 63, 70, 0.5);
    box-shadow: none;
}

/* Input Fields */
.premarket-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(63, 63, 70, 0.6);
    color: #fff;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.premarket-input:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.premarket-input.green {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.premarket-input.red {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.premarket-input.purple {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
    color: #c084fc;
}

/* Quick Stats Grid */
.quick-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .quick-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Debrief Section */
.debrief-stat-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.debrief-stat-value {
    font-size: 20px;
    font-weight: 800;
}

.debrief-stat-label {
    font-size: 9px;
    color: #52525b;
    text-transform: uppercase;
}

/* Tilt Warning */
.tilt-warning {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #18181b;
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: 16px;
    padding: 30px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-title {
    color: #fff;
    font-size: 20px;
    font-weight: 800;
}

.modal-close {
    background: none;
    border: none;
    color: #71717a;
    font-size: 24px;
    cursor: pointer;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    color: #a1a1aa;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

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

.loading {
    animation: pulse 1.5s infinite;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #52525b;
}

.empty-state i {
    font-size: 32px;
    margin-bottom: 10px;
}

.empty-state p {
    margin: 0;
    font-size: 13px;
}