/* ========================================
   TODO List Dropdown - Navbar
   ======================================== */

/* Container du dropdown TODO */
.todo-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

/* Bouton toggle */
.todo-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-muted, #a0a0a0);
    cursor: pointer;
    transition: all 0.2s ease;
}

.todo-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light, #fff);
    border-color: rgba(255, 255, 255, 0.2);
}

.todo-toggle i {
    font-size: 1rem;
}

/* Badge de notification */
.todo-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

/* Menu dropdown */
.todo-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 380px;
    max-height: 550px;
    background: linear-gradient(145deg, #1e1e1e 0%, #2a2a2a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.todo-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header du menu */
.todo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.todo-header h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.todo-header h4 i {
    color: var(--primary, #d4a84b);
    font-size: 0.85rem;
}

.todo-count {
    font-size: 0.7rem;
    color: var(--text-muted, #888);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

/* Formulaire d'ajout */
.todo-form {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.1);
}

.todo-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.todo-input-wrapper input {
    flex: 1;
    padding: 0.6rem 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s ease;
}

.todo-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.todo-input-wrapper input:focus {
    border-color: var(--primary, #d4a84b);
    background: rgba(255, 255, 255, 0.08);
}

/* Sélecteur de priorité */
.todo-priority-select {
    width: 45px;
    flex-shrink: 0;
    padding: 0.5rem 0.3rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    text-align: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.todo-priority-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.todo-priority-select:focus {
    border-color: var(--primary, #d4a84b);
}

.todo-priority-select option {
    background: #2a2520;
    color: #fff;
}

.todo-add-btn {
    padding: 0.6rem 0.875rem;
    background: linear-gradient(135deg, var(--primary, #d4a84b), #b8923d);
    border: none;
    border-radius: 8px;
    color: #1a1410;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.todo-add-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(212, 168, 75, 0.3);
}

.todo-add-btn i {
    font-size: 0.85rem;
}

/* Liste des todos */
.todo-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    max-height: 400px;
}

.todo-list::-webkit-scrollbar {
    width: 6px;
}

.todo-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.todo-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.todo-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Item de todo */
.todo-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    border-radius: 8px;
    margin-bottom: 0.35rem;
    transition: all 0.2s ease;
}

.todo-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.todo-item.completed {
    opacity: 0.5;
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
    color: var(--text-muted, #666);
}

/* Indicateurs de priorité */
.todo-item.priority-high {
    border-left: 3px solid #e74c3c;
}

.todo-item.priority-low {
    border-left: 3px solid #3498db;
}

.priority-indicator {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.priority-indicator.high {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.priority-indicator.low {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

/* Checkbox custom */
.todo-checkbox {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.todo-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.todo-checkbox .checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.todo-checkbox .checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s ease;
    margin-bottom: 2px;
}

.todo-checkbox input:checked + .checkmark {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border-color: #27ae60;
}

.todo-checkbox input:checked + .checkmark::after {
    transform: rotate(45deg) scale(1);
}

.todo-checkbox:hover .checkmark {
    border-color: rgba(255, 255, 255, 0.4);
}

/* Titre de la tâche */
.todo-title {
    flex: 1;
    font-size: 0.85rem;
    color: #e0e0e0;
    line-height: 1.3;
    word-break: break-word;
}

/* Bouton supprimer */
.todo-delete {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.todo-item:hover .todo-delete {
    opacity: 1;
}

.todo-delete:hover {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.todo-delete i {
    font-size: 0.7rem;
}

/* État vide */
.todo-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted, #666);
    text-align: center;
}

.todo-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.3;
}

.todo-empty p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 480px) {
    .todo-menu {
        position: fixed;
        top: 60px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: calc(100vh - 80px);
    }
}
