/**
 * Author: MAKATANGA
 * Telegram: @MAKATANGA
 */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --bg: #0f172a;
    --card: rgba(30,41,59,0.9);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(51,65,85,0.6);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes bounceIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
    color: white;
    min-width: 300px;
}

.toast.remove {
    animation: slideIn 0.3s ease-out reverse;
}

.toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(90deg, #ef4444, #dc2626);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

#offline-indicator i {
    animation: pulse 1s infinite;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 0.75rem 0.75rem;
    max-height: 500px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    animation: slideIn 0.2s ease-out;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-item:hover {
    background: rgba(99,102,241,0.1);
}

.search-result-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.search-result-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.search-error {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
}

.notification-bell {
    position: relative;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s;
}

.notification-bell:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.notification-bell.has-unread::before {
    content: attr(data-count);
    position: absolute;
    top: -5px;
    right: -10px;
    background: var(--error);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    animation: bounceIn 0.3s ease-out;
}

.notification-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    width: 300px;
    max-height: 400px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.notification-dropdown.visible {
    display: block;
}

.notification-dropdown .item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
    cursor: pointer;
}

.notification-dropdown .item.unread {
    background: rgba(99,102,241,0.05);
}

.notification-dropdown .item:last-child {
    border-bottom: none;
}

.notification-dropdown .item:hover {
    background: rgba(99,102,241,0.1);
}

.quick-stats-widget {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-widget {
    text-align: center;
    padding: 0.75rem;
}

.stat-widget-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-widget-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.loading-skeleton {
    background: linear-gradient(90deg, var(--border) 25%, var(--card) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 0.5rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    animation: fadeIn 0.3s ease-out;
}

.modal {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: bounceIn 0.3s ease-out;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s;
}

.modal-close:hover {
    color: var(--text);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.hover-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    transition: all 0.3s;
    cursor: pointer;
}

.hover-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(99,102,241,0.15);
    transform: translateY(-4px);
}

.card-badge {
    display: inline-flex;
    padding: 0.25rem 0.75rem;
    background: rgba(99,102,241,0.2);
    color: var(--primary);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    width: fit-content;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.avatar-group {
    display: flex;
    align-items: center;
    gap: -10px;
}

.avatar-group img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--card);
    margin-left: -10px;
}

.avatar-group img:first-child {
    margin-left: 0;
}

.badge-pulse {
    animation: pulse 2s infinite;
}

@media (max-width: 768px) {
    #toast-container {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .toast {
        min-width: auto;
        flex: 1;
    }

    .modal {
        width: 95%;
        max-height: 95vh;
    }

    .quick-stats-widget {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .quick-stats-widget {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-direction: column;
    }

    .avatar-group img {
        width: 28px;
        height: 28px;
    }
}
