/*
 * QSO Log Map - Responsive & Animations
 * Media queries, keyframes, noise texture
 */

/* ========================================
   MOBILE MENU BUTTON
   ======================================== */

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 150;
    width: 40px;
    height: 40px;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur-md));
    -webkit-backdrop-filter: blur(var(--blur-md));
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.mobile-menu-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.mobile-menu-btn svg {
    width: 100%;
    height: 100%;
}

/* Sidebar backdrop overlay */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 199;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.sidebar-backdrop.visible {
    opacity: 1;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .sidebar-backdrop {
        display: block;
        pointer-events: none;
    }

    .sidebar-backdrop.visible {
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform var(--transition-slow);
        z-index: 200;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        width: 100%;
    }

    .view-toggle {
        top: 12px;
        right: 12px;
    }

    .legend {
        bottom: 12px;
        right: 12px;
        max-width: 140px;
    }
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100001;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 13px;
    max-width: 360px;
    pointer-events: auto;
    animation: toastIn 0.3s ease-out;
}

.toast.toast-out {
    animation: toastOut 0.25s ease-in forwards;
}

.toast-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.toast-error { border-color: #e25555; }
.toast-error .toast-icon { color: #e25555; }

.toast-success { border-color: #2eb87a; }
.toast-success .toast-icon { color: #2eb87a; }

.toast-info { border-color: var(--accent); }
.toast-info .toast-icon { color: var(--accent); }

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

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

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.panel {
    animation: slideUp 0.25s ease-out;
}

.stat-card {
    animation: fadeIn 0.3s ease-out;
    animation-fill-mode: both;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

.filter-chip {
    animation: fadeIn 0.15s ease-out;
    animation-fill-mode: both;
}

/* Subtle noise texture overlay */
.app-container::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
    z-index: 9999;
}
