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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.controls {
    background: white;
    padding: 20px;
    border-bottom: 2px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.controls h1 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 28px;
}

.control-group {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.date-controls, .action-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.zoom-info {
    display: flex;
    align-items: center;
    margin-left: 20px;
    font-size: 14px;
}

#zoomLevel {
    font-weight: 600;
    color: #2c3e50;
}

label {
    font-weight: 500;
    font-size: 14px;
}

input, button, select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

input[type="date"], input[type="number"], input[type="text"], select {
    background: white;
    margin-left: 8px;
}

input:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

button {
    background: #3498db;
    color: white;
    cursor: pointer;
    border: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

button:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

.gantt-wrapper {
    flex: 1;
    display: flex;
    background: white;
    margin: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.task-labels {
    width: 250px;
    background: #f8f9fa;
    border-right: 2px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.labels-header {
    height: 60px;
    background: #34495e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.labels-content {
    flex: 1;
    overflow-y: auto;
}

.task-label {
    height: 50px;
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.task-label:hover {
    background: #e9ecef;
}

.task-label.selected {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.task-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.task-name {
    flex: 1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-status {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
}

.status-not-started { background: #6c757d; }
.status-in-progress { background: #ffc107; color: #000; }
.status-completed { background: #28a745; }
.status-on-hold { background: #dc3545; }

.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#ganttCanvas {
    display: block;
    cursor: grab;
    background: white;
}

#ganttCanvas:active {
    cursor: grabbing;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 500px;
    max-width: 90%;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s ease;
}

.close:hover {
    color: #333;
}

.modal h2 {
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-left: 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

.modal-actions button {
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 600;
}

#deleteTask {
    background: #dc3545;
}

#deleteTask:hover {
    background: #c82333;
}

#cancelTask {
    background: #6c757d;
}

#cancelTask:hover {
    background: #5a6268;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    min-width: 150px;
}

.menu-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: #f8f9fa;
}

.menu-item[data-action="delete"]:hover {
    background: #fff5f5;
    color: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
    .control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .date-controls, .action-controls {
        justify-content: center;
    }
    
    .gantt-wrapper {
        margin: 10px;
        flex-direction: column;
    }
    
    .task-labels {
        width: 100%;
        max-height: 200px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

/* Scrollbar Styling */
.labels-content::-webkit-scrollbar {
    width: 6px;
}

.labels-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.labels-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.labels-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

#jsonOutput::-webkit-scrollbar {
    width: 8px;
}

#jsonOutput::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#jsonOutput::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#jsonOutput::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}