/* assets/style.css - Design moderne et ergonomique */

/* --- Variables de couleurs --- */
:root {
    --primary: #6C63FF;
    --primary-dark: #5A52D5;
    --primary-light: #8B83FF;
    --secondary: #FF6584;
    --success: #2ED573;
    --warning: #FFA502;
    --danger: #FF4757;
    --dark: #2D3436;
    --gray: #636E72;
    --light-gray: #DFE6E9;
    --bg: #F0F2F5;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 15px 40px rgba(108, 99, 255, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base --- */
* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--dark);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* --- Typographie --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* --- Barre de navigation moderne --- */
.navbar-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 0.8rem 1.5rem;
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.3);
    border: none;
    border-radius: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-custom .navbar-brand {
    color: white !important;
    font-weight: 700;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.navbar-custom .navbar-brand .badge-version {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 500;
}

.navbar-custom .btn {
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition);
    border: none;
}

.navbar-custom .btn-outline-light {
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: transparent;
}

.navbar-custom .btn-outline-light:hover {
    background: white;
    color: var(--primary);
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.navbar-custom .btn-success-custom {
    background: white;
    color: var(--primary);
    font-weight: 600;
}

.navbar-custom .btn-success-custom:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.navbar-custom .btn-light-custom {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar-custom .btn-light-custom:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.navbar-custom .btn-group-custom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

/* --- Conteneur principal --- */
.main-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 2rem;
}

/* --- En-tête de section --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.section-header .badge-count {
    background: var(--primary);
    color: white;
    padding: 0.3rem 0.9rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* --- Carte moderne --- */
.card-modern {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    transition: var(--transition);
    border: none;
}

.card-modern:hover {
    box-shadow: var(--card-shadow-hover);
}

/* --- Calendrier FullCalendar --- */
#calendar-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

#calendar {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--card-shadow);
}

.fc {
    font-family: 'Inter', sans-serif;
}

.fc .fc-toolbar {
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fc .fc-toolbar-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark);
}

.fc .fc-button {
    background: var(--bg);
    border: none;
    color: var(--dark);
    border-radius: 50px;
    padding: 0.4rem 1rem;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: none;
}

.fc .fc-button:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: var(--primary);
    color: white;
}

.fc .fc-daygrid-day {
    border: 1px solid var(--light-gray);
    transition: var(--transition);
}

.fc .fc-daygrid-day:hover {
    background: rgba(108, 99, 255, 0.03);
}

.fc .fc-daygrid-day-number {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.4rem 0.6rem;
}

.fc .fc-day-other .fc-daygrid-day-number {
    color: var(--gray);
    opacity: 0.5;
}

.fc .fc-daygrid-day-events {
    padding: 0 4px 4px;
}

.fc .fc-event {
    border: none;
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.fc .fc-event:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.fc .fc-event .fc-event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Carte des événements du jour (sidebar) --- */
.events-day-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.2rem;
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.events-day-card h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.events-day-card .event-mini {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    background: var(--bg);
    margin-bottom: 0.5rem;
    transition: var(--transition);
    cursor: pointer;
}

.events-day-card .event-mini:hover {
    background: rgba(108, 99, 255, 0.08);
    transform: translateX(4px);
}

.events-day-card .event-mini .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.events-day-card .event-mini .time {
    font-size: 0.75rem;
    color: var(--gray);
    font-weight: 500;
    flex-shrink: 0;
}

.events-day-card .event-mini .title {
    font-size: 0.85rem;
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.events-day-card .empty-message {
    color: var(--gray);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem 0;
}

/* --- Liste des tâches (page liste) --- */
.tasks-wrapper {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
}

.tasks-wrapper .table {
    margin-bottom: 0;
}

.tasks-wrapper .table th {
    background: var(--bg);
    border: none;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray);
    padding: 0.8rem 0.6rem;
}

.tasks-wrapper .table td {
    border-bottom: 1px solid var(--light-gray);
    padding: 0.8rem 0.6rem;
    vertical-align: middle;
    font-size: 0.9rem;
}

.tasks-wrapper .table tr:hover td {
    background: rgba(108, 99, 255, 0.02);
}

.tasks-wrapper .table .badge {
    font-weight: 500;
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
}

.tasks-wrapper .table .btn-group-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.tasks-wrapper .table .btn {
    border-radius: 10px;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    transition: var(--transition);
}

.tasks-wrapper .table .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* --- Filtres (page liste) --- */
.filters-wrapper {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.2rem 1.5rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.filters-wrapper .form-control,
.filters-wrapper .form-select {
    border-radius: 50px;
    border: 2px solid var(--light-gray);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--bg);
}

.filters-wrapper .form-control:focus,
.filters-wrapper .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}

