/* Command Center Dark Theme Overrides for Waves & Projects */
/* These override the light theme in waves.css for the CC dark theme */

/* =============================================
   WAVE PLAN SUMMARY - Dark Theme
   ============================================= */

body.cc-theme .wave-plan-summary {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.cc-theme .summary-title h3 {
    color: var(--cc-accent-green, #10b981);
}

body.cc-theme .summary-stats-grid .summary-stat,
body.cc-theme .summary-stat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--cc-border-subtle, rgba(255,255,255,0.08));
    box-shadow: none;
}

body.cc-theme .stat-value {
    color: var(--cc-text-primary, #f1f5f9);
}

body.cc-theme .stat-label {
    color: var(--cc-text-muted, #94a3b8);
}

body.cc-theme .summary-date {
    color: var(--cc-text-secondary, #94a3b8);
}

body.cc-theme .summary-alert.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--cc-accent-green, #10b981);
}

body.cc-theme .summary-alert.warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

/* =============================================
   WAVES GRID - Dark Theme
   ============================================= */

body.cc-theme .waves-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* =============================================
   WAVE CARD - Dark Theme
   ============================================= */

body.cc-theme .wave-card {
    background: var(--cc-bg-surface, #0f1419);
    border: 1px solid var(--cc-border-subtle, rgba(255,255,255,0.08));
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.cc-theme .wave-card:hover {
    border-color: var(--cc-border-medium, rgba(255,255,255,0.15));
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* Wave Card Header - Dark gradient (within caps) */
body.cc-theme .wave-card-header {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.08) 100%);
    padding: 1rem 1.25rem;
    border-bottom: 2px solid rgba(16, 185, 129, 0.4);
}

body.cc-theme .wave-number {
    color: var(--cc-accent-green, #10b981);
}

/* Over capacity - Red/coral header */
body.cc-theme .wave-card.over-cap {
    border-color: rgba(239, 68, 68, 0.5);
}

body.cc-theme .wave-card.over-cap .wave-card-header {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
    border-bottom-color: rgba(239, 68, 68, 0.5);
}

body.cc-theme .wave-card.over-cap .wave-number {
    color: var(--cc-accent-red, #ef4444);
}

body.cc-theme .wave-card.over-cap .cap-label,
body.cc-theme .wave-card.over-cap .cap-value {
    color: var(--cc-accent-red, #ef4444);
}

/* Revisit wave - Amber header */
body.cc-theme .wave-card.revisit-wave .wave-card-header {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(251, 191, 36, 0.1) 100%);
    border-bottom-color: rgba(251, 191, 36, 0.5);
}

body.cc-theme .wave-card.revisit-wave .wave-number {
    color: #fbbf24;
}

/* Cap Indicators - Dark theme */
body.cc-theme .cap-indicator {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
}

body.cc-theme .cap-label {
    color: var(--cc-text-secondary, #94a3b8);
}

body.cc-theme .cap-label .cap-value,
body.cc-theme .cap-value {
    color: var(--cc-text-primary, #f1f5f9);
    font-weight: 600;
}

body.cc-theme .cap-bar {
    background: rgba(255, 255, 255, 0.1);
}

/* Cap fill gradients - keep the colors vivid */
body.cc-theme .cap-fill.safe { background: #10b981; }
body.cc-theme .cap-fill.warning { background: #f59e0b; }
body.cc-theme .cap-fill.danger { background: #ef4444; }
body.cc-theme .cap-fill.over { background: #dc2626; }

/* Wave Card Body */
body.cc-theme .wave-card-body {
    background: var(--cc-bg-surface, #0f1419);
    min-height: 80px;
}

/* App Chip - Dark theme */
body.cc-theme .wave-app-chip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--cc-border-subtle, rgba(255,255,255,0.08));
    border-radius: 10px;
    color: var(--cc-text-primary, #f1f5f9);
}

body.cc-theme .wave-app-chip:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--cc-accent-purple, #a855f7);
}

body.cc-theme .wave-app-chip .app-name {
    color: var(--cc-text-primary, #f1f5f9);
}

body.cc-theme .wave-app-chip .app-badges .badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--cc-text-secondary, #94a3b8);
    border: none;
}

body.cc-theme .wave-app-chip .points-badge {
    background: rgba(168, 85, 247, 0.2);
    color: var(--cc-accent-purple, #a855f7);
}

body.cc-theme .wave-app-chip.zero-cost {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

/* Wave Card Footer */
body.cc-theme .wave-card-footer {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--cc-border-subtle, rgba(255,255,255,0.08));
}

body.cc-theme .wave-details-btn {
    color: var(--cc-text-secondary, #94a3b8);
    background: transparent;
    border: none;
}

body.cc-theme .wave-details-btn:hover {
    color: var(--cc-accent-purple, #a855f7);
}

/* =============================================
   PROJECT CARDS - Dark Theme
   ============================================= */

body.cc-theme .project-option {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--cc-border-subtle, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

body.cc-theme .project-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--cc-border-medium, rgba(255,255,255,0.15));
}

body.cc-theme .project-option .project-info strong {
    color: var(--cc-text-primary, #f1f5f9);
    display: block;
    margin-bottom: 4px;
}

body.cc-theme .project-option .project-date {
    color: var(--cc-text-muted, #64748b);
    font-size: 0.85rem;
}

body.cc-theme .project-option .project-actions {
    display: flex;
    gap: 8px;
}

body.cc-theme .project-option .btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

body.cc-theme .project-option .btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--cc-border-subtle, rgba(255,255,255,0.08));
    color: var(--cc-text-secondary, #94a3b8);
}

body.cc-theme .project-option .btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--cc-text-primary, #f1f5f9);
}

body.cc-theme .project-option .btn.primary {
    background: var(--cc-gradient-accent, linear-gradient(135deg, #a855f7, #6366f1));
    border: none;
    color: white;
}

body.cc-theme .project-option .btn.primary:hover {
    filter: brightness(1.1);
}

/* R-Factor Pills - Dark theme */
body.cc-theme .rf-pill {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

body.cc-theme .rf-pill.zero-cost {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

body.cc-theme .rfactor-label {
    color: var(--cc-text-secondary, #94a3b8);
}

/* Loading state */
body.cc-theme .loading {
    color: var(--cc-text-secondary, #94a3b8);
    padding: 2rem;
    text-align: center;
}

body.cc-theme .muted {
    color: var(--cc-text-muted, #64748b);
}

body.cc-theme .error {
    color: var(--cc-accent-red, #ef4444);
}

/* =============================================
   DRAG AND DROP STATES
   ============================================= */

body.cc-theme .wave-card.drag-over {
    border-color: var(--cc-accent-purple, #a855f7);
    background: rgba(168, 85, 247, 0.05);
}

body.cc-theme .wave-app-chip.dragging {
    opacity: 0.5;
}

/* =============================================
   ICON VISIBILITY FIX
   ============================================= */

body.cc-theme .project-option .sw-icon,
body.cc-theme .wave-card .sw-icon,
body.cc-theme .wave-app-chip .sw-icon,
body.cc-theme .btn .sw-icon,
body.cc-theme .loading .sw-icon {
    width: 1em;
    height: 1em;
    stroke: currentColor;
    fill: none;
    display: inline-block;
    vertical-align: -0.125em;
}

/* Fallback for FA icons that weren't replaced */
body.cc-theme .project-option i[class*="fa-"],
body.cc-theme .wave-card i[class*="fa-"],
body.cc-theme .btn i[class*="fa-"] {
    display: inline-block;
    width: 1em;
    height: 1em;
}

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

@media (max-width: 768px) {
    body.cc-theme .waves-grid {
        grid-template-columns: 1fr;
    }
    
    body.cc-theme .project-option {
        flex-direction: column;
        align-items: stretch;
    }
    
    body.cc-theme .project-option .project-actions {
        justify-content: flex-end;
    }
}

/* =============================================
   AUTH MODAL - NO SCROLL
   Final override loaded last
   ============================================= */
   
#auth-modal .cc-modal-content,
#register-modal .cc-modal-content {
    max-height: none !important;
    overflow: visible !important;
}