/*
 * AVS Simple Age Gate - Styles matching age-gate-preview.html
 */

/* Prevent scroll */
html.avs-simple-gate-open,
body.avs-simple-gate-open {
    overflow: hidden !important;
}

#avs-simple-gate-overlay.avs-simple-gate {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    
    /* Theme Variables */
    --avs-sg-bg-color: #000;
    --avs-sg-card-bg: #000;
    --avs-sg-card-color: #fff;
    --avs-sg-radius: 4px;
    --avs-sg-primary: #E91E63;
    --avs-sg-primary-hover: #d81b60;
    --avs-sg-primary-fg: #fff;
    --avs-sg-secondary: #222;
    --avs-sg-secondary-hover: #2a2a2a;
    --avs-sg-secondary-border: #444;
    --avs-sg-secondary-border-hover: #555;
    --avs-sg-secondary-fg: #fff;
    --avs-sg-bg-image: none;
    --avs-sg-bg-overlay: 0.5;
    --avs-sg-text-muted: #999;
    --avs-sg-border: #333;
    --avs-sg-footer-bg: #111;
    --avs-sg-footer-border: #222;
    --avs-sg-backdrop-opacity: 0.85;
    --avs-sg-backdrop-blur: 8px;
    
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
html.avs-simple-gate-open #avs-simple-gate-overlay.avs-simple-gate,
body.avs-simple-gate-open #avs-simple-gate-overlay.avs-simple-gate {
    display: flex !important;
}

body.avs-simple-gate-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 999998;
}

#avs-simple-gate-overlay.avs-simple-gate::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 0;
}

#avs-simple-gate-overlay * {
    box-sizing: border-box;
}

#avs-simple-gate-overlay .avs-simple-gate-backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: var(--avs-sg-bg-color);
    background-image: linear-gradient(rgba(0, 0, 0, var(--avs-sg-bg-overlay)), rgba(0, 0, 0, var(--avs-sg-bg-overlay))), var(--avs-sg-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    backdrop-filter: blur(var(--avs-sg-backdrop-blur));
    opacity: 0;
    animation: avsFadeIn 180ms ease-out forwards;
}

#avs-simple-gate-overlay .avs-simple-gate-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 680px;
}

#avs-simple-gate-overlay .avs-simple-gate-card {
    background: var(--avs-sg-card-bg);
    color: var(--avs-sg-card-color);
    border-radius: var(--avs-sg-radius);
    box-shadow: 0 20px 80px rgba(0,0,0,0.8);
    border: 1px solid var(--avs-sg-border);
    display: flex;
    flex-direction: column;
    text-align: center;
    overflow: hidden;
    transform: translateY(8px) scale(0.985);
    opacity: 0;
    animation: avsCardIn 220ms cubic-bezier(.2,.9,.2,1) forwards;
}

/* Header */
#avs-simple-gate-overlay .avs-sg-header {
    padding: 40px 40px 20px;
}

#avs-simple-gate-overlay .avs-sg-logo {
    display: block;
    margin: 0 auto 24px;
    height: 40px;
    width: auto;
}

#avs-simple-gate-overlay .avs-sg-title {
    margin: 0 0 16px;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
}

#avs-simple-gate-overlay .avs-sg-intro {
    margin: 0 auto 24px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--avs-sg-text-muted);
    max-width: 500px;
}

/* Buttons */
#avs-simple-gate-overlay .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    height: 34px;
    border-radius: var(--avs-sg-radius);
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.2s ease, transform 0.06s ease;
}
#avs-simple-gate-overlay .button:hover { 
    transform: translateY(-1px); 
}
#avs-simple-gate-overlay .button:focus { 
    outline: none; 
}

#avs-simple-gate-overlay .button-pink {
    background: var(--avs-sg-primary);
    border-color: var(--avs-sg-primary);
    color: #fff;
    box-shadow: 0 10px 26px rgba(233, 30, 99, 0.18);
}
#avs-simple-gate-overlay .button-pink:hover {
    background: var(--avs-sg-primary-hover);
    border-color: var(--avs-sg-primary-hover);
    box-shadow: 0 14px 32px rgba(233, 30, 99, 0.24);
}

#avs-simple-gate-overlay .button-close {
    background: var(--avs-sg-secondary);
    border-color: var(--avs-sg-secondary-border);
    color: #fff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}
#avs-simple-gate-overlay .button-close:hover {
    background: var(--avs-sg-secondary-hover);
    border-color: var(--avs-sg-secondary-border-hover);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
}

/* Safety Btn */
#avs-simple-gate-overlay .avs-sg-safety-btn {
    margin: 0 auto 18px;
    min-width: 150px;
}

/* Actions */
#avs-simple-gate-overlay .avs-sg-actions {
    padding: 0 40px 28px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

#avs-simple-gate-overlay .avs-sg-actions .button {
    height: 52px;
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    text-transform: none;
}

/* Login Link */
#avs-simple-gate-overlay .avs-sg-login {
    display: block;
    margin: 0 0 24px;
    font-size: 14px;
    color: var(--avs-sg-text-muted);
    text-decoration: none;
}
#avs-simple-gate-overlay .avs-sg-login:hover {
    color: #fff;
    text-decoration: underline;
}

/* Footer */
#avs-simple-gate-overlay .avs-sg-footer {
    background: var(--avs-sg-footer-bg);
    padding: 20px;
    font-size: 12px;
    color: #666;
    border-top: 1px solid var(--avs-sg-footer-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

#avs-simple-gate-overlay .avs-sg-footer-links {
    display: flex;
    gap: 16px;
}
#avs-simple-gate-overlay .avs-sg-footer-links a {
    color: #888;
    text-decoration: none;
}
#avs-simple-gate-overlay .avs-sg-footer-links a:hover {
    color: #ccc;
}