.filters-wrapper .btn-secondary-custom {
    border-radius: 50px;
    background: var(--light-gray);
    border: none;
    color: var(--dark);
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: var(--transition);
}

.filters-wrapper .btn-secondary-custom:hover {
    background: var(--gray);
    color: white;
    transform: translateY(-2px);
}

/* --- Modales modernes --- */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 1.2rem 1.8rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-header .modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 1.8rem;
}

.modal-footer {
    border: none;
    padding: 1rem 1.8rem 1.8rem;
}

.modal .btn-primary-custom {
    background: var(--primary);
    border: none;
    border-radius: 50px;
    padding: 0.6rem 2rem;
    font-weight: 600;
    transition: var(--transition);
    color: white;
}

.modal .btn-primary-custom:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.modal .btn-secondary-custom {
    border-radius: 50px;
    background: var(--light-gray);
    border: none;
    color: var(--dark);
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: var(--transition);
}

.modal .btn-secondary-custom:hover {
    background: var(--gray);
    color: white;
}

.modal .form-control,
.modal .form-select {
    border-radius: 12px;
    border: 2px solid var(--light-gray);
    padding: 0.6rem 1rem;
    transition: var(--transition);
}

.modal .form-control:focus,
.modal .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}

.modal .form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--gray);
}

/* --- Toasts de notification --- */
.toast-notification {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.3);
    margin-bottom: 0.8rem;
    font-weight: 500;
    animation: slideInRight 0.4s ease-out;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    backdrop-filter: blur(10px);
}

.toast-notification .toast-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    margin-left: auto;
}

.toast-notification .toast-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#toastContainer {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 420px;
    width: calc(100% - 40px);
}

/* --- Badges de priorité --- */
.badge-priority-high {
    background: var(--danger);
    color: white;
}
.badge-priority-medium {
    background: var(--warning);
    color: white;
}
.badge-priority-low {
    background: var(--success);
    color: white;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    #calendar-wrapper {
        grid-template-columns: 1fr;
    }
    
    .events-day-card {
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .navbar-custom {
        padding: 0.5rem 1rem;
    }
    
    .navbar-custom .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-custom .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.8rem;
    }
    
    .navbar-custom .btn-group-custom {
        gap: 0.3rem;
    }
    
    .main-container {
        padding: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    #calendar {
        padding: 0.5rem;
    }
    
    .fc .fc-toolbar-title {
        font-size: 1.1rem;
    }
    
    .fc .fc-button {
        font-size: 0.7rem;
        padding: 0.2rem 0.7rem;
    }
    
    .fc .fc-daygrid-day {
        min-height: 50px;
    }
    
    .fc .fc-daygrid-day-number {
        font-size: 0.7rem;
        padding: 0.2rem;
    }
    
    .fc .fc-event {
        font-size: 0.55rem;
        padding: 1px 4px;
        border-radius: 4px;
    }
    
    .tasks-wrapper {
        padding: 0.8rem;
        overflow-x: auto;
    }
    
    .tasks-wrapper .table {
        font-size: 0.75rem;
    }
    
    .tasks-wrapper .table .btn {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
        min-height: 28px;
    }
    
    .filters-wrapper {
        padding: 0.8rem 1rem;
    }
    
    .filters-wrapper .form-control,
    .filters-wrapper .form-select {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 0.8rem 1.2rem;
    }
    
    .modal-body {
        padding: 1.2rem;
    }
    
    .modal-footer {
        padding: 0.8rem 1.2rem 1.2rem;
    }
    
    .modal .btn {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
    
    #toastContainer {
        top: 70px;
        right: 10px;
        max-width: calc(100% - 20px);
    }
    
    .toast-notification {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 400px) {
    .navbar-custom .navbar-brand {
        font-size: 0.9rem;
    }
    
    .navbar-custom .navbar-brand .badge-version {
        display: none;
    }
    
    .navbar-custom .btn {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    
    .fc .fc-toolbar-title {
        font-size: 0.9rem;
    }
    
    .fc .fc-daygrid-day {
        min-height: 40px;
    }
    
    .fc .fc-event {
        font-size: 0.45rem;
        padding: 1px 3px;
    }
}