/**
 * Paidia Quest Progress Modal Styles
 * 
 * Modal components:
 * - Overlay and container
 * - Header with cover image, icon, title
 * - Progress section with slider
 * - Timeline of steps (completed vs incomplete)
 * - Expandable step guidance
 * - Deep-link highlighting animation
 */

/* ===== MODAL OVERLAY ===== */
.paidia-quest-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999999;
    display: block;
    padding: 0;
    margin: 0;
    overflow-y: auto;
}

/* Prevent body scroll when modal is open */
body.paidia-quest-modal-open {
    overflow: hidden;
}

/* ===== MODAL CONTAINER ===== */
.paidia-quest-modal-container {
    position: relative;
    background: #fff;
    border-radius: 0;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    max-width: none;
    max-height: none;
    margin: 0;
    overflow-y: auto;
    box-shadow: none;
    animation: paidiaQuestModalFadeIn 0.3s ease-out;
}

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

/* ===== CLOSE BUTTON ===== */
.paidia-quest-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50% !important;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.paidia-quest-modal-close:hover {
    background: #fff;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.paidia-quest-modal-close i {
    font-size: 18px;
    color: #333;
}

/* ===== HEADER SECTION ===== */
.paidia-quest-modal-header {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 0;
    overflow: hidden;
}

.paidia-quest-modal-cover {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 1;
}

.paidia-quest-modal-header-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
    color: #fff;
}

.paidia-quest-modal-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    backdrop-filter: blur(10px);
}

.paidia-quest-modal-icon i {
    font-size: 28px;
    color: #fff;
}

