/* ============================================================
   runtime-styles.css
   Styles previously injected at runtime via JS <style> blocks,
   now maintained as the top stylesheet (loads LAST in <head>).
   Contains: modal skins, embedded payment iframes, contact
   platform buttons.
   ============================================================ */

/* ===================== Modal overlay (shared) ===================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(3, 4, 8, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 20px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Content box for simple text modals (privacy, terms) */
.modal .modal-content {
    background: linear-gradient(160deg, #161a24, #0b0d13);
    color: var(--text);
    max-width: 780px;
    margin: 36px auto;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-2);
    font-family: var(--font-body);
    line-height: 1.55;
}

.modal .modal-content h2 {
    font-family: var(--font-head);
    color: var(--gold);
    margin-top: 0;
}

.modal .modal-content h3 {
    font-family: var(--font-head);
    color: #ffd87a;
}

.modal .modal-content p {
    color: var(--text-dim);
    margin: 8px 0;
}

.modal .modal-content .modal-close,
.modal .modal-close {
    float: right;
    font-size: 1.3em;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid var(--line);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.modal .modal-content .modal-close:hover,
.modal .modal-close:hover {
    color: #fff;
    border-color: var(--line-gold);
}

.modal a {
    color: var(--gold);
    text-decoration: none;
}

.modal a:hover {
    text-decoration: underline;
}

/* Inner content shared by iframe-modal + text modals */
.iframe-modal .modal-inner-content,
.modal .modal-inner-content {
    color: var(--text-dim);
    padding: 12px 8px;
    line-height: 1.5;
    font-family: var(--font-body);
}

/* Scrollable inner content when it exceeds the viewport */
.iframe-modal .modal-inner-content {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(80vh - 120px);
    padding-right: 6px; /* scrollbar space */
}

@media (max-width: 480px) {
    .iframe-modal .modal-inner-content {
        max-height: calc(100vh - 100px);
    }
}

/* ===================== iframe-modal (payments, contact, about) ===================== */
.iframe-modal {
    position: fixed;
    inset: 0;
    background: rgba(3, 4, 8, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 50px 20px 20px;
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.iframe-modal.show {
    opacity: 1;
    transform: scale(1);
}

.iframe-modal-content {
    width: 95%;
    max-width: 580px;
    min-height: 520px;
    max-height: 95%;
    padding: 18px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    box-shadow: var(--shadow-2);
    background: linear-gradient(160deg, #161a24, #0b0d13);
    border: 1px solid var(--line-gold);
    border-radius: var(--r-md);
    transition: box-shadow 0.25s ease;
}

/* Header-created modals (contact/about) shrink to fit content */
.modal.iframe-modal .iframe-modal-content {
    min-height: 0;
}

.modal.iframe-modal .modal-inner-wrap {
    max-width: 560px;
    width: 100%;
    border-radius: var(--r-sm);
}

.modal.iframe-modal .modal-inner-content {
    max-height: calc(100vh - 100px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 12px;
}

/* Title */
.iframe-title {
    margin: 0 0 15px 0;
    font-family: var(--font-head);
    color: var(--text);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-align: center;
    padding-bottom: 14px;
    position: relative;
}

.iframe-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 2px;
    border-radius: 2px;
    background: var(--gold-grad);
}

/* Close button */
.iframe-close {
    position: absolute;
    top: 14px;
    right: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 26px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.06);
    z-index: 99999;
    pointer-events: auto;
}

.iframe-close:hover {
    background-color: var(--gold-soft);
    color: #fff;
    transform: scale(1.05);
}

/* Payment iframe container */
.iframe-container {
    width: 100%;
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--surface-2);
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
}

/* Cash App accent */
.iframe-container[data-payment="Cash App"] {
    border-color: rgba(0, 214, 50, 0.4);
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    min-height: 480px;
    border: none;
    position: relative;
    z-index: 10;
    background-color: transparent;
    border-radius: var(--r-sm);
}

/* Desktop sizing for the payment iframe */
@media (min-width: 769px) {
    .iframe-modal-content {
        min-height: 572px;
    }

    .iframe-container iframe {
        min-height: 528px;
    }
}

/* Loading state */
.iframe-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(10, 12, 18, 0.96);
    z-index: 5;
    font-weight: 500;
    font-size: 15px;
    color: var(--text-dim);
    border-radius: var(--r-sm);
    flex-direction: column;
}

.iframe-loading:before {
    content: '';
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--gold);
    animation: spin 1.2s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--gold);
    animation: spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.iframe-container[data-payment="Cash App"] .iframe-loading:before,
.iframe-container[data-payment="Cash App"] .loading-spinner {
    border-top-color: #00d632;
}

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

/* Error state */
.iframe-error {
    padding: 30px;
    text-align: center;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: rgba(13, 16, 23, 0.97);
    border-radius: var(--r-sm);
}

.iframe-error p {
    margin-bottom: 20px;
    font-size: 15px;
    line-height: 1.5;
}

.iframe-error:before {
    content: '!';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--gold);
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
    border: 1px solid var(--line-gold);
}

