/**
 * GoldieCircle Welcome Modal Styles
 * Sequential two-step modal: Disclaimer → Cookie Preferences
 * Version: 1.0.0
 */

/* ========================================
   MODAL OVERLAY & CONTAINER
   ======================================== */

.gc-welcome-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999; /* Above everything */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.gc-welcome-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.gc-welcome-container {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 800px;
    width: 100%;
    max-height: 80vh; /* EMERGENCY FIX: Reduced from 85vh to ensure footer always visible */
    overflow: hidden;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

/* ========================================
   STEP MANAGEMENT
   ======================================== */

.gc-welcome-step {
    display: none;
    flex-direction: column;
    height: 100%;
    animation: slideIn 0.4s ease-out;
}

.gc-welcome-step.gc-step-active {
    display: flex;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   HEADER WITH PROGRESS INDICATOR
   ======================================== */

.gc-welcome-header {
    background: linear-gradient(135deg, #0B5394 0%, #0d6bb5 100%);
    color: white;
    padding: 20px 30px 18px 30px;
    border-radius: 16px 16px 0 0;
}

.gc-welcome-header h2 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

/* Progress Indicator */
.gc-progress-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.gc-progress-step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s;
}

.gc-progress-step.gc-step-active {
    background: white;
    color: #0B5394;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.gc-progress-step.gc-step-completed {
    background: #27AE60;
    color: white;
}

.gc-progress-line {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    transition: all 0.3s;
}

.gc-progress-line.gc-line-completed {
    background: #27AE60;
}

.gc-step-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-left: auto;
}

/* ========================================
   BODY CONTENT
   ======================================== */

.gc-welcome-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px 26px; /* EMERGENCY FIX: Reduced from 24px 30px */
    scroll-behavior: smooth;
    min-height: 0; /* Critical for flex scrolling to work */
    max-height: calc(80vh - 250px); /* EMERGENCY FIX: Reserve space for header (~100px) + footer (~100px) + margins */
}

/* Scroll indicator shadow at bottom of scrollable content */
.gc-welcome-body::after {
    content: '';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.05));
    pointer-events: none;
    display: block;
    margin: -20px -35px 0 -35px;
}

/* Custom scrollbar - More prominent */
.gc-welcome-body::-webkit-scrollbar {
    width: 12px;
}

.gc-welcome-body::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 10px;
}

.gc-welcome-body::-webkit-scrollbar-thumb {
    background: #0B5394;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.gc-welcome-body::-webkit-scrollbar-thumb:hover {
    background: #084070;
}

/* ========================================
   STEP 1: DISCLAIMER CONTENT
   ======================================== */

.gc-disclaimer-section h3 {
    font-size: 20px;
    color: #0B5394;
    margin: 0 0 16px 0;
    font-weight: 700;
}

/* Info Boxes */
.gc-info-box {
    margin-bottom: 12px; /* EMERGENCY FIX: Reduced from 16px */
    padding: 14px; /* EMERGENCY FIX: Reduced from 16px */
    border-radius: 8px;
    border-left: 4px solid;
}

.gc-info-box h4 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 700;
}

.gc-info-box p {
    margin: 0 0 10px 0;
    line-height: 1.7;
    color: #2c3e50;
}

.gc-info-box p:last-child {
    margin-bottom: 0;
}

.gc-info-box ul {
    margin: 8px 0;
    padding-left: 24px;
}

.gc-info-box li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #2c3e50;
}

/* Info Box Variants */
.gc-info-primary {
    background: #E3F2FD;
    border-left-color: #0B5394;
}

.gc-info-primary h4 {
    color: #0B5394;
}

.gc-info-warning {
    background: #FFF3E0;
    border-left-color: #F4A300;
}

.gc-info-warning h4 {
    color: #D98E00;
}

.gc-info-assistant {
    background: #F1F8E9;
    border-left-color: #27AE60;
}

.gc-info-assistant h4 {
    color: #27AE60;
}

.gc-info-legal {
    background: #FFF8E1;
    border-left-color: #E74C3C;
}

.gc-info-legal h4 {
    color: #C0392B;
}

.gc-legal-list {
    list-style: none;
    padding-left: 0;
}