.paidia-quest-modal-title {
    margin: 0 0 8px 0;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.paidia-quest-modal-subtitle {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* ===== PROGRESS SECTION ===== */
.paidia-quest-modal-progress-section {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.paidia-quest-modal-progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.paidia-quest-modal-progress-percentage {
    font-size: 36px;
    font-weight: 700;
    color: #8b5cf6;
    line-height: 1;
}

.progress-percent-value {
    font-size: 42px;
}

.paidia-quest-modal-progress-steps {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.progress-completed-steps {
    color: #8b5cf6;
    font-weight: 700;
    font-size: 18px;
}

/* Progress Bar */
.paidia-quest-modal-progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(139, 92, 246, 0.15);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

.paidia-quest-modal-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.paidia-quest-modal-promo {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    text-align: center;
}

/* ===== STEPS SECTION ===== */
.paidia-quest-modal-steps-section {
    padding: 30px;
}

.paidia-quest-modal-section-title {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 700;
    color: #1C2E3D;
}

/* Timeline Container */
.paidia-quest-modal-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== STEP ITEM ===== */
.paidia-quest-step-item {
    background: #fff;
    border-radius: 12px;
    border: 2px solid #e0e0e0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.paidia-quest-step-item.step-expandable {
    cursor: pointer;
}

.paidia-quest-step-item.step-expandable:hover {
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

/* Completed Step Styling */
.paidia-quest-step-item.step-completed {
    background: #f0fdf4;
    border-color: #86efac;
}

.paidia-quest-step-item.step-completed:hover {
    border-color: #4ade80;
}

/* Locked Step Styling (for sequential quests - future steps after next step) */
.paidia-quest-step-item.step-locked {
    position: relative;
    background: #f5f5f5;
    border-color: #d0d0d0;
    cursor: not-allowed;
    pointer-events: none;
}

.paidia-quest-step-item.step-locked .paidia-quest-step-header {
    filter: blur(4px);
    opacity: 0.6;
}

.paidia-quest-step-item.step-locked .paidia-quest-step-icon {
    background: #e0e0e0;
}

.paidia-quest-step-item.step-locked .paidia-quest-step-icon i {
    color: #999;
}

.paidia-quest-step-item.step-locked .paidia-quest-step-title,
.paidia-quest-step-item.step-locked .paidia-quest-step-number {
    color: #999;
}

.paidia-quest-step-item.step-locked .paidia-quest-step-xp {
    background: #e8e8e8;
    color: #999;
}

/* Locked step overlay with centered padlock icon */
.paidia-quest-step-item.step-locked::before {
    content: '\f023'; /* Font Awesome lock icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: #999;
    z-index: 10;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Locked step message (for non-logged-in users) */
.paidia-quest-step-locked-message {
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    margin-top: 15px;
    position: relative;
    z-index: 20;
    pointer-events: all;
}

.paidia-quest-step-locked-message p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.paidia-quest-step-locked-message i {
    color: #8b5cf6;
    margin-right: 6px;
}

.paidia-quest-login-btn {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.paidia-quest-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    text-decoration: none;
}

/* Highlighted Step (for deep-linking) */
.paidia-quest-step-item.step-highlighted {
    animation: paidiaStepHighlight 2s ease-out;
}

@keyframes paidiaStepHighlight {
    0%, 100% { box-shadow: 0 0 0 rgba(139, 92, 246, 0); }
    50% { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0.3); }
}

/* Step Header */
.paidia-quest-step-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    position: relative;
}

/* Step Icon */
.paidia-quest-step-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.step-completed .paidia-quest-step-icon {
    background: #86efac;
}

.paidia-quest-step-icon i {
    font-size: 20px;
    color: #666;
}

.step-completed .paidia-quest-step-icon i {
    color: #16a34a;
}

/* Step Info */
.paidia-quest-step-info {
    flex: 1;
}

.paidia-quest-step-number {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.paidia-quest-step-title {
    font-size: 15px;
    font-weight: 600;
    color: #1C2E3D;
    line-height: 1.3;
}

.step-completed .paidia-quest-step-title {
    color: #16a34a;
}

/* Step XP Badge */
.paidia-quest-step-xp {
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}

.step-completed .paidia-quest-step-xp {
    background: #dcfce7;
    color: #16a34a;
}

.paidia-quest-step-xp i {
    margin-right: 4px;
    font-size: 12px;
}

/* Expand Icon */
.paidia-quest-step-expand {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.step-expanded .paidia-quest-step-expand {
    transform: rotate(180deg);
}

.paidia-quest-step-expand i {
    font-size: 14px;
    color: #999;
}

/* ===== STEP GUIDANCE (EXPANDABLE CONTENT) ===== */
.paidia-quest-step-guidance {
    /* Changed: Guidance is now always visible (unfolded) - not expandable */
    padding: 0 15px 15px 15px;
    opacity: 1;
}

.paidia-quest-step-guidance p {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.paidia-quest-step-guidance ul,
.paidia-quest-step-guidance ol {
    margin: 0 0 12px 0;
    padding-left: 20px;
}

.paidia-quest-step-guidance li {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.paidia-quest-step-guidance strong {
    color: #8b5cf6;
    font-weight: 600;
}

.paidia-quest-step-guidance a {
    color: #8b5cf6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.paidia-quest-step-guidance a:hover {
    color: #7c3aed;
    text-decoration: underline;
}

/* ===== LOADING STATE ===== */
.paidia-quest-modal-loading {
    padding: 60px 30px;
    text-align: center;
    color: #999;
}

.paidia-quest-modal-loading i {
    font-size: 40px;
    margin-bottom: 15px;
    color: #8b5cf6;
}

.paidia-quest-modal-loading p {
    margin: 0;
    font-size: 16px;
}

/* ===== ERROR STATE ===== */
.paidia-quest-error {
    padding: 40px 20px;
    text-align: center;
    color: #ef4444;
}

.paidia-quest-error i {
    font-size: 36px;
    margin-bottom: 12px;
}

.paidia-quest-error p {
    margin: 0;
    font-size: 15px;
}

/* ===== NO STEPS STATE ===== */
.paidia-quest-no-steps {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 15px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .paidia-quest-modal-overlay {
        padding: 0;
        display: block;
    }
    
    .paidia-quest-modal-container {
        height: 100vh;
        min-height: 100vh;
        max-height: none;
        max-width: none;
        border-radius: 0;
        margin: 0;
    }
    
    .paidia-quest-modal-header {
        height: 160px;
    }
    
    .paidia-quest-modal-icon {
        width: 50px;
        height: 50px;
    }
    
    .paidia-quest-modal-icon i {
        font-size: 24px;
    }
    
    .paidia-quest-modal-title {
        font-size: 22px;
    }
    
    .paidia-quest-modal-subtitle {
        font-size: 13px;
    }
    
    .paidia-quest-modal-progress-section,
    .paidia-quest-modal-steps-section {
        padding: 20px;
    }
    
    .paidia-quest-modal-progress-percentage {
        font-size: 28px;
    }
    
    .progress-percent-value {
        font-size: 34px;
    }
    
    .paidia-quest-modal-progress-steps {
        font-size: 14px;
    }
    
    .progress-completed-steps {
        font-size: 16px;
    }
    
    .paidia-quest-step-header {
        gap: 12px;
        padding: 12px;
    }
    
    .paidia-quest-step-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
    }
    
    .paidia-quest-step-icon i {
        font-size: 18px;
    }
    
    .paidia-quest-step-title {
        font-size: 14px;
    }
    
    .paidia-quest-step-xp {
        font-size: 12px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .paidia-quest-modal-close {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        top: 10px;
        right: 10px;
    }
    
    .paidia-quest-modal-close i {
        font-size: 16px;
    }
    
    .paidia-quest-modal-header {
        height: 140px;
    }
    
    .paidia-quest-modal-title {
        font-size: 20px;
    }
    
    .paidia-quest-step-number {
        font-size: 10px;
    }
    
    .paidia-quest-step-title {
        font-size: 13px;
    }
}

/* ===== STICKY PHOTO VERIFICATION BUTTON SECTION ===== */
.paidia-quest-modal-photo-section {
    position: sticky;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 80%, rgba(255,255,255,0) 100%);
    padding: 20px 24px 25px 24px !important;
    margin-left: 0;
    margin-right: 0;
    z-index: 100;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 20px;
    display: block !important; /* Ensure container is visible */
}

.paidia-verify-photo-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    text-decoration: none !important;
}

.paidia-verify-photo-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.paidia-verify-photo-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.paidia-verify-photo-btn i {
    font-size: 18px;
    pointer-events: none; /* Ensure clicks on icon bubble to button */
}

/* Ensure steps section doesn't overlap sticky button */
.paidia-quest-modal-steps-section {
    padding-bottom: 100px;
    z-index: 1;
}

/* Mobile adjustments for sticky button */
@media (max-width: 768px) {
    .paidia-quest-modal-photo-section {
        padding: 15px 20px 20px 20px !important;
    }
    
    .paidia-verify-photo-btn {
        padding: 14px 20px !important;
        font-size: 15px;
    }
    
    .paidia-verify-photo-btn i {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .paidia-quest-modal-photo-section {
        padding: 12px 16px 18px 16px !important;
    }
    
    .paidia-verify-photo-btn {
        padding: 12px 18px !important;
        font-size: 14px;
    }
    
    .paidia-verify-photo-btn i {
        font-size: 15px;
    }
}
