/* ========================================
   TIPZ - Sistema de Alertas
   Dark Premium Theme
   ======================================== */

/* ==================== CONTENEDOR DE FLASH MESSAGES ==================== */
.flash-messages-container {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 1050;
    pointer-events: none;
    padding: 0 12px;
}

.flash-messages-container .container {
    pointer-events: auto;
    max-width: 600px;
}

/* ==================== ALERT BASE ==================== */
.alert {
    border-radius: 12px;
    font-weight: 500;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.75rem;
    border: none;
    border-left: 3px solid;
    backdrop-filter: blur(12px);
    font-size: 0.88rem;
    line-height: 1.4;
}

.alert i:first-child {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.alert span {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.alert strong {
    font-weight: 700;
}

/* Close button — override Bootstrap absolute positioning */
.alert-dismissible {
    padding-right: 1rem !important; /* Remove Bootstrap's extra right padding for absolute btn */
}

.alert-dismissible .btn-close {
    position: static !important; /* Remove Bootstrap's position: absolute */
    padding: 0;
    margin: 0;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 6px;
    opacity: 0.6;
    background-size: 10px;
    flex-shrink: 0;
    transition: opacity 0.2s, background-color 0.2s;
    filter: none;
    align-self: center;
}

.alert-dismissible .btn-close:hover {
    opacity: 1;
    transform: none;
}

/* ==================== DARK ALERT VARIANTS ==================== */
/* Scoped to dark-mode containers only.
   Pages with light backgrounds (match analysis, admin, guild) keep Bootstrap defaults.
   Dark containers: .dashboard-container, .checkout-container, .crypto-checkout-container,
   .per-day-container, .per-match-container, .history-container, .success-container,
   .subscription-container */

/* Success — dark context */
.dashboard-container .alert-success,
.checkout-container .alert-success,
.crypto-checkout-container .alert-success,
.per-day-container .alert-success,
.per-match-container .alert-success,
.history-container .alert-success,
.success-container .alert-success,
.subscription-container .alert-success {
    background: rgba(0, 168, 89, 0.12) !important;
    border-left-color: #00A859 !important;
    color: #a7f3d0 !important;
    box-shadow: 0 4px 16px rgba(0, 168, 89, 0.15);
}

.dashboard-container .alert-success i:first-child,
.checkout-container .alert-success i:first-child,
.crypto-checkout-container .alert-success i:first-child { color: #00A859; }

/* Info — dark context */
.dashboard-container .alert-info,
.checkout-container .alert-info,
.crypto-checkout-container .alert-info,
.per-day-container .alert-info,
.per-match-container .alert-info,
.history-container .alert-info,
.success-container .alert-info,
.subscription-container .alert-info {
    background: rgba(34, 211, 238, 0.1) !important;
    border-left-color: #22d3ee !important;
    color: #a5f3fc !important;
    box-shadow: 0 4px 16px rgba(34, 211, 238, 0.12);
}

.dashboard-container .alert-info i:first-child,
.checkout-container .alert-info i:first-child,
.crypto-checkout-container .alert-info i:first-child { color: #22d3ee; }

/* Warning — dark context */
.dashboard-container .alert-warning,
.checkout-container .alert-warning,
.crypto-checkout-container .alert-warning,
.per-day-container .alert-warning,
.per-match-container .alert-warning,
.history-container .alert-warning,
.success-container .alert-warning,
.subscription-container .alert-warning {
    background: rgba(245, 158, 11, 0.12) !important;
    border-left-color: #f59e0b !important;
    color: #fde68a !important;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
}

.dashboard-container .alert-warning i:first-child,
.checkout-container .alert-warning i:first-child,
.crypto-checkout-container .alert-warning i:first-child { color: #f59e0b; }

/* Danger — dark context */
.dashboard-container .alert-danger,
.checkout-container .alert-danger,
.crypto-checkout-container .alert-danger,
.per-day-container .alert-danger,
.per-match-container .alert-danger,
.history-container .alert-danger,
.success-container .alert-danger,
.subscription-container .alert-danger {
    background: rgba(239, 68, 68, 0.12) !important;
    border-left-color: #ef4444 !important;
    color: #fca5a5 !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.12);
}

.dashboard-container .alert-danger i:first-child,
.checkout-container .alert-danger i:first-child,
.crypto-checkout-container .alert-danger i:first-child { color: #ef4444; }

/* Light — dark context */
.dashboard-container .alert-light,
.checkout-container .alert-light,
.crypto-checkout-container .alert-light,
.per-day-container .alert-light,
.per-match-container .alert-light,
.history-container .alert-light,
.success-container .alert-light,
.subscription-container .alert-light {
    background: rgba(255, 255, 255, 0.06) !important;
    border-left-color: rgba(255, 255, 255, 0.2) !important;
    color: #e2e8f0 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* btn-close in dark contexts */
.dashboard-container .alert-dismissible .btn-close,
.checkout-container .alert-dismissible .btn-close,
.crypto-checkout-container .alert-dismissible .btn-close,
.per-day-container .alert-dismissible .btn-close,
.per-match-container .alert-dismissible .btn-close,
.history-container .alert-dismissible .btn-close,
.success-container .alert-dismissible .btn-close,
.subscription-container .alert-dismissible .btn-close,
.flash-messages-container .alert-dismissible .btn-close {
    filter: invert(1);
    opacity: 0.4;
}

/* Flash messages (floating toasts) — always dark style since they float over navbar */
.flash-messages-container .alert-success {
    background: rgba(0, 168, 89, 0.12) !important;
    border-left-color: #00A859 !important;
    color: #a7f3d0 !important;
    box-shadow: 0 4px 16px rgba(0, 168, 89, 0.15);
}
.flash-messages-container .alert-info {
    background: rgba(34, 211, 238, 0.1) !important;
    border-left-color: #22d3ee !important;
    color: #a5f3fc !important;
    box-shadow: 0 4px 16px rgba(34, 211, 238, 0.12);
}
.flash-messages-container .alert-warning {
    background: rgba(245, 158, 11, 0.12) !important;
    border-left-color: #f59e0b !important;
    color: #fde68a !important;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
}
.flash-messages-container .alert-danger {
    background: rgba(239, 68, 68, 0.12) !important;
    border-left-color: #ef4444 !important;
    color: #fca5a5 !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.12);
}


/* ==================== BETA ALERT (dark context only) ==================== */
.dashboard-container .alert-tipz-beta,
.checkout-container .alert-tipz-beta,
.crypto-checkout-container .alert-tipz-beta {
    background: rgba(0, 168, 89, 0.1) !important;
    border: 1px solid rgba(0, 168, 89, 0.2);
    border-left: 3px solid #00A859;
    color: #a7f3d0;
    box-shadow: 0 4px 16px rgba(0, 168, 89, 0.15);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-weight: 500;
}

.dashboard-container .alert-tipz-beta i,
.checkout-container .alert-tipz-beta i { color: #00A859; font-size: 1.25rem; }
.dashboard-container .alert-tipz-beta strong,
.checkout-container .alert-tipz-beta strong { color: #00A859; }

/* ==================== ANIMATION ==================== */
.flash-message {
    animation: alertSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* No pulse — it's distracting */

/* ==================== HOVER ==================== */
.alert:hover {
    transform: none; /* Remove the translateY hover — alerts shouldn't move */
}

/* ==================== LONG TIMEOUT ALERTS ==================== */
.alert-long-timeout {
    /* Same styles, just longer auto-dismiss (handled in JS) */
}

/* ==================== PERMANENT ALERTS ==================== */
.alert-permanent {
    /* Never auto-dismissed */
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .flash-messages-container {
        top: 60px;
        padding: 0 8px;
    }

    .alert {
        font-size: 0.82rem;
        padding: 12px 14px;
        gap: 8px;
    }

    .alert i:first-child {
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    .flash-messages-container .container {
        padding: 0;
    }

    .alert {
        font-size: 0.78rem;
        border-radius: 10px;
    }
}