.gc-legal-list li {
    padding-left: 8px;
    margin-bottom: 6px; /* EMERGENCY FIX: Reduced from 10px */
    font-size: 14px; /* EMERGENCY FIX: Slightly smaller for better fit */
    line-height: 1.4; /* EMERGENCY FIX: Tighter line height */
}

.gc-note {
    font-size: 14px;
    font-style: italic;
    margin-top: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
}

/* Acceptance Checkbox */
.gc-acceptance-checkbox {
    margin-top: 16px; /* EMERGENCY FIX: Reduced from 20px */
    padding: 14px; /* EMERGENCY FIX: Reduced from 16px */
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.gc-acceptance-checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.gc-acceptance-checkbox input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.gc-checkbox-label {
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
}

.gc-checkbox-label strong {
    color: #0B5394;
}

/* ========================================
   STEP 2: COOKIE PREFERENCES CONTENT
   ======================================== */

.gc-cookie-section .gc-intro-text {
    font-size: 17px;
    color: #2c3e50;
    margin-bottom: 28px;
    line-height: 1.6;
}

.gc-cookie-option {
    display: flex;
    gap: 20px;
    padding: 24px;
    margin-bottom: 20px;
    border-radius: 12px;
    border: 2px solid;
    transition: all 0.3s;
}

.gc-cookie-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.gc-cookie-essential {
    background: #E8F5E9;
    border-color: #27AE60;
}

.gc-cookie-analytics {
    background: #E3F2FD;
    border-color: #0B5394;
}

.gc-cookie-icon {
    font-size: 40px;
    flex-shrink: 0;
}

.gc-cookie-details h4 {
    margin: 0 0 12px 0;
    font-size: 19px;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gc-cookie-details p {
    margin: 0 0 10px 0;
    color: #2c3e50;
    line-height: 1.6;
}

.gc-cookie-details ul {
    margin: 12px 0;
    padding-left: 24px;
}

.gc-cookie-details li {
    margin-bottom: 6px;
    color: #2c3e50;
    line-height: 1.5;
}

.gc-cookie-note {
    font-size: 14px;
    font-weight: 600;
    margin-top: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
}

/* Badges */
.gc-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gc-badge-required {
    background: #27AE60;
    color: white;
}

.gc-badge-optional {
    background: #0B5394;
    color: white;
}

/* Privacy Link */
.gc-privacy-link {
    margin-top: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

.gc-privacy-link p {
    margin: 0;
    font-size: 15px;
}

.gc-privacy-link a {
    color: #0B5394;
    text-decoration: underline;
    font-weight: 600;
}

.gc-privacy-link a:hover {
    color: #084070;
}

/* ========================================
   FOOTER WITH BUTTONS
   ======================================== */

.gc-welcome-footer {
    padding: 20px 30px;
    border-top: 3px solid #dee2e6;
    background: #f8f9fa;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    flex: 0 0 auto; /* EMERGENCY FIX: Never collapse, never grow */
    min-height: 100px; /* EMERGENCY FIX: Guarantee minimum space */
    position: sticky; /* EMERGENCY FIX: Always stick to bottom of modal */
    bottom: 0;
    z-index: 10; /* EMERGENCY FIX: Stay above other content */
}

.gc-footer-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.gc-footer-buttons .gc-footer-note {
    width: 100%; /* Ensure note spans full width below buttons */
    flex-basis: 100%;
}

.gc-btn {
    padding: 16px 32px;
    font-size: 17px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    flex: 1;
    min-width: 200px;
}

.gc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.gc-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.gc-btn:not(:disabled):active {
    transform: translateY(0);
}

/* Button Variants */
.gc-btn-primary {
    background: #0B5394;
    color: white;
    transition: all 0.3s ease;
}

.gc-btn-primary:not(:disabled) {
    animation: pulse-glow 2s ease-in-out infinite;
}

.gc-btn-primary:not(:disabled):hover {
    background: #084070;
    box-shadow: 0 6px 20px rgba(11, 83, 148, 0.4);
    animation: none; /* Stop pulse on hover */
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(11, 83, 148, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 5px rgba(11, 83, 148, 0.6);
    }
}

.gc-btn-success {
    background: #27AE60;
    color: white;
}

.gc-btn-success:hover {
    background: #229954;
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.gc-btn-secondary {
    background: #6c757d;
    color: white;
}

.gc-btn-secondary:hover {
    background: #5a6268;
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.gc-btn-decline {
    background: #dc3545;
    color: white;
}

.gc-btn-decline:hover {
    background: #c82333;
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.gc-btn-decline:disabled {
    background: #6c757d;
    opacity: 0.5;
    cursor: not-allowed;
}

.gc-footer-note {
    margin: 16px 0 0 0;
    font-size: 14px;
    color: #6c757d;
    text-align: center;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.gc-btn:focus,
.gc-acceptance-checkbox input:focus {
    outline: 3px solid #0B5394;
    outline-offset: 3px;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .gc-welcome-modal {
        padding: 5px;
        align-items: flex-start;
        padding-top: 10px;
    }

    .gc-welcome-container {
        max-height: 98vh; /* Use almost full screen */
        border-radius: 8px;
        overflow-y: auto; /* Allow container to scroll if needed */
    }

    #gc-welcome-step1 {
        display: flex;
        flex-direction: column;
        max-height: 98vh;
    }

    .gc-welcome-header {
        padding: 12px 16px 10px 16px;
    }

    .gc-welcome-header h2 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .gc-progress-indicator {
        gap: 6px;
        margin-top: 8px;
    }

    .gc-progress-step {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .gc-step-label {
        font-size: 10px;
    }

    .gc-welcome-body {
        padding: 12px;
        max-height: none; /* Remove height constraint */
        overflow-y: visible; /* Make everything visible without scrolling */
    }

    .gc-legal-compact li {
        margin-bottom: 4px; /* Tighter spacing */
        font-size: 13px;
        line-height: 1.4;
    }

    .gc-info-box {
        padding: 12px;
        margin-bottom: 12px;
    }

    .gc-info-box p {
        margin-bottom: 8px;
        font-size: 13px;
        line-height: 1.4;
    }

    .gc-disclaimer-section h3 {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .gc-info-box {
        padding: 12px;
        margin-bottom: 10px;
    }

    .gc-info-box h4 {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .gc-info-box p {
        font-size: 13px;
        line-height: 1.4;
        margin-bottom: 8px;
    }

    .gc-info-box li {
        font-size: 12px;
        line-height: 1.4;
        margin-bottom: 4px;
    }

    .gc-legal-list {
        padding-left: 18px;
    }

    .gc-acceptance-checkbox {
        padding: 10px;
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .gc-acceptance-checkbox input[type="checkbox"] {
        width: 30px;
        height: 30px;
        margin-top: 0;
        cursor: pointer;
    }

    .gc-acceptance-checkbox label {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .gc-acceptance-checkbox {
        background: #fffbea !important;
        border: 3px solid #ff9800 !important;
    }

    .gc-checkbox-label {
        font-size: 13px;
        line-height: 1.4;
    }

    .gc-welcome-footer {
        padding: 12px 16px;
        min-height: 90px; /* EMERGENCY FIX: Ensure footer visible on mobile */
    }

    .gc-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .gc-footer-note {
        font-size: 11px;
        margin-top: 8px;
    }

    .gc-cookie-option {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .gc-cookie-icon {
        font-size: 32px;
    }

    .gc-cookie-details h4 {
        font-size: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .gc-welcome-footer {
        padding: 20px;
    }

    .gc-footer-buttons {
        flex-direction: column;
    }

    .gc-btn {
        padding: 14px 24px;
        font-size: 15px;
        min-width: 0;
        width: 100%;
    }

    .gc-footer-note {
        font-size: 13px;
        margin-top: 12px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .gc-welcome-header h2 {
        font-size: 20px;
    }

    .gc-disclaimer-section h3 {
        font-size: 18px;
    }

    .gc-info-box h4 {
        font-size: 15px;
    }

    .gc-cookie-details h4 {
        font-size: 15px;
    }
}

/* ========================================
   PRINT STYLES (Hide modal)
   ======================================== */

@media print {
    .gc-welcome-modal {
        display: none !important;
    }
}
