:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* Navbar */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--card-bg);
    min-width: 160px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    z-index: 101;
    margin-top: 0.25rem;
}

/* Invisible bridge to prevent menu from closing when moving mouse */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
}

.dropdown-content a {
    color: var(--text-main);
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    font-size: 0.875rem;
}

.dropdown-content a:hover {
    background-color: var(--bg-color);
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
}

textarea {
    min-height: 100px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    font-size: 0.875rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

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

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

.btn-outline:hover {
    background-color: var(--bg-color);
}

/* Landing Page */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Dashboard & Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.project-grid-main {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

.project-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.project-card:hover {
    transform: translateY(-2px);
}

.status-done {
    background-color: #dcfce7 !important;
    color: #166534 !important;
}

.task-done-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Flatpickr Modern Customization */
.flatpickr-calendar {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 0.5rem !important;
}

.flatpickr-day.selected {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

/* Gantt Chart Styles */
.gantt-container {
    overflow-x: auto;
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.gantt-chart {
    min-width: 800px;
    position: relative;
}

.gantt-row {
    display: flex;
    align-items: center;
    height: 40px;
    border-bottom: 1px solid #f1f5f9;
}

.gantt-label {
    width: 200px;
    flex-shrink: 0;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 1rem;
}

.gantt-timeline {
    flex-grow: 1;
    position: relative;
    height: 100%;
}

.gantt-bar {
    position: absolute;
    height: 24px;
    top: 8px;
    border-radius: 4px;
    background-color: var(--primary-color);
    opacity: 0.8;
    min-width: 5px;
}

.gantt-bar-done {
    background-color: #10b981;
}

/* Responsive */
@media (max-width: 1024px) {
    .project-grid-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        text-align: center;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        margin: 1rem auto;
    }

    /* Stack grid-based forms in mobile */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}
