:root {
    /* Colors */
    --bg-color: #f3f4f6;
    --sidebar-bg: rgba(255, 255, 255, 0.7);
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    
    /* Status Colors */
    --status-todo: #6b7280;
    --status-progress: #3b82f6;
    --status-review: #f59e0b;
    --status-done: #10b981;
    
    /* Priority Colors */
    --priority-high: #ef4444;
    --priority-med: #f59e0b;
    --priority-low: #10b981;
    
    /* UI Effects */
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #e0e7ff 0%, #f3f4f6 100%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: var(--glass-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    box-shadow: 2px 0 15px rgba(0,0,0,0.02);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.user-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-selector label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

select {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.8);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-links li a {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-links li a:hover {
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary);
}

.nav-links li.active a {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.75rem;
    font-weight: 600;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: inherit;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
    background: rgba(0,0,0,0.05);
    color: var(--text-main);
}

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

/* Views */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

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

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

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.08);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.text-blue { color: var(--status-progress); }
.text-yellow { color: var(--status-review); }
.text-green { color: var(--status-done); }

/* Table */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
}

.table-container {
    overflow-x: auto;
    padding: 1rem;
}

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

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

th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
}

tr:hover td {
    background: rgba(0,0,0,0.02);
}

/* Custom Table Columns styling */
#task-table {
    table-layout: auto;
}

#task-table th, #task-table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

#task-table th {
    white-space: nowrap;
}

/* Team column */
#task-table td:nth-child(1) {
    white-space: nowrap;
    font-weight: 600;
}

/* Task column */
#task-table td:nth-child(2) {
    min-width: 220px;
}

/* Priority column */
#task-table td:nth-child(3) {
    white-space: nowrap;
}

/* Start Date column */
#task-table td:nth-child(4) {
    white-space: nowrap;
}

/* End Date column */
#task-table td:nth-child(5) {
    white-space: nowrap;
}

/* Status column */
#task-table td:nth-child(6) {
    white-space: nowrap;
}

/* Owner column */
#task-table td:nth-child(7) {
    white-space: nowrap;
}

/* Objective column */
#task-table td:nth-child(8) {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Deliverable Link column */
#task-table td:nth-child(9) {
    white-space: nowrap;
}

/* Remark column */
#task-table td:nth-child(10) {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}



/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-status-todo { background: #f3f4f6; color: #4b5563; }
.badge-status-progress { background: #dbeafe; color: #1e40af; }
.badge-status-review { background: #fef3c7; color: #b45309; }
.badge-status-done { background: #d1fae5; color: #065f46; }
.badge-status-alwayson { background: #f3e8ff; color: #7e22ce; }

.priority-High { color: var(--priority-high); font-weight: bold; }
.priority-Medium { color: var(--priority-med); font-weight: bold; }
.priority-Low { color: var(--priority-low); font-weight: bold; }

/* Kanban Board */
.kanban-board {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    height: calc(100vh - 150px);
}

.kanban-column {
    flex: 1;
    min-width: 300px;
    background: rgba(243, 244, 246, 0.5);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.column-header {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.column-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot.blue { background: var(--status-progress); }
.dot.yellow { background: var(--status-review); }
.dot.green { background: var(--status-done); }
.dot.purple { background: #a855f7; }

.task-count {
    background: rgba(0,0,0,0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.column-body {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 150px;
}

/* Kanban Task Card */
.kanban-card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border-left: 4px solid var(--text-muted);
    cursor: grab;
    transition: var(--transition);
    position: relative;
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.kanban-card.priority-High { border-left-color: var(--priority-high); }
.kanban-card.priority-Medium { border-left-color: var(--priority-med); }
.kanban-card.priority-Low { border-left-color: var(--priority-low); }

.card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.card-team {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-owner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.owner-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: bold;
}

.edit-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}

.kanban-card:hover .edit-btn {
    opacity: 1;
}

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

/* Drag and Drop styles */
.kanban-card.dragging {
    opacity: 0.5;
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.column-body.drag-over {
    background: rgba(79, 70, 229, 0.05);
    border-radius: 8px;
    border: 2px dashed rgba(79, 70, 229, 0.3);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
}

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

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

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

input[type="text"], input[type="date"], textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
    background: rgba(255,255,255,0.8);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

/* Loader */
.loader-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(4px);
    display: none; /* Flex when active */
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.spinner {
    width: 40px; height: 40px;
    border: 4px solid rgba(79, 70, 229, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Deliverable Link styling */
.deliverable-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}
.deliverable-link:hover {
    text-decoration: underline;
}

/* Card quick link button */
.card-link-btn {
    opacity: 0.7;
    transition: var(--transition);
}
.card-link-btn:hover {
    opacity: 1;
    color: var(--primary);
}

/* Sidebar Toggle button styling */
.sidebar-toggle-btn {
    display: none;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
    display: block;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 260px;
        height: 100%;
        z-index: 1100;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: white;
        box-shadow: 4px 0 25px rgba(0,0,0,0.15);
    }
    
    .sidebar.active {
        transform: translateX(260px);
    }
    
    .main-content {
        padding: 1rem 1.25rem;
    }
    
    .sidebar-toggle-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: white;
        border: 1px solid rgba(0,0,0,0.1);
        border-radius: 8px;
        width: 40px;
        height: 40px;
        cursor: pointer;
        color: var(--text-main);
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        transition: var(--transition);
    }
    
    .sidebar-toggle-btn:hover {
        background: #f3f4f6;
    }

    .top-header {
        margin-bottom: 1.5rem;
    }
    
    /* Make global filters layout wrap better on mobile */
    .global-filters {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    
    .global-filters > div {
        width: 100%;
    }
    
    .global-filters button {
        width: 100%;
        margin-top: 0.5rem;
    }

    /* Modal size adjustment for mobile */
    .modal-content {
        max-width: 95%;
        padding: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    /* Kanban columns on mobile */
    .kanban-board {
        flex-direction: column;
        height: auto;
    }
    
    .kanban-column {
        min-width: 100%;
    }
}
