/* ========================================
   BUS PILOT - TOAST & MODAL STYLES
   Stili Notifiche e Modali
   VERGEN ICT TECHNOLOGY
   ======================================== */

/* ========================================
   TOAST CONTAINER
   ======================================== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    left: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */
.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--glass-bg, rgba(20, 30, 50, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-hide {
    transform: translateX(100%);
    opacity: 0;
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary, #fff);
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

/* Toast Types */
.toast-success {
    border-left: 4px solid #00c853;
}

.toast-error {
    border-left: 4px solid #ff5252;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

.toast-info {
    border-left: 4px solid #2196f3;
}

/* ========================================
   MODAL OVERLAY
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.modal-show {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   MODAL CONTAINER
   ======================================== */
.modal-container {
    background: var(--bg-secondary, #1a2744);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.modal-show .modal-container {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

/* Modal Body */
.modal-body {
    padding: 1.5rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.8));
    font-size: 0.95rem;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
}

.modal-body p {
    margin: 0;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.5rem;
    justify-content: flex-end;
}

/* Modal Buttons */
.modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.modal-btn-cancel {
    background: var(--glass-bg, rgba(255, 255, 255, 0.1));
    color: var(--text-secondary, rgba(255, 255, 255, 0.8));
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.modal-btn-confirm {
    background: var(--gradient-green, linear-gradient(135deg, #00c853, #009624));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 200, 83, 0.3);
}

.modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 200, 83, 0.4);
}

/* Modal Type Variants */
.modal-error .modal-btn-confirm {
    background: linear-gradient(135deg, #ff5252, #d32f2f);
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3);
}

.modal-warning .modal-btn-confirm {
    background: linear-gradient(135deg, #ffc107, #ff9800);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
    color: #000;
}

.modal-confirm .modal-btn-confirm {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

/* ========================================
   LOADING OVERLAY
   ======================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 22, 40, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.loading-show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--glass-border, rgba(255, 255, 255, 0.1));
    border-top-color: var(--accent-green, #00c853);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-message {
    color: var(--text-primary, #fff);
    font-size: 1rem;
    font-weight: 500;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 480px) {
    .toast-container {
        top: auto;
        bottom: 100px;
    }

    .modal-container {
        max-width: 100%;
        margin: 0.5rem;
        border-radius: 16px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-btn {
        width: 100%;
    }
}