/**
 * BOARDROOM SHARED STYLES
 * 
 * Common CSS framework for MobileSentrix and Mission Control tabs.
 * Any styling updates here automatically apply to both views.
 * 
 * Organization:
 * 1. CSS Variables (Design System)
 * 2. Base Styles
 * 3. Typography
 * 4. Layout Components
 * 5. Task Cards
 * 6. Forms & Inputs
 * 7. Buttons
 * 8. Animations
 */

/* ========== 1. DESIGN SYSTEM VARIABLES ========== */
:root {
    /* Color Palette */
    --bg-primary: #0d0d12;
    --bg-secondary: #13131a;
    --bg-tertiary: #1a1a24;
    --bg-card: #1e1e2a;
    --bg-hover: #252532;
    --bg-active: #2a2a3a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;
    --border: #2a2a3a;
    --border-light: #353545;
    
    /* Accent Colors */
    --accent-red: #ef4444;
    --accent-red-hover: #f87171;
    --accent-green: #00d170;
    --accent-yellow: #f59e0b;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-cyan: #00b8e6;
    --accent-pink: #ec4899;
    --accent-orange: #f97316;
    
    /* Shadow System */
    --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);
    --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.12);
    --shadow-glow-green: 0 0 20px rgba(0, 209, 112, 0.12);
    
    /* Animation Timing Functions */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-in-out-cubic: cubic-bezier(0.65, 0, 0.35, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
}

/* Light Theme */
body.light-theme {
    --bg-primary: #f5f7fa;
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --bg-tertiary: #f0f2f5;
    --bg-card: #ffffff;
    --bg-hover: #f0f2f5;
    --bg-active: #e8eaed;
    --text-primary: #1a1a2e;
    --text-secondary: #5a5a72;
    --text-muted: #8a8aa0;
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.06);
    --accent-red: #dc2626;
    --accent-red-hover: #ef4444;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.12);
}

/* ========== 2. BASE STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ========== 3. TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

/* ========== 4. LAYOUT COMPONENTS ========== */

/* Stats Cards */
.stat-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:active {
    transform: scale(0.96);
}

.stat-icon {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.stat-icon.todo { background: rgba(245, 158, 11, 0.15); }
.stat-icon.progress { background: rgba(59, 130, 246, 0.15); }
.stat-icon.done { background: rgba(16, 185, 129, 0.15); }
.stat-icon.delegated { background: rgba(139, 92, 246, 0.15); }
.stat-icon.overdue { background: rgba(239, 68, 68, 0.15); }

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-value.todo { color: var(--accent-yellow); }
.stat-value.progress { color: var(--accent-blue); }
.stat-value.done { color: var(--accent-green); }
.stat-value.delegated { color: var(--accent-purple); }
.stat-value.overdue { color: var(--accent-red); }

.stat-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

/* ========== 5. TASK CARDS ========== */

.task-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s var(--ease-out-expo);
    border: 1px solid var(--border);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.task-card:active {
    transform: scale(0.98);
}

.task-checkbox {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-checkbox:hover {
    border-color: var(--accent-green);
}

.task-checkbox.checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.task-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.task-content {
    margin-left: 28px;
}

.task-title {
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.task-tag {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-active);
    color: var(--text-secondary);
}

.task-tag.urgent { 
    background: rgba(239, 68, 68, 0.2); 
    color: var(--accent-red); 
}

.task-tag.blocked { 
    background: rgba(239, 68, 68, 0.2); 
    color: var(--accent-red); 
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.task-due {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-due.overdue { color: var(--accent-red); }
.task-due.soon { color: var(--accent-yellow); }

/* ========== 6. FORMS & INPUTS ========== */

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s var(--ease-out-expo);
    outline: none;
    box-shadow: var(--shadow-sm);
}

.form-input:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.form-input:focus {
    border-color: var(--accent-green);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--shadow-glow-green);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Modern Select Dropdowns */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
    cursor: pointer;
}

select.form-input option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px;
}

/* Textarea styling */
textarea.form-input {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

/* ========== 7. BUTTONS ========== */

.btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.btn:active {
    transform: scale(0.96);
    opacity: 0.9;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: var(--accent-green);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: #00e080;
    box-shadow: var(--shadow-glow-green);
    transform: translateY(-1px);
}

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

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

/* ========== 8. ANIMATIONS ========== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Stagger animation delays */
.stagger-item {
    animation: fadeInUp 0.4s var(--ease-out-expo) both;
}

.stagger-item:nth-child(1) { animation-delay: 0.02s; }
.stagger-item:nth-child(2) { animation-delay: 0.04s; }
.stagger-item:nth-child(3) { animation-delay: 0.06s; }
.stagger-item:nth-child(4) { animation-delay: 0.08s; }
.stagger-item:nth-child(5) { animation-delay: 0.10s; }
.stagger-item:nth-child(6) { animation-delay: 0.12s; }
.stagger-item:nth-child(7) { animation-delay: 0.14s; }
.stagger-item:nth-child(8) { animation-delay: 0.16s; }

/* Smooth transitions */
* {
    transition-property: background-color, border-color, color;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

/* Better scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}
