/* ============================================
   SHARED MODAL STYLES
   Common styles for all modal overlays and containers
   ============================================ */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    /* Exception: full-screen backdrop must cover the --z-toast layer (connection
       chip) while staying below MudBlazor drawer/dialog chrome (1100+). */
    z-index: calc(var(--z-toast) + 50);
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

/* fadeIn / slideIn keyframes: canonical copies live in app.css
   (bodies match these modal animations — do not redefine here) */

/* Modal Container */
.modal-container {
    position: relative;
    background: linear-gradient(145deg, rgba(13, 18, 42, 0.98), rgba(10, 14, 39, 0.98));
    border: 2px solid var(--border-accent-emphasis);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px var(--border-accent-medium);
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease;
    overflow: hidden;
}

/* Modal Header */
.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border-accent-medium);
    background: linear-gradient(135deg, var(--primary-alpha-10), rgba(var(--accent-purple-rgb), 0.1));
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-light);
    font-family: 'Bangers', cursive;
    font-size: 1.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary-hero) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Close Button */
.close-button {
    background: transparent;
    border: 2px solid var(--text-muted);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button:hover {
    background: var(--primary-hero);
    border-color: var(--primary-hero);
    color: white;
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Modal Footer */
.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--border-accent);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-shrink: 0;
}

/* Form Groups in Modals */
.modal-body .form-group {
    margin-bottom: 1.5rem;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-light);
}

.modal-body .form-group .hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

.modal-body .form-group .optional {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Alerts in Modals */
.modal-body .alert {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.modal-body .alert-info {
    background: var(--secondary-alpha-10);
    border: 1px solid var(--secondary-alpha-30);
    color: var(--secondary-hero);
}

.modal-body .alert-warning {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    color: var(--accent-orange);
}

.modal-body .alert-warning ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
}

.modal-body .alert-warning li {
    margin-bottom: 0.25rem;
}

.modal-body .alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Position Badge (scoped to modals so it can't leak onto roster/draft badges) */
.modal-container .position-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--hero-gradient);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Injury Badge (scoped to modals) */
.modal-container .injury-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--primary-alpha-20);
    border: 1px solid var(--primary-hero);
    color: var(--primary-hero);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-container {
        width: 98%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .modal-header {
        padding: 1rem 1.25rem;
    }

    .modal-header h3 {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-footer {
        padding: 1rem 1.25rem;
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
    }
}
