:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --accent-p2p: #10b981;
    --accent-otc: #f59e0b;
    --accent-rtr: #ec4899;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

header {
    padding: 2rem 4rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 1) 0%, rgba(15, 23, 42, 0) 100%);
    z-index: 10;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

main {
    flex: 1;
    padding: 0 4rem 4rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input, select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    align-self: flex-end;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.gantt-container {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    padding: 2rem;
    overflow-x: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.gantt-chart {
    min-width: 1000px;
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1px;
    background: var(--border);
}

.gantt-header {
    display: contents;
}

.gantt-header-cell {
    background: rgba(15, 23, 42, 0.8);
    padding: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 2px solid var(--primary);
}

.gantt-row {
    display: contents;
}

.activity-name {
    background: rgba(30, 41, 59, 0.5);
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    display: flex;
    align-items: center;
}

.timeline-cell {
    background: var(--glass-bg);
    position: relative;
    border-bottom: 1px solid var(--border);
    min-height: 80px;
}

.bar {
    position: absolute;
    height: 40px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar:hover {
    filter: brightness(1.2);
    transform: translateY(-50%) scale(1.02);
}

.bar.hiring { background: var(--accent-p2p); }
.bar.kt { background: var(--accent-otc); }
.bar.gp { background: var(--accent-rtr); }
.bar.pre-onboarding { background: var(--primary); }

.star-milestone {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: #fbbf24;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.8));
    z-index: 5;
}

.go-live-badge {
    background: white;
    color: var(--bg-dark);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.export-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.gantt-row {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Responsive Grid Helper */
.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(26, 1fr);
    pointer-events: none;
}

.grid-line {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

@media print {
    .controls, .export-actions, .ppt-close-btn {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
    .gantt-container, .gantt-chart, .activity-name, .timeline-cell {
        background: white !important;
        border-color: #ddd !important;
        box-shadow: none !important;
        color: black !important;
    }
    h1 {
        -webkit-text-fill-color: black !important;
    }
    .bar {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* PowerPoint Mode */
body.ppt-mode {
    background: #ffffff;
    color: #1e293b;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
}

.ppt-header-content, .ppt-footer {
    display: none;
}

.ppt-mode .ppt-header-content, .ppt-mode .ppt-footer {
    display: block;
}

.ppt-mode header, .ppt-mode .controls, .ppt-mode .export-actions {
    display: none !important;
}

.ppt-mode main {
    background: white;
    width: 95vw;
    height: 90vh;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    position: relative;
    display: flex;
    flex-direction: column;
    max-width: none;
    margin: 0;
}

.ppt-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 1rem;
}

.ppt-subtitle {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.ppt-mode .gantt-container {
    flex: 1;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: none;
    padding: 1rem;
    color: #1e293b;
}

.ppt-mode .gantt-chart {
    background: #f1f5f9;
}

.ppt-mode .activity-name {
    background: #f8fafc;
    color: #1e293b;
}

.ppt-mode .timeline-cell {
    background: white;
}

.ppt-mode .grid-line {
    border-right: 1px solid #e2e8f0;
}

.ppt-close-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    z-index: 1000;
    display: none;
}

.ppt-mode .ppt-close-btn {
    display: block;
}

.ppt-footer {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #94a3b8;
}