#avs-simple-gate-overlay .avs-sg-rta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    color: #888;
    letter-spacing: 1px;
}
#avs-simple-gate-overlay .avs-sg-rta-badge a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
#avs-simple-gate-overlay .avs-sg-rta-badge span {
    background: #444;
    color: #fff;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 10px;
}

/* Form Inputs (Birthday) */
#avs-simple-gate-overlay .avs-sg-input {
    width: 100%;
    padding: 12px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 1rem;
}
#avs-simple-gate-overlay .avs-sg-input:focus-visible {
    outline: none;
    box-shadow: var(--avs-sg-focus);
}

/* Mobile */
@media (max-width: 600px) {
    #avs-simple-gate-overlay .avs-sg-actions {
        grid-template-columns: 1fr;
        padding: 0 24px 24px;
    }
    #avs-simple-gate-overlay .avs-sg-header {
        padding: 32px 24px 16px;
    }
}

/* Animations */
@keyframes avsFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes avsCardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.975); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Button Feedback Animations */

/* Submit button states */
#avs-simple-gate-overlay .button-pink {
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease, transform 0.06s ease;
}

#avs-simple-gate-overlay .button-pink:active {
    transform: scale(0.98);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

#avs-simple-gate-overlay .button-pink:focus-visible {
    outline: 2px solid var(--avs-sg-primary);
    outline-offset: 2px;
}

/* Submit button loading state */
#avs-simple-gate-overlay .avs-simple-gate-submit[aria-busy="true"] {
    position: relative;
    padding-left: 48px;
    opacity: 0.75;
    cursor: progress !important;
    pointer-events: none;
}

#avs-simple-gate-overlay .avs-simple-gate-submit[aria-busy="true"]::before {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    transform: translateY(-50%);
    animation: avs-spin 0.6s linear infinite;
    content: "";
    opacity: 1;
}

/* Exit button states */
#avs-simple-gate-overlay .button-close {
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease, transform 0.06s ease;
}

#avs-simple-gate-overlay .button-close:active {
    transform: scale(0.98);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

#avs-simple-gate-overlay .button-close:focus-visible {
    outline: 2px solid var(--avs-sg-secondary-border);
    outline-offset: 2px;
}

#avs-simple-gate-overlay .button-close:disabled {
    opacity: 0.6;
    cursor: not-allowed !important;
}

/* Login link states */
#avs-simple-gate-overlay .avs-sg-login {
    transition: color 0.15s ease, transform 0.06s ease, text-decoration 0.2s ease;
}

#avs-simple-gate-overlay .avs-sg-login:active {
    transform: scale(0.98);
}

#avs-simple-gate-overlay .avs-sg-login:focus-visible {
    outline: 2px solid var(--avs-sg-text-muted);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Checkbox states */
#avs-simple-gate-overlay .avs-simple-gate-checkbox input[type="checkbox"] {
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

#avs-simple-gate-overlay .avs-simple-gate-checkbox input[type="checkbox"]:hover {
    transform: scale(1.1);
    border-color: var(--avs-sg-primary);
}

#avs-simple-gate-overlay .avs-simple-gate-checkbox input[type="checkbox"]:focus {
    outline: 2px solid var(--avs-sg-primary);
    outline-offset: 2px;
}

#avs-simple-gate-overlay .avs-simple-gate-checkbox input[type="checkbox"]:checked {
    transition: transform 0.2s ease;
}

/* Input field states */
#avs-simple-gate-overlay .avs-sg-input {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#avs-simple-gate-overlay .avs-sg-input:hover {
    border-color: rgba(255, 255, 255, 0.28);
}

#avs-simple-gate-overlay .avs-sg-input:focus-visible {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Loading spinner keyframes */
@keyframes avs-spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

@keyframes avsFadeInUp {
    from {
        opacity: 0;
        transform: translateY(-50%) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateY(0);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #avs-simple-gate-overlay .button,
    #avs-simple-gate-overlay .button-pink,
    #avs-simple-gate-overlay .button-close,
    #avs-simple-gate-overlay .avs-sg-login,
    #avs-simple-gate-overlay .avs-simple-gate-checkbox input[type="checkbox"],
    #avs-simple-gate-overlay .avs-sg-input,
    #avs-simple-gate-overlay .avs-simple-gate-submit[aria-busy="true"]::before {
        animation: none !important;
        transition: none !important;
    }
    
    #avs-simple-gate-overlay .avs-simple-gate-submit[aria-busy="true"]::before {
        border-top-color: currentColor;
        opacity: 0.5;
    }
    
    #avs-simple-gate-overlay .button:focus-visible,
    #avs-simple-gate-overlay .button-pink:focus-visible,
    #avs-simple-gate-overlay .button-close:focus-visible,
    #avs-simple-gate-overlay .avs-sg-login:focus-visible,
    #avs-simple-gate-overlay .avs-simple-gate-checkbox input[type="checkbox"]:focus {
        outline: 2px solid var(--avs-sg-primary);
        outline-offset: 2px;
    }
}

/* Closing Animation */
html.avs-simple-gate-closing #avs-simple-gate-overlay,
body.avs-simple-gate-closing #avs-simple-gate-overlay {
    opacity: 0;
    transition: opacity 0.4s ease-out;
    pointer-events: none;
}

html.avs-simple-gate-closing::before,
body.avs-simple-gate-closing::before {
    opacity: 0;
    transition: opacity 0.4s ease-out;
    pointer-events: none;
}