/**
 * Athena Alert System Styles
 * Custom alert and confirmation modal styling for Athena Gym Management
 *
 * Mobile-first design following Athena design system standards
 * Uses CSS variables from athena-variables.css
 *
 * @requires athena-variables.css
 */

/* Alert Container */
#athena-alert-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Backdrop */
.athena-alert-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: all;
    z-index: 9999;
}

.athena-alert-backdrop.show {
    opacity: 1;
}

/* Modal Container */
.athena-alert-modal {
    position: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10000;
    padding: 1rem;
}

/* Modal Positions */
.athena-alert-modal.athena-alert-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.athena-alert-modal.athena-alert-center.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.athena-alert-modal.athena-alert-top {
    top: 0;
    left: 0;
    right: 0;
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
}

.athena-alert-modal.athena-alert-top.show {
    transform: translateY(0);
}

.athena-alert-modal.athena-alert-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.athena-alert-modal.athena-alert-bottom.show {
    transform: translateY(0);
}

/* Modal Content - alineado con Bootstrap .modal-content */
.athena-alert-content {
    position: relative;
    background: var(--bs-modal-bg, var(--bs-body-bg, #fff));
    border: var(--bs-modal-border-width, 1px) solid var(--bs-modal-border-color, rgba(0, 0, 0, 0.175));
    border-radius: var(--bs-modal-border-radius, 0.5rem);
    box-shadow: var(--bs-modal-box-shadow, 0 0.5rem 1rem rgba(0, 0, 0, 0.15));
    padding: 2rem;
    width: var(--bs-modal-width, 500px);
    max-width: calc(100vw - 2rem);
    pointer-events: all;
    text-align: center;
}

/* Mobile adjustments */
@media (max-width: 767.98px) {
    .athena-alert-modal {
        padding: 1rem;
    }

    .athena-alert-content {
        padding: 1.5rem;
        border-radius: var(--bs-modal-border-radius, 0.5rem);
    }

    /* Bottom position on mobile should be like a bottom sheet */
    .athena-alert-modal.athena-alert-bottom .athena-alert-content {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        max-width: 100%;
        width: 100%;
    }
}

/* Close Button */
.athena-alert-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--athena-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--athena-radius-sm);
    z-index: 1;
}

.athena-alert-close:hover {
    color: var(--athena-text-dark);
    background-color: var(--athena-bg-light);
    transform: scale(1.1);
}

.athena-alert-close:active {
    transform: scale(0.95);
}

.athena-alert-close i {
    font-size: 1.5rem;
    line-height: 1;
}

/* Icon */
.athena-alert-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.athena-alert-icon i {
    display: inline-block;
    animation: athena-alert-icon-appear 0.4s ease-in-out;
}

@keyframes athena-alert-icon-appear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(20deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Mobile icon size */
@media (max-width: 767.98px) {
    .athena-alert-icon {
        font-size: 3rem;
        margin-bottom: 0.75rem;
    }
}

/* Title */
.athena-alert-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--athena-text-dark);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

/* Mobile title */
@media (max-width: 767.98px) {
    .athena-alert-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
}

/* Message */
.athena-alert-message {
    font-size: 1rem;
    color: var(--athena-text-muted);
    line-height: 1.5;
    margin-bottom: 0;
}

/* Mobile message */
@media (max-width: 767.98px) {
    .athena-alert-message {
        font-size: 0.9375rem;
    }
}

/* Actions Container */
.athena-alert-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Mobile actions */
@media (max-width: 767.98px) {
    .athena-alert-actions {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1.25rem;
    }
}

/* Action Buttons */
.athena-alert-btn {
    min-width: 120px;
    min-height: 44px;
    font-weight: 500;
    font-size: 0.9375rem;
    padding: 0.625rem 1.5rem;
    border-radius: var(--athena-radius);
    transition: all 0.2s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.athena-alert-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--athena-shadow);
}

.athena-alert-btn:active {
    transform: translateY(0);
}

/* Mobile buttons - full width and touch-friendly */
@media (max-width: 767.98px) {
    .athena-alert-btn {
        width: 100%;
        min-width: auto;
        min-height: 48px;
        font-size: 1rem;
    }
}

/* Button Variants */
.athena-alert-btn.btn-primary {
    background-color: var(--athena-primary);
    border-color: var(--athena-primary);
    color: white;
}

.athena-alert-btn.btn-primary:hover {
    background-color: var(--athena-primary-dark);
    border-color: var(--athena-primary-dark);
}

.athena-alert-btn.btn-secondary {
    background-color: var(--athena-text-muted);
    border-color: var(--athena-text-muted);
    color: white;
}

.athena-alert-btn.btn-secondary:hover {
    background-color: #495057;
    border-color: #495057;
}

.athena-alert-btn.btn-danger {
    background-color: var(--athena-danger);
    border-color: var(--athena-danger);
    color: white;
}

.athena-alert-btn.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.athena-alert-btn.btn-success {
    background-color: var(--athena-success);
    border-color: var(--athena-success);
    color: white;
}

.athena-alert-btn.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* Type-specific Icon Colors */
.athena-alert-modal .athena-alert-icon i.bx-check-circle {
    color: var(--athena-success);
}

.athena-alert-modal .athena-alert-icon i.bx-error-circle {
    color: var(--athena-danger);
}

.athena-alert-modal .athena-alert-icon i.bx-error {
    color: var(--athena-warning);
}

.athena-alert-modal .athena-alert-icon i.bx-info-circle {
    color: var(--athena-info);
}

.athena-alert-modal .athena-alert-icon i.bx-help-circle {
    color: var(--athena-primary);
}

/* Accessibility */
.athena-alert-modal:focus-visible {
    outline: 2px solid var(--athena-primary);
    outline-offset: 4px;
}

.athena-alert-btn:focus-visible {
    outline: 2px solid var(--athena-primary);
    outline-offset: 2px;
}

.athena-alert-close:focus-visible {
    outline: 2px solid var(--athena-primary);
    outline-offset: 2px;
}

/* Loading State (optional - for future use) */
.athena-alert-loading {
    pointer-events: none;
    opacity: 0.6;
}

.athena-alert-loading .athena-alert-btn {
    position: relative;
}

.athena-alert-loading .athena-alert-btn::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: athena-alert-spin 0.6s linear infinite;
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .athena-alert-backdrop {
        background-color: rgba(0, 0, 0, 0.7);
    }

    .athena-alert-close:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

/* Print styles - hide alerts when printing */
@media print {
    #athena-alert-container,
    .athena-alert-backdrop,
    .athena-alert-modal {
        display: none !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .athena-alert-backdrop,
    .athena-alert-modal,
    .athena-alert-icon i,
    .athena-alert-close,
    .athena-alert-btn {
        animation: none !important;
        transition: none !important;
    }

    .athena-alert-modal.athena-alert-center.show {
        transform: translate(-50%, -50%) scale(1);
    }
}
