/**
 * V36.0.0 WELCOME MODAL - COMPLETE REBUILD
 * Created: January 27, 2025
 * 
 * Features:
 * - 5 feature cards (Civic, Jobs, Learning, FAQ, Personalisation)
 * - Integrated personalization opt-in with postcode input
 * - Modern, clean design
 * - Fully responsive (desktop and mobile)
 * - Smooth animations
 */

/* ===========================
   SUPPRESS OLD MODALS (V36.3.3 - Fixed specificity)
   =========================== */

/* Suppress old personalization modal by specific ID only */
#personalizationModal {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    z-index: -1 !important;
}

/* Suppress unified onboarding modal by specific ID only */
#unifiedOnboardingModal {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
    z-index: -1 !important;
}

/* ===========================
   MODAL STRUCTURE
   =========================== */

.wdp-welcome-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    align-items: center;
    justify-content: center;
}

.wdp-welcome-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.wdp-welcome-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.wdp-welcome-container {
    position: relative;
    background: white;
    border-radius: 20px;
    max-width: 1000px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

/* Close Button */
.wdp-welcome-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.3); /* Increased from 0.1 for better visibility */
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    transition: all 0.2s;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); /* Added shadow for depth */
}

.wdp-welcome-close:hover {
    background: rgba(0, 0, 0, 0.5); /* Increased from 0.2 for better visibility */
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Stronger shadow on hover */
}

/* ===========================
   HEADER
   =========================== */

.wdp-welcome-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    border-radius: 20px 20px 0 0;
}

.wdp-welcome-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(14deg); }
    20%, 40% { transform: rotate(-8deg); }
    50% { transform: rotate(0deg); }
}

.wdp-welcome-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.wdp-welcome-header p {
    font-size: 1rem;
    opacity: 0.95;
    margin: 0;
}

/* ===========================
   FEATURE CARDS GRID
   =========================== */

.wdp-welcome-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem;
}

.wdp-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Informational cards (no hover effects, no cursor pointer) */
.wdp-card-info {
    cursor: default;
}

/* Only personalization card remains interactive */
.wdp-card-personalization {
    cursor: default;
}

.wdp-card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.wdp-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 0.5rem 0;
}

.wdp-card p {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
}

.wdp-card p:last-of-type {
    margin-bottom: 0;
}

.wdp-card p strong {
    color: #2d3748;
    font-weight: 600;
}

.wdp-card small {
    display: block;
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.4;
}

/* Arrow removed - cards are now informational only, not clickable */

/* ===========================
   PERSONALISATION CARD (Special)
   =========================== */

.wdp-card-personalization {
    grid-column: 1 / -1; /* Full width */
    background: linear-gradient(135deg, #fef5e7 0%, #fdebd0 100%);
    border-color: #f39c12;
    cursor: default;
}

.wdp-card-personalization:hover {
    transform: none;
    box-shadow: none;
    border-color: #f39c12;
}

.wdp-personalization-form {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wdp-personalization-form label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
}

.wdp-personalization-form input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #f39c12;
}

.wdp-personalization-form input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e67e22;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
}

.wdp-personalization-form input[type="text"]:focus {
    outline: none;
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

.wdp-save-personalization {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.wdp-save-personalization:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.3);
}

.wdp-save-personalization:active {
    transform: translateY(0);
}

/* ===========================
   FOOTER
   =========================== */

.wdp-welcome-footer {
    padding: 1.5rem;
    background: #f7fafc;
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    border-radius: 0 0 20px 20px;
}

.wdp-btn-primary,
.wdp-btn-secondary {
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.wdp-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.wdp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.wdp-btn-secondary {
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.wdp-btn-secondary:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

/* ===========================
   ANIMATIONS
   =========================== */

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 768px) {
    .wdp-welcome-container {
        width: 96%;
        max-height: 95vh;
        border-radius: 16px;
    }
    
    .wdp-welcome-header {
        padding: 1.5rem 1rem;
        border-radius: 16px 16px 0 0;
    }
    
    .wdp-welcome-header h2 {
        font-size: 1.5rem;
    }
    
    .wdp-welcome-header p {
        font-size: 0.9rem;
    }
    
    .wdp-welcome-cards {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 0.875rem;
        padding: 1rem;
    }
    
    .wdp-card {
        padding: 1rem;
    }
    
    .wdp-card-icon {
        font-size: 2rem;
    }
    
    .wdp-card h3 {
        font-size: 1.05rem;
    }
    
    .wdp-card p {
        font-size: 0.85rem;
    }
    
    .wdp-card-personalization {
        grid-column: 1; /* Reset full width on mobile */
    }
    
    .wdp-welcome-footer {
        flex-direction: column;
        padding: 1rem;
    }
    
    .wdp-btn-primary,
    .wdp-btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* Smaller mobile devices */
@media (max-width: 480px) {
    .wdp-welcome-icon {
        font-size: 2.5rem;
    }
    
    .wdp-welcome-header h2 {
        font-size: 1.35rem;
    }
    
    .wdp-card-icon {
        font-size: 1.75rem;
    }
}

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

/* Keyboard focus states */
.wdp-card:focus,
.wdp-welcome-close:focus,
.wdp-btn-primary:focus,
.wdp-btn-secondary:focus,
.wdp-save-personalization:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .wdp-welcome-modal.active,
    .wdp-welcome-container,
    .wdp-card,
    .wdp-welcome-close,
    .wdp-btn-primary,
    .wdp-btn-secondary,
    .wdp-save-personalization {
        animation: none;
        transition: none;
    }
    
    .wdp-welcome-icon {
        animation: none;
    }
    
    .wdp-card:hover {
        transform: none;
    }
}
