:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --badge-bg: #dcfce7;
    --badge-text: #166534;
    --error: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 0.5rem;
    --font-family: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.card {
    background-color: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
}

.sidebar {
    flex: 0 0 300px;
}

.output-area {
    flex: 1;
    min-width: 0; /* Prevents overflow in flex child */
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

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

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: var(--font-family);
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 0.5rem;
}

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

.btn-primary:active {
    transform: translateY(1px);
}

.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.75rem;
    min-height: 1.25rem;
}

/* Output Area */
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.badge {
    background-color: var(--badge-bg);
    color: var(--badge-text);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.hidden {
    display: none !important;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

/* Gantt Chart */
.gantt-section {
    margin-bottom: 3rem;
}

.gantt-section h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    color: var(--text-muted);
}

.gantt-container {
    width: 100%;
    padding: 0 1rem 1rem 1rem;
}

.gantt-chart {
    display: flex;
    border: 1px solid var(--primary);
    border-radius: 4px;
    height: 2.5rem;
    background-color: #eff6ff;
    width: 100%;
}

.gantt-block {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--primary);
    font-weight: 600;
    color: var(--primary);
    transition: background-color 0.2s;
}

.gantt-block:last-child {
    border-right: none;
}

.gantt-block:hover {
    background-color: #dbeafe;
}

.gantt-timeline {
    display: flex;
    position: relative;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    width: 100%;
}

.time-marker {
    position: absolute;
    transform: translateX(-50%);
}

/* Table */
.table-section {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--text-muted);
    background-color: #f8fafc;
}

tbody tr:hover {
    background-color: #f1f5f9;
}

tfoot {
    font-weight: 600;
}

tfoot td {
    border-bottom: none;
    border-top: 2px solid var(--border);
}

.text-right {
    text-align: right;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        flex: none;
    }
}
