/* ============================================
   KANBAN PRO - CSS Complet
   ============================================ */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4361ee;
    --primary-dark: #3451d1;
    --secondary: #7209b7;
    --success: #06d6a0;
    --danger: #ef476f;
    --warning: #ffd60a;
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #adb5bd;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #343a40;
    --gray-800: #212529;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

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

.navbar-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    color: var(--gray-600);
    font-size: 0.875rem;
}

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

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--gray-800);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

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

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
}

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

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-add {
    background: transparent;
    border: 1px dashed var(--gray-300);
    color: var(--gray-500);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 2rem;
}

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

.auth-footer {
    text-align: center;
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-top: 1rem;
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

/* Alerts */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
}

.alert-danger {
    background: #fee;
    color: var(--danger);
    border: 1px solid #fcc;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-800);
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Boards Grid */
.boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.board-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.board-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.board-card-header h3 {
    font-size: 1.125rem;
    color: var(--gray-800);
}

.board-card-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.board-card-footer {
    display: flex;
    gap: 0.75rem;
}

/* Board List */
.board-list {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.board-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

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

.board-item:hover {
    background: var(--gray-50);
}

.board-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.board-arrow {
    font-size: 1.5rem;
    color: var(--gray-400);
}

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

.badge-owner {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-member {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Kanban Container */
.kanban-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem;
}

.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.kanban-header h1 {
    font-size: 1.75rem;
}

.kanban-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

#filterInput {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    width: 250px;
}

/* Kanban Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.kanban-column {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 1rem;
    min-height: 500px;
}

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

.column-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.task-count {
    display: inline-block;
    background: white;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.column-tasks {
    min-height: 200px;
}

/* Task Card */
.task-card {
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: grab;
    transition: box-shadow 0.2s, transform 0.2s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.task-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

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

.task-card.dragging {
    opacity: 0.5;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
    z-index: 1000;
}

.task-handle {
    cursor: grab;
    color: var(--gray-400);
    margin-right: 0.5rem;
}

.task-title {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.task-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.task-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--gray-200);
    color: var(--gray-700);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.modal-content form {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
    margin-top: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-600);
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Utilities */
.text-muted {
    color: var(--gray-600);
}

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

.section {
    margin-bottom: 3rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .navbar-menu {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .navbar-user {
        flex-direction: column;
        align-items: stretch;
    }
    
    .kanban-board {
        grid-template-columns: 1fr;
    }
    
    .kanban-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .kanban-actions {
        flex-direction: column;
    }
    
    #filterInput {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
