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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.header h1 i {
    margin-right: 0.5rem;
    color: #ffd700;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Button Styles */
.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #28a745;
    color: white;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Toolbar Styles */
.toolbar {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn.active,
.view-btn:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.filter-options {
    display: flex;
    gap: 1rem;
}

.filter-options select {
    padding: 0.5rem 1rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: white;
}

/* Main Content */
.main-content {
    padding: 2rem;
}

.view-container {
    display: none;
}

.view-container.active {
    display: block;
}

/* Table View Styles */
.table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.task-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.task-table th,
.task-table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    font-size: 13px;
}

.task-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
}

.task-table tbody tr:hover {
    background: #f8f9fa;
}

/* Priority Badges */
.priority-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.priority-high {
    background: #dc3545;
    color: white;
}

.priority-medium {
    background: #ffc107;
    color: #212529;
}

.priority-low {
    background: #28a745;
    color: white;
}

/* Status Badges */
.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-planning {
    background: #6f42c1;
    color: white;
}

.status-in-progress {
    background: #007bff;
    color: white;
}

.status-review {
    background: #fd7e14;
    color: white;
}

.status-completed {
    background: #28a745;
    color: white;
}

.status-on-hold {
    background: #6c757d;
    color: white;
}

/* Progress Bar */
.progress-bar {
    width: 80px;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease;
}

/* Kanban Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.kanban-column {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    min-height: 500px;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
}

.column-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #495057;
}

.task-count {
    background: #007bff;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.column-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Task Card */
.task-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.task-card-title {
    font-weight: 600;
    color: #343a40;
}

.task-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #6c757d;
}

/* Timeline View */
.timeline-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
}

.timeline-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.timeline-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.timeline-controls button {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}

.timeline-content {
    padding: 2rem;
    min-height: 400px;
}

/* 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.3s ease;
}

.modal.show {
    display: block;
}

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

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

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

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Form Styles */
.task-form {
    padding: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

/* Action Buttons */
.action-btn {
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
}

.edit-btn {
    background: #007bff;
    color: white;
}

.edit-btn:hover {
    background: #0056b3;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 0;
    }
    
    .header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .toolbar {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .kanban-board {
        grid-template-columns: 1fr;
    }
}

/* Category Colors */
.category-development { border-left: 4px solid #007bff; }
.category-design { border-left: 4px solid #e83e8c; }
.category-planning { border-left: 4px solid #6f42c1; }
.category-marketing { border-left: 4px solid #fd7e14; }
.category-management { border-left: 4px solid #20c997; }
.category-testing { border-left: 4px solid #ffc107; }

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tree View Styles */
.tree-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    margin-right: 8px;
    border-radius: 3px;
    color: #6c757d;
    font-size: 12px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.tree-toggle:hover {
    background: #e9ecef;
    color: #495057;
}

.tree-toggle.expanded {
    color: #007bff;
}

.tree-spacer {
    display: inline-block;
    width: 28px;
}

.task-name {
    cursor: pointer;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.task-name:hover {
    background: #f8f9fa;
    color: #007bff;
}

.task-name.has-subtasks {
    color: #495057;
    font-weight: 600;
}

.task-name.has-subtasks:hover {
    color: #007bff;
}

.subtask-count {
    font-size: 0.75em;
    color: #6c757d;
    font-weight: normal;
    margin-left: 4px;
}

.task-row[data-level="1"] {
    background: #f8f9fa;
}

.task-row[data-level="1"] td {
    border-left: 3px solid #dee2e6;
    border-top: none;
}

.add-subtask-btn {
    background: #28a745;
    color: white;
    margin-left: 4px;
}

.add-subtask-btn:hover {
    background: #218838;
}

/* Tree animation */
.task-row {
    transition: all 0.3s ease;
}

.task-row:hover {
    background: #f8f9fa;
}

/* Kanban parent task indicator */
.parent-task {
    font-size: 0.75em;
    color: #6c757d;
    font-weight: normal;
    opacity: 0.8;
}