/* ========================================
   Contact Modal — RPG Quest Dialog
   ======================================== */

/* Pixel font for RPG labels */
@font-face {
    font-family: 'Press Start 2P';
    src: url('Assets/PressStart2P.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* Box */
.modal-box {
    position: relative;
    width: min(94vw, 540px);
    max-height: 90vh;
    overflow-y: auto;
    background: #0b1736;
    border: 4px solid var(--primary);
    border-radius: 1rem;
    box-shadow: 6px 6px 0 0 var(--primary-dark);
    transform: translateY(24px) scale(0.96);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
}

.dark .modal-box {
    background: #1a0f09;
}

.modal-overlay.is-open .modal-box {
    transform: translateY(0) scale(1);
}

/* Decorative texture inside box */
.modal-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('https://www.transparenttextures.com/patterns/dark-matter.png');
    opacity: 0.18;
    pointer-events: none;
    border-radius: inherit;
}

/* Header bar */
.modal-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.25);
}

.modal-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    font-weight: 400;
    font-size: 0.6rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.modal-header-title .material-symbols-outlined {
    color: var(--primary);
    font-size: 1.25rem;
}

.modal-close {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.375rem;
    color: #fff;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    font-family: inherit;
}

.modal-close:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.modal-close .material-symbols-outlined {
    font-size: 1.125rem;
}

/* Body / Form area */
.modal-body {
    position: relative;
    z-index: 1;
    padding: 1.5rem 1.25rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Intro line */
.modal-intro {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    line-height: 1.55;
}

.modal-intro strong {
    color: var(--primary);
}

/* Form field group */
.modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.modal-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(180, 200, 255, 0.85);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.55rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.modal-label .material-symbols-outlined {
    font-size: 1rem;
}

/* Shared input styles */
.modal-input,
.modal-select,
.modal-textarea {
    width: 100%;
    background: rgba(0, 0, 50, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.modal-input:focus,
.modal-select:focus,
.modal-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 80, 0.55);
}

.modal-input::placeholder,
.modal-textarea::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

/* Select dropdown */
.modal-select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.modal-select option {
    background: #0b1736;
    color: #fff;
}

/* Textarea */
.modal-textarea {
    resize: none;
    min-height: 5rem;
}

/* Custom scrollbar for textarea */
.modal-textarea::-webkit-scrollbar {
    width: 8px;
    background-color: rgba(0, 0, 50, 0.4);
}

.modal-textarea::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 4px;
}

/* Action bar */
.modal-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 2px dashed rgba(255, 255, 255, 0.1);
}

@media (min-width: 480px) {
    .modal-actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.modal-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 400;
}

.modal-status-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Submit button */
.modal-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.75rem;
    background: var(--primary);
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    font-weight: 400;
    border: none;
    border-radius: 0.375rem;
    box-shadow: 0 4px 0 0 var(--primary-dark);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.modal-submit:hover {
    background: #d96d20;
    color: #fff;
}

.modal-submit:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 0 var(--primary-dark);
}

.modal-submit .material-symbols-outlined {
    font-size: 1.125rem;
}

/* Success message (hidden by default) */
.modal-success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.modal-success.is-visible {
    display: flex;
}

.modal-success-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-success-icon .material-symbols-outlined {
    font-size: 2rem;
    color: #22c55e;
}

.modal-success h3 {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-success p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    max-width: 20rem;
    line-height: 1.5;
}

/* Validation error styles */
.modal-input.is-invalid,
.modal-select.is-invalid,
.modal-textarea.is-invalid {
    border-color: #ef4444;
}

.modal-field-error {
    color: #ef4444;
    font-size: 0.7rem;
    font-weight: 600;
    min-height: 0;
    overflow: hidden;
    transition: min-height 0.15s ease;
}

/* Responsive tweaks */
@media (max-width: 480px) {
    .modal-box {
        border-radius: 0.75rem;
        box-shadow: 4px 4px 0 0 var(--primary-dark);
    }

    .modal-body {
        padding: 1.25rem 1rem 1.5rem;
    }

    .modal-submit {
        width: 100%;
    }
}

/* Body lock when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Team Roster Modal */
.team-modal-box {
    width: min(94vw, 760px);
}

.team-modal-body {
    gap: 1rem;
}

.team-roster-list {
    display: grid;
    gap: 0.9rem;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.team-roster-list::-webkit-scrollbar {
    width: 8px;
}

.team-roster-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 999px;
}

.team-roster-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 999px;
}

.team-member-card {
    background: rgba(0, 0, 0, 0.22);
    border-left: 4px solid var(--primary);
    border-radius: 0.5rem;
    padding: 0.8rem;
    display: grid;
    gap: 0.65rem;
}

.team-member-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.team-member-avatar {
    width: 7.7rem;
    height: 7.7rem;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 0.35rem;
    background: rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.team-member-avatar:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

.team-member-role {
    color: #f59e0b;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.team-member-level {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.78rem;
    margin-top: 0.25rem;
}

.team-member-quote {
    background: #0A1B4D;
    color: #ffffff;
    border-radius: 0.35rem;
    padding: 0.7rem;
    line-height: 1.5;
    font-size: 0.88rem;
}

.dark .team-member-quote {
    background: #1A0F09;
    color: #ffffff;
}

.team-member-contact {
    display: grid;
    gap: 0.35rem;
}

.team-member-contact p {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
}

.team-member-contact .material-symbols-outlined {
    font-size: 1rem;
    color: var(--primary);
}

.team-member-contact a {
    color: inherit;
}

.team-member-contact a:hover {
    color: #fff;
}

.team-modal-actions {
    margin-top: 0.15rem;
}
