/**
 * Riverside Age Gate - Frontend Styles
 * 
 * Matches Riverside Farm theme design system
 */

/* ==========================================================================
   CSS Variables - Aligned with Theme
   ========================================================================== */
:root {
    /* Brand accent color (gold/olive) */
    --rag-accent: #A69B73;
    --rag-accent-dark: #8f8461;
    --rag-accent-light: #bdb19b;
    
    /* Text colors */
    --rag-text-primary: #28333A;
    --rag-text-secondary: #666666;
    --rag-text-muted: #999999;
    
    /* Backgrounds */
    --rag-bg-white: #ffffff;
    --rag-bg-warm: #F3F3F1;
    
    /* UI */
    --rag-radius-sm: 8px;
    --rag-radius-md: 12px;
    --rag-radius-lg: 16px;
    --rag-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    --rag-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Typography */
    --rag-font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --rag-font-heading: 'Libre Baskerville', Georgia, serif;
    
    /* Transitions */
    --rag-transition-fast: 0.2s ease;
    --rag-transition-base: 0.3s ease;
    --rag-transition-slow: 0.4s ease;
}

/* ==========================================================================
   Overlay - Full Screen with Blur
   ========================================================================== */
.rag-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    
    /* Background color and blur are set via inline styles from settings */
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    
    /* Prevent body scroll */
    overflow: hidden;
    
    /* Animation */
    opacity: 0;
    animation: ragFadeIn 0.4s ease forwards;
}

@keyframes ragFadeIn {
    to {
        opacity: 1;
    }
}

/* Prevent body scroll when modal is active */
body.rag-no-scroll {
    overflow: hidden;
}

/* ==========================================================================
   Container & Wrapper
   ========================================================================== */
.rag-wrapper {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rag-container {
    width: 100%;
    max-width: 500px;
    position: relative;
    
    /* Animation */
    transform: scale(0.9) translateY(20px);
    animation: ragSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.1s;
}

@keyframes ragSlideUp {
    to {
        transform: scale(1) translateY(0);
    }
}

/* ==========================================================================
   Content Box
   ========================================================================== */
.rag-content {
    background: var(--rag-bg-white);
    border-radius: var(--rag-radius-lg);
    box-shadow: var(--rag-shadow-lg);
    padding: 40px 30px;
    text-align: center;
}

/* ==========================================================================
   Header & Logo
   ========================================================================== */
.rag-header {
    margin-bottom: 30px;
}

.rag-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rag-logo img {
    max-width: 280px;
    height: auto;
    max-height: 80px;
    width: auto;
}

/* ==========================================================================
   Description/Text Content
   ========================================================================== */
.rag-desc {
    margin-bottom: 30px;
}

.rag-desc p {
    font-family: var(--rag-font-body);
    font-size: 18px;
    line-height: 1.5;
    color: var(--rag-text-primary);
    margin: 0 0 10px 0;
    font-weight: 500;
}

.rag-desc p:last-child {
    margin-bottom: 0;
}

.rag-desc-secondary {
    font-size: 15px !important;
    color: var(--rag-text-secondary) !important;
    font-weight: 400 !important;
    margin-top: 12px !important;
}

.rag-desc .no-break {
    white-space: nowrap;
}

/* ==========================================================================
   Action Block - Buttons & Remember Me
   ========================================================================== */
.rag-action-block {
    margin-bottom: 20px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.rag-button {
    width: 100%;
    padding: 14px 24px;
    font-family: var(--rag-font-body);
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--rag-radius-sm);
    cursor: pointer;
    transition: all var(--rag-transition-base);
    border: 2px solid transparent;
    text-align: center;
    display: block;
    margin-bottom: 12px;
    outline: none;
}

.rag-button:last-of-type {
    margin-bottom: 0;
}

/* Primary Button (Yes/Verify) */
.rag-button-primary {
    background: var(--rag-accent);
    color: #ffffff;
    border-color: var(--rag-accent);
}

.rag-button-primary:hover {
    background: var(--rag-accent-dark);
    border-color: var(--rag-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(166, 155, 115, 0.3);
}

.rag-button-primary:active {
    transform: translateY(0);
}

/* Outline Button (No/Underage) */
.rag-button-outline {
    background: transparent;
    color: var(--rag-text-primary);
    border-color: #e0e0e0;
}

.rag-button-outline:hover {
    background: var(--rag-bg-warm);
    border-color: #d0d0d0;
}

.rag-button-outline:active {
    background: #e8e8e8;
}

/* ==========================================================================
   Remember Me Checkbox
   ========================================================================== */
.rag-remember-me {
    margin-top: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
}

.rag-remember-me input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    background: #ffffff;
    transition: all var(--rag-transition-fast);
    margin: 2px 0 0 0;
}

.rag-remember-me input[type="checkbox"]:hover {
    border-color: var(--rag-accent);
}

.rag-remember-me input[type="checkbox"]:checked {
    background: var(--rag-accent);
    border-color: var(--rag-accent);
}

.rag-remember-me input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.rag-remember-me label {
    font-family: var(--rag-font-body);
    font-size: 14px;
    color: var(--rag-text-secondary);
    cursor: pointer;
    text-align: left;
    line-height: 1.4;
    user-select: none;
    margin: 0;
}

.rag-remember-me label span {
    display: block;
    font-size: 12px;
    color: var(--rag-text-muted);
    margin-top: 2px;
}

/* ==========================================================================
   Disclaimer
   ========================================================================== */
.rag-disclaimer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
}

.rag-disclaimer small {
    font-family: var(--rag-font-body);
    font-size: 12px;
    line-height: 1.5;
    color: var(--rag-text-muted);
    display: block;
}

/* ==========================================================================
   Views - Initial & Underage
   ========================================================================== */
.rag-view {
    display: block;
}

.rag-view-initial {
    /* Default view */
}

.rag-view-underage {
    /* Hidden by default, shown via JS */
}

.rag-view-underage .rag-desc p {
    font-size: 17px;
    color: var(--rag-text-primary);
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.rag-button.is-loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.rag-button.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: ragSpin 0.6s linear infinite;
}

.rag-button-outline.is-loading::after {
    border-color: rgba(0, 0, 0, 0.2);
    border-top-color: var(--rag-text-primary);
}

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

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 600px) {
    .rag-overlay {
        padding: 15px;
    }
    
    .rag-content {
        padding: 30px 20px;
    }
    
    .rag-logo img {
        max-width: 220px;
        max-height: 60px;
    }
    
    .rag-desc p {
        font-size: 16px;
    }
    
    .rag-desc-secondary {
        font-size: 14px !important;
    }
    
    .rag-button {
        padding: 12px 20px;
        font-size: 15px;
    }
}

@media (max-width: 400px) {
    .rag-content {
        padding: 25px 18px;
    }
    
    .rag-logo img {
        max-width: 180px;
        max-height: 50px;
    }
    
    .rag-desc p {
        font-size: 15px;
    }
    
    .rag-button {
        font-size: 14px;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
.rag-button:focus-visible {
    outline: 3px solid var(--rag-accent-light);
    outline-offset: 2px;
}

.rag-remember-me input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--rag-accent);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .rag-overlay,
    .rag-container,
    .rag-button,
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

