/**
 * Project Tracker - Main Stylesheet
 * Culligan ME IT Initiatives
 */

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-elevated: #f1f5f9;
    --bg-input: #f8fafc;
    --accent-primary: #0066cc;
    --accent-primary-light: rgba(0, 102, 204, 0.1);
    --accent-success: #059669;
    --accent-warning: #d97706;
    --accent-danger: #dc2626;
    --accent-purple: #7c3aed;
    --accent-pink: #db2777;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

a { color: var(--accent-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-elevated); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ==================== LOGIN PAGE ==================== */
.login-page { background: linear-gradient(135deg, #0066cc 0%, #004499 100%); }

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0066cc, #004499);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.logo-text { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.login-title { text-align: center; font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.login-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 32px; font-size: 14px; }
.login-footer { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); text-align: center; }

/* ==================== ALERTS ==================== */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }

/* ==================== APP LAYOUT ==================== */
.app-container { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    margin-bottom: 32px;
}

.sidebar .logo-icon { width: 40px; height: 40px; font-size: 16px; }
.sidebar .logo-text { font-size: 18px; }

.user-info {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.user-info-header { display: flex; align-items: center; gap: 12px; }

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-purple));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-avatar.small { width: 32px; height: 32px; font-size: 12px; }

.user-name { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.user-role { font-size: 12px; color: var(--text-muted); }

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
    text-decoration: none;
}

.logout-btn:hover { background: #fef2f2; border-color: #fecaca; color: #dc2626; text-decoration: none; }

.nav-section { margin-bottom: 24px; }
.nav-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); padding: 0 12px; margin-bottom: 8px; font-weight: 600; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); text-decoration: none; }
.nav-item.active { background: var(--accent-primary-light); color: var(--accent-primary); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }

.nav-badge {
    margin-left: auto;
    background: var(--accent-danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Main Content */
.main-content { flex: 1; margin-left: 260px; padding: 24px 32px; min-height: 100vh; }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.page-title { font-size: 28px; font-weight: 700; }
.page-subtitle { color: var(--text-secondary); margin-top: 4px; font-size: 14px; }

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary { background: var(--accent-primary); color: white; }
.btn-primary:hover { background: #0052a3; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

/* ==================== FORM ELEMENTS ==================== */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }

.form-input, .form-select, .form-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-textarea { min-height: 120px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* ==================== CARDS ==================== */
.card { background: var(--bg-card); border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin-bottom: 24px; }
.card-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.card-body { padding: 24px; }

/* ==================== STATS ==================== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 32px; }

.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.stat-card.blue::before { background: var(--accent-primary); }
.stat-card.purple::before { background: var(--accent-purple); }
.stat-card.orange::before { background: var(--accent-warning); }
.stat-card.green::before { background: var(--accent-success); }
.stat-card.pink::before { background: var(--accent-pink); }

.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 700; }

/* ==================== TABLES ==================== */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 14px 16px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 1px solid var(--border); font-weight: 600; white-space: nowrap; }
td { padding: 16px; border-bottom: 1px solid var(--border-light); font-size: 14px; color: var(--text-secondary); }
tr:hover { background: var(--bg-elevated); }
.project-title { font-weight: 600; color: var(--text-primary); max-width: 300px; }

/* ==================== BADGES ==================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }

.status-pending { background: #fef3c7; color: #92400e; }
.status-pending::before { background: #f59e0b; }
.status-estimation { background: #fce7f3; color: #9d174d; }
.status-estimation::before { background: #ec4899; }
.status-cab { background: #e0e7ff; color: #3730a3; }
.status-cab::before { background: #6366f1; }
.status-approved { background: #dbeafe; color: #1e40af; }
.status-approved::before { background: #3b82f6; }
.status-in-progress { background: #ede9fe; color: #5b21b6; }
.status-in-progress::before { background: #8b5cf6; }
.status-uat { background: #fce7f3; color: #9d174d; }
.status-uat::before { background: #ec4899; }
.status-complete { background: #d1fae5; color: #065f46; }
.status-complete::before { background: #10b981; }
.status-on-hold { background: #f1f5f9; color: #475569; }
.status-on-hold::before { background: #64748b; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-cancelled::before { background: #ef4444; }

.priority-badge { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.priority-high { background: #fee2e2; color: #dc2626; }
.priority-medium { background: #fef3c7; color: #d97706; }
.priority-low { background: #f1f5f9; color: #64748b; }

/* ==================== ACTION BUTTONS ==================== */
.action-btn { padding: 8px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; margin-right: 6px; }
.action-btn.approve { background: var(--accent-success); color: white; }
.action-btn.approve:hover { background: #047857; }
.action-btn.view { background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border); }
.action-btn.view:hover { background: var(--border); }
.action-btn.hold { background: #64748b; color: white; }
.action-btn.hold:hover { background: #475569; }

/* ==================== TABS ==================== */
.tabs { display: flex; gap: 4px; background: var(--bg-elevated); padding: 4px; border-radius: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.tab { padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; color: var(--text-secondary); background: transparent; border: none; text-decoration: none; }
.tab:hover { color: var(--text-primary); text-decoration: none; }
.tab.active { background: white; color: var(--text-primary); box-shadow: var(--shadow-sm); }

/* ==================== MODALS ==================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card);
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 24px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 20px; font-weight: 700; }

.modal-close {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--bg-elevated);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover { background: #fee2e2; color: #dc2626; }
.modal-body { padding: 24px; }

.info-box {
    background: var(--bg-elevated);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.info-box h4 { margin-bottom: 8px; }
.info-box p { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }

/* ==================== QUEUE ==================== */
.queue-columns { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 16px; }

.queue-column {
    background: var(--bg-elevated);
    border-radius: 16px;
    padding: 20px;
    min-width: 320px;
    flex-shrink: 0;
}

.queue-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.queue-dev-info { display: flex; align-items: center; gap: 10px; }
.queue-title { font-size: 14px; font-weight: 600; }
.queue-count { background: white; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; color: var(--text-muted); border: 1px solid var(--border); }

.queue-items { display: flex; flex-direction: column; gap: 12px; }

.queue-item {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.queue-item:hover { border-color: var(--accent-primary); box-shadow: var(--shadow); }

.queue-item-sequence {
    width: 24px; height: 24px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.queue-item-content { flex: 1; min-width: 0; }
.queue-item-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.queue-item-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }

.queue-empty { text-align: center; padding: 20px; color: var(--text-muted); font-size: 13px; }

/* ==================== DEV GRID ==================== */
.dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }

.dev-card { background: var(--bg-card); border-radius: 16px; padding: 24px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.dev-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.dev-avatar { width: 48px; height: 48px; border-radius: 12px; font-size: 16px; }
.dev-name { font-size: 16px; font-weight: 600; }
.dev-role { font-size: 12px; color: var(--text-muted); }

.dev-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dev-stat { text-align: center; padding: 12px; background: var(--bg-elevated); border-radius: 10px; }
.dev-stat-value { font-size: 20px; font-weight: 700; }
.dev-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; margin-top: 4px; font-weight: 600; }

/* ==================== GANTT CHART ==================== */
.gantt-controls { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.gantt-zoom { display: flex; align-items: center; gap: 4px; background: var(--bg-elevated); padding: 4px; border-radius: 8px; }
.gantt-zoom button { padding: 8px 12px; border: none; background: transparent; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-secondary); transition: all 0.2s; }
.gantt-zoom button.active { background: white; color: var(--accent-primary); box-shadow: var(--shadow-sm); }
.gantt-zoom button:hover:not(.active) { color: var(--text-primary); }

.gantt-wrapper { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.gantt-container { min-width: 100%; display: inline-block; }
.gantt-header { display: flex; border-bottom: 2px solid var(--border); background: var(--bg-elevated); position: sticky; top: 0; z-index: 10; }
.gantt-header-label { width: 280px; min-width: 280px; padding: 16px 20px; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-right: 1px solid var(--border); background: var(--bg-elevated); position: sticky; left: 0; z-index: 11; }
.gantt-header-timeline { display: flex; flex: 1; }
.gantt-month-group { display: flex; flex-direction: column; }
.gantt-month-label { text-align: center; padding: 8px; font-size: 12px; font-weight: 700; color: var(--text-primary); background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
.gantt-days { display: flex; }
.gantt-day { text-align: center; font-size: 11px; color: var(--text-muted); padding: 8px 0; border-right: 1px solid var(--border-light); flex-shrink: 0; }
.gantt-day.weekend { background: #fef3c7; }
.gantt-day.today { background: var(--accent-primary-light); color: var(--accent-primary); font-weight: 700; }
.gantt-day-num { font-weight: 600; font-size: 13px; }
.gantt-day-name { font-size: 10px; margin-top: 2px; }

.gantt-body { background: white; }
.gantt-row { display: flex; border-bottom: 1px solid var(--border-light); transition: background 0.2s; }
.gantt-row:hover { background: var(--bg-elevated); }
.gantt-row:hover .gantt-label { background: var(--bg-elevated); }

.gantt-label { width: 280px; min-width: 280px; padding: 12px 20px; border-right: 1px solid var(--border); display: flex; align-items: center; gap: 12px; background: white; position: sticky; left: 0; z-index: 5; }
.gantt-label-content { flex: 1; min-width: 0; }
.gantt-label-title { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-label-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 8px; }

.gantt-timeline { display: flex; flex: 1; position: relative; min-height: 50px; align-items: center; }
.gantt-cell { flex-shrink: 0; height: 100%; border-right: 1px solid var(--border-light); }
.gantt-cell.weekend { background: #fffbeb; }

.gantt-bar {
    position: absolute; height: 32px; border-radius: 6px;
    display: flex; align-items: center; padding: 0 12px;
    font-size: 11px; font-weight: 600; color: white;
    white-space: nowrap; overflow: hidden; cursor: pointer;
    transition: all 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    top: 50%; transform: translateY(-50%);
}

.gantt-bar:hover { transform: translateY(-50%) scale(1.02); box-shadow: 0 4px 8px rgba(0,0,0,0.15); z-index: 10; }
.gantt-bar.high { background: linear-gradient(135deg, #ef4444, #dc2626); }
.gantt-bar.medium { background: linear-gradient(135deg, #f59e0b, #d97706); }
.gantt-bar.low { background: linear-gradient(135deg, #64748b, #475569); }
.gantt-bar-text { position: relative; z-index: 1; }

.gantt-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent-primary); z-index: 8; }
.gantt-today-line::before { content: 'Today'; position: absolute; top: -24px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 600; color: var(--accent-primary); background: white; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }

/* ==================== EMPTY STATE ==================== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }

/* ==================== TOAST ==================== */
.toast {
    position: fixed; bottom: 24px; right: 24px;
    background: white; border: 1px solid var(--border);
    padding: 16px 24px; border-radius: 12px;
    display: flex; align-items: center; gap: 12px;
    transform: translateY(100px); opacity: 0;
    transition: all 0.3s; z-index: 2000;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 4px solid var(--accent-success); }
.toast.error { border-left: 4px solid var(--accent-danger); }

/* ==================== UTILITIES ==================== */
.text-muted { color: var(--text-muted); }
.text-small { font-size: 12px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .sidebar { width: 70px; padding: 16px 8px; }
    .sidebar .logo-text, .nav-section-title, .nav-item span, .user-info-header > div:last-child, .logout-btn span { display: none; }
    .nav-item { justify-content: center; padding: 12px; }
    .user-info { padding: 8px; }
    .user-info-header { justify-content: center; }
    .logout-btn { padding: 10px; }
    .main-content { margin-left: 70px; padding: 16px; }
    .page-title { font-size: 24px; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-value { font-size: 24px; }
    .page-header { flex-direction: column; align-items: flex-start; }
}
