/* ========================================
   STYLES POUR RECHERCHE ET NOTIFICATIONS
   ======================================== */

/* --- BARRE DE RECHERCHE --- */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.75rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-align: center;
}
.search-input::placeholder {
    text-align: center;
}

.search-input:focus {
    outline: none;
    border-color: #444;
    background: var(--surface-hover);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.03);
    text-align: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}

/* --- RÉSULTATS DE RECHERCHE --- */
.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.search-section {
    padding: 0.75rem 0;
}

.search-section:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.search-section-title {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item:hover {
    background: var(--surface-hover);
}

.search-result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-name mark {
    background: rgba(255, 255, 0, 0.2);
    color: var(--text-primary);
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-empty,
.search-error {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

/* --- NOTIFICATIONS --- */
.notification-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-button:hover {
    background: var(--surface-hover);
    border-color: #444;
}

.notification-icon {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
}

/* --- PANNEAU DE NOTIFICATIONS --- */
.notification-panel {
    position: fixed;
    top: 80px;
    right: 2rem;
    width: 400px;
    max-height: 600px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.notification-panel.show {
    display: flex;
    animation: slideInRight 0.3s ease;
}

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

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.notification-panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.notification-mark-all {
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.notification-mark-all:hover {
    color: var(--text-primary);
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.notification-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
    border-left: 3px solid transparent;
}

.notification-item:hover {
    background: var(--surface-hover);
}

.notification-item.unread {
    background: rgba(255, 255, 255, 0.02);
    border-left-color: #10b981;
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notification-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.notification-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-secondary);
}

/* --- TOAST DE NOTIFICATION --- */
.notification-toast {
    position: fixed;
    top: 100px;
    right: 2rem;
    min-width: 300px;
    max-width: 400px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.notification-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-toast-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.notification-toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-toast-text {
    flex: 1;
}

.notification-toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notification-toast-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* --- UPLOAD DE FICHIERS --- */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #444;
    background: var(--surface-hover);
}

.upload-zone-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--text-secondary);
}

.upload-zone-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.upload-zone-hint {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.upload-progress {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.upload-progress-bar {
    height: 100%;
    background: #10b981;
    transition: width 0.3s ease;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .notification-panel {
        right: 1rem;
        left: 1rem;
        width: auto;
        max-height: 80vh;
    }

    .notification-toast {
        right: 1rem;
        left: 1rem;
        min-width: auto;
        max-width: none;
    }

    .search-container {
        padding: 0 1rem;
    }
}