.retry-button {
    background: var(--gold-grad);
    color: var(--gold-ink);
    border: none;
padding: 10px 18px;
    border-radius: var(--r-pill);
    cursor: pointer;
    margin-top: 15px;
    font-family: var(--font-head);
    font-weight: 600;
font-size: 0.95rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(252, 182, 4, 0.22);
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-gold);
}

/* ---------- Mobile: full-screen payment modals, card-style header modals ---------- */
@media (max-width: 768px) {
    /* Payment (iframe) modals go full-screen */
    .iframe-modal:not(.modal) {
        padding: 0;
        align-items: stretch;
        overflow-y: hidden;
    }

    .iframe-modal:not(.modal) .iframe-modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        margin: 0;
        padding: 0;
        border-radius: 0;
        min-height: 100%;
        background: #0b0d13;
        border: none;
        box-shadow: none;
    }

    .iframe-modal:not(.modal) .iframe-title {
        padding: 15px 50px 15px 15px;
        margin: 0;
        font-size: 17px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(10, 12, 18, 0.95);
        position: relative;
        z-index: 20;
        box-shadow: 0 1px 0 var(--line);
    }

    .iframe-modal:not(.modal) .iframe-container {
        margin: 0;
        border-radius: 0;
        flex: 1;
        min-height: 0;
        height: calc(100% - 50px);
        border: none;
        background-color: transparent;
    }

    .iframe-modal:not(.modal) .iframe-container iframe {
        min-height: 100%;
        height: 100%;
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        border-radius: 0;
        display: block;
    }

    .iframe-modal:not(.modal) .iframe-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 5px;
        right: 5px;
        background-color: rgba(20, 22, 30, 0.8);
        z-index: 30;
    }

    /* Header modals (Contact / About) stay as centered cards that match the theme */
    .modal.iframe-modal {
        align-items: center;
        justify-content: center;
        padding: 24px 14px;
        overflow-y: auto;
    }

    .modal.iframe-modal .iframe-modal-content {
        width: 100%;
        min-height: 0;
        height: auto;
        max-height: 92vh;
        padding: 20px 16px;
        border-radius: var(--r-md);
        border: 1px solid var(--line-gold);
        background: linear-gradient(160deg, #161a24, #0b0d13);
    }

    .modal.iframe-modal .modal-inner-content {
        max-height: calc(92vh - 140px);
    }

    /* Prevent body scrolling when modal is open */
    body.iframe-modal-open {
        overflow: hidden;
    }

    .iframe-loading {
        z-index: 15;
    }
}

/* Small phones */
@media (max-width: 375px) {
    .iframe-title {
        font-size: 16px;
        padding: 12px 40px 12px 12px;
        height: 44px;
    }

    .iframe-container {
        height: calc(100% - 44px);
    }

    .iframe-close {
        width: 36px;
        height: 36px;
        font-size: 22px;
        top: 4px;
        right: 4px;
    }
}

/* Mobile landscape */
@media (max-width: 900px) and (orientation: landscape) {
    .iframe-title {
        font-size: 15px;
        height: 38px;
        padding: 8px 40px 8px 8px;
    }

    .iframe-container {
        height: calc(100% - 38px);
    }

    .iframe-close {
        top: 3px;
        right: 3px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}

/* ===================== Embedded payment iframes ===================== */
iframe.payment-embedded,
.payment-embedded {
    display: block;
    width: 100%;
    max-width: 100%;
    border-radius: var(--r-md);
    background: var(--surface-2);
    border: 1px solid var(--line-gold);
    box-shadow: var(--shadow-1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

iframe.payment-embedded:hover,
.payment-embedded:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}

iframe.payment-embedded,
.payment-embedded iframe {
    border: none;
    border-radius: var(--r-sm);
    width: 100%;
    height: 100%;
    display: block;
}

iframe.payment-embedded.small,
.payment-embedded.small {
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-1);
}

.payment-embedded-wrapper {
    display: block;
    padding: 8px;
    border-radius: var(--r-md);
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    margin: 8px 0;
}

.payment-embedded-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}

/* ===================== Contact modal platform buttons ===================== */
.contact-chat-row {
    text-align: center;
    margin-top: 14px;
}

.contact-chat-label {
    margin: 0 0 10px 0;
    color: var(--text-dim);
    font-size: 0.95rem;
}

.contact-chat-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.contact-telegram-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--telegram-grad);
    color: #fff;
    border: none;
padding: 10px 18px;
    border-radius: var(--r-pill);
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(42, 171, 238, 0.25), 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
    font-family: var(--font-head);
    font-weight: 700;
    text-decoration: none;
font-size: 0.95rem;
}

.contact-telegram-btn:hover,
.contact-telegram-btn:focus {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 26px rgba(42, 171, 238, 0.35), 0 6px 12px rgba(0, 0, 0, 0.16);
    filter: saturate(1.1);
    color: #fff;
}

.telegram-icon {
    width: 16px;
    height: 16px;
}

.contact-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--whatsapp-grad);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: var(--r-pill);
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.25), 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
    font-family: var(--font-head);
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
}

.contact-whatsapp-btn:hover,
.contact-whatsapp-btn:focus {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 26px rgba(37, 211, 102, 0.35), 0 6px 12px rgba(0, 0, 0, 0.16);
    filter: saturate(1.1);
    color: #fff;
}

.whatsapp-icon {
    width: 16px;
    height: 16px;
}
