/**
 * Born to Ride - Modern Alert System
 * Sistema unificato di notifiche con design moderno
 * 
 * @version 1.0.0
 */

/* ===========================
   Alert Base Styles
   =========================== */
.btr-alert {
    position: relative;
    padding: 1.25rem 1.5rem 1.25rem 4rem;
    border-radius: 0.75rem;
    margin: 1.25rem 0;
    font-size: 1rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: btr-alert-slide-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    overflow: hidden;
    align-items: start;
}

/* Alert Icon Base */
.btr-alert::before {
    content: '';
    position: absolute;
    left: 1.25rem;
    top: 1.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
    z-index: 1;
}

/* Alert Border Accent */
.btr-alert::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 0.75rem 0 0 0.75rem;
}

/* ===========================
   Alert Variants
   =========================== */

/* Success Alert */
.btr-alert.btr-success,
.btr-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.btr-alert.btr-success::before,
.btr-success::before {
    content: '✓';
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
/*
.btr-alert.btr-success::after,
.btr-success::after {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

/* Error Alert */
.btr-alert.btr-error,
.btr-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.btr-alert.btr-error::before,
.btr-error::before {
    content: '✕';
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}
/*
.btr-alert.btr-error::after,
.btr-error::after {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}
*/
/* Warning Alert */
.btr-alert.btr-warning,
.btr-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #78350f;
    border: 1px solid #fcd34d;
}

.btr-alert.btr-warning::before,
.btr-warning::before {
    content: '⚠';
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/*
.btr-alert.btr-warning::after,
.btr-warning::after {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}
*/

/* Info Alert */
.btr-alert.btr-info,
.btr-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e3a8a;
    border: 1px solid #93c5fd;
}

.btr-alert.btr-info::before,
.btr-info::before {
    content: 'ℹ';
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/*
.btr-alert.btr-info::after,
.btr-info::after {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

/* ===========================
   Alert Content
   =========================== */
.btr-alert-title {
    font-weight: 600;
    font-size: 1.0625rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.btr-alert-message {
    margin: 0;
    line-height: 1.6;
}

.btr-alert-list {
    margin: 0.75rem 0 0 0;
    padding-left: 1.25rem;
    list-style-type: disc;
}

.btr-alert-list li {
    margin: 0.375rem 0;
    line-height: 1.5;
}

.btr-alert-list li:last-child {
    margin-bottom: 0;
}

/* Alert Actions */
.btr-alert-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.btr-alert-action {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* Success Actions */
.btr-success .btr-alert-action-primary {
    background: #10b981;
    color: white;
    border: none;
}

.btr-success .btr-alert-action-primary:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

/* Error Actions */
.btr-error .btr-alert-action-primary {
    background: #ef4444;
    color: white;
    border: none;
}

.btr-error .btr-alert-action-primary:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Warning Actions */
.btr-warning .btr-alert-action-primary {
    background: #f59e0b;
    color: white;
    border: none;
}

.btr-warning .btr-alert-action-primary:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

/* Info Actions */
.btr-info .btr-alert-action-primary {
    background: #3b82f6;
    color: white;
    border: none;
}

.btr-info .btr-alert-action-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Secondary Actions */
.btr-alert-action-secondary {
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
}

.btr-alert-action-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* ===========================
   Dismiss Button
   =========================== */
.btr-alert-dismiss {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.375rem;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    opacity: 0.6;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
}

.btr-alert-dismiss:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.btr-alert-dismiss:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* ===========================
   Animations
   =========================== */
@keyframes btr-alert-slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes btr-alert-slide-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
}

.btr-alert-dismissing {
    animation: btr-alert-slide-out 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* Hover Effects */
.btr-alert:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.08);
}

/* ===========================
   Alert Sizes
   =========================== */
.btr-alert.btr-alert-sm {
    padding: 0.875rem 1rem 0.875rem 3.5rem;
    font-size: 0.9375rem;
}

.btr-alert.btr-alert-sm::before {
    width: 1.5rem;
    height: 1.5rem;
    left: 1rem;
    top: 0.875rem;
    font-size: 0.875rem;
}

.btr-alert.btr-alert-lg {
    padding: 1.5rem 2rem 1.5rem 4.5rem;
    font-size: 1.0625rem;
}

.btr-alert.btr-alert-lg::before {
    width: 2.5rem;
    height: 2.5rem;
    left: 1.5rem;
    top: 1.5rem;
    font-size: 1.375rem;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .btr-alert {
        padding: 1rem 1.25rem 1rem 3.5rem;
        font-size: 0.9375rem;
        margin: 1rem 0;
    }

    .btr-alert::before {
        width: 1.75rem;
        height: 1.75rem;
        left: 1rem;
        top: 1rem;
        font-size: 1rem;
    }

    .btr-alert-title {
        font-size: 1rem;
    }

    .btr-alert-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btr-alert-action {
        width: 100%;
        justify-content: center;
    }

    .btr-alert-dismiss {
        top: 0.75rem;
        right: 0.75rem;
        width: 1.5rem;
        height: 1.5rem;
        font-size: 1rem;
    }
}

/* ===========================
   Container Specifics
   =========================== */
#btr-booking-response {
    position: relative;
    min-height: 0;
}

#btr-booking-response:empty {
    display: none;
}

#btr-booking-response .btr-alert:first-child {
    margin-top: 0;
}

#btr-booking-response .btr-alert:last-child {
    margin-bottom: 0;
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    .btr-alert-dismiss {
        display: none !important;
    }

    .btr-alert {
        box-shadow: none !important;
        border: 2px solid currentColor;
        page-break-inside: avoid;
    }
}

/* ===========================
   Accessibility
   =========================== */
.btr-alert[role="alert"] {
    /* Screen readers will announce this automatically */
}

@media (prefers-reduced-motion: reduce) {
    .btr-alert,
    .btr-alert-dismissing {
        animation: none;
        transition: none;
    }

    .btr-alert:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btr-alert {
        border-width: 2px;
    }

    .btr-alert::after {
        width: 6px;
    }
}

