/* ============================================
   Toast Notifications
   ============================================ */

.toast-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.toast-online {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, #001a00 0%, #003300 100%);
    box-shadow: 0 10px 40px rgba(0, 255, 0, 0.3);
}

.toast-offline {
    border-color: var(--accent-red);
    background: linear-gradient(135deg, #1a0000 0%, #330000 100%);
    box-shadow: 0 10px 40px rgba(255, 0, 0, 0.3);
}

.toast-icon {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1;
}

.toast-online .toast-icon {
    color: var(--accent-green);
    text-shadow: 0 0 10px var(--accent-green);
}

.toast-offline .toast-icon {
    color: var(--accent-red);
    text-shadow: 0 0 10px var(--accent-red);
}

.toast-message {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    transition: all 0.2s;
    opacity: 0.7;
}

.toast-close:hover {
    opacity: 1;
    color: var(--accent-red);
    transform: scale(1.2);
}

/* Stack multiple toasts */
.toast-notification:nth-child(n+2) {
    top: calc(100px + (n - 1) * 90px);
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    .toast-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
        padding: 15px;
    }

    .toast-icon {
        font-size: 1.5rem;
    }

    .toast-message {
        font-size: 0.85rem;
    }
}

/* ============================================
   Control Panel
   ============================================ */

.control-panel {
    position: fixed;
    bottom: 220px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    z-index: 9998;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    min-width: 180px;
}

.control-panel h3 {
    font-size: 1rem;
    color: var(--accent-green);
    margin-bottom: 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.control-btn {
    display: block;
    width: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin-bottom: 8px;
    transition: all 0.3s;
    text-align: center;
}

.control-btn:hover {
    border-color: var(--accent-green);
    box-shadow: 0 0 10px var(--shadow-green);
    transform: translateX(-3px);
}

.control-btn.active {
    border-color: var(--accent-green);
    background: rgba(0, 255, 0, 0.1);
    color: var(--accent-green);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.update-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    margin-left: 8px;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Mobile - hide control panel on small screens */
@media screen and (max-width: 768px) {
    .control-panel {
        bottom: auto;
        top: 80px;
        right: 10px;
        padding: 10px;
        min-width: 150px;
    }

    .control-btn {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
}

/* ============================================
   Loading Spinner
   ============================================ */

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

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

/* ============================================
   Status Change Animation
   ============================================ */

.status-changed {
    animation: statusFlash 1s ease-in-out;
}

@keyframes statusFlash {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 255, 0, 1);
    }
}

.badge.status-changed {
    animation: badgeFlash 0.5s ease-in-out 3;
}

@keyframes badgeFlash {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}