/**
 * Paidia Photo Verification Styles
 * Full-screen photo capture modal with masonry gallery
 */

/* ========================================
   Photo Verification Button (in Quest Modal)
   ======================================== */

.paidia-verify-photo-btn {
    width: 100% !important;
    padding: 16px !important;
    margin-top: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white !important;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

.paidia-verify-photo-btn i {
    font-size: 18px;
}

/* ========================================
   Photo Capture Modal
   ======================================== */

.paidia-photo-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.paidia-photo-modal {
    position: relative;
    background: white;
    width: 100%;
    height: 100%;
    max-width: 900px;
    max-height: 100vh;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Photo Upload Section - takes full height, can be hidden */
.paidia-photo-upload-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Fallback Verification Section - takes full height when shown */
.paidia-fallback-verification {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* Desktop: max width and border radius */
@media (min-width: 768px) {
    .paidia-photo-modal {
        max-height: 90vh;
        border-radius: 16px;
    }
}

/* ========================================
   Modal Header
   ======================================== */

.paidia-photo-modal-header {
    padding: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.paidia-photo-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.paidia-photo-modal-close {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50% !important;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.paidia-photo-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.paidia-photo-modal-close i {
    font-size: 18px;
}

/* ========================================
   Instructions
   ======================================== */

.paidia-photo-modal-instructions {
    padding: 16px 20px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.paidia-photo-modal-instructions p {
    margin: 0;
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}

/* ========================================
   Gallery Container
   ======================================== */

.paidia-photo-gallery-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
}

.paidia-photo-gallery {
    width: 100%;
    min-height: 200px;
}

/* Empty state */
.paidia-photo-gallery:empty::before {
    content: 'No photos yet. Click the camera button below to add photos.';
    display: block;
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 14px;
}

/* ========================================
   Masonry Gallery Items
   ======================================== */

.paidia-photo-item {
    position: relative;
    width: calc(50% - 5px);
    margin-bottom: 10px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: white;
}

@media (min-width: 768px) {
    .paidia-photo-item {
        width: calc(33.333% - 7px);
    }
}

.paidia-photo-item img {
    width: 100%;
    height: auto;
    display: block;
}

.paidia-photo-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50% !important;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.paidia-photo-item:hover .paidia-photo-remove {
    opacity: 1;
}

.paidia-photo-remove:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

.paidia-photo-remove i {
    font-size: 14px;
}

/* ========================================
   Footer (Camera + Submit Buttons)
   ======================================== */

.paidia-photo-modal-footer {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.paidia-camera-btn,
.paidia-submit-photos-btn {
    flex: 1;
    padding: 14px !important;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.paidia-camera-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white !important;
}

.paidia-camera-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

.paidia-camera-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.paidia-submit-photos-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white !important;
}

.paidia-submit-photos-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

.paidia-submit-photos-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   Analyzing Animation Overlay
   ======================================== */

.paidia-analyzing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.paidia-analyzing-content {
    text-align: center;
    color: white;
    padding: 40px;
}

.paidia-analyzing-spinner {
    font-size: 64px;
    margin-bottom: 24px;
    color: #10b981;
}

.paidia-analyzing-spinner i {
    animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.7));
    }
    50% {
        opacity: 0.7;
        filter: drop-shadow(0 0 20px rgba(16, 185, 129, 1));
    }
}

.paidia-analyzing-content h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.paidia-analyzing-content p {
    margin: 0;
    font-size: 16px;
    color: #d1d5db;
}

/* ========================================
   No Match Screen
   ======================================== */

.paidia-no-match-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.paidia-no-match-content {
    text-align: center;
    color: white;
    padding: 40px;
    max-width: 400px;
}

.paidia-no-match-content i {
    font-size: 80px;
    color: #f59e0b;
    margin-bottom: 24px;
}

.paidia-no-match-content h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.paidia-no-match-content p {
    margin: 0 0 32px 0;
    font-size: 16px;
    color: #d1d5db;
    line-height: 1.6;
}

.paidia-no-match-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

.paidia-retry-btn,
.paidia-fallback-trigger-btn {
    padding: 16px 28px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.2);
}

.paidia-retry-btn:hover,
.paidia-fallback-trigger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.35);
}

.paidia-retry-btn i,
.paidia-fallback-trigger-btn i {
    font-size: 18px;
}

/* ========================================
   Fallback Verification Styles
   ======================================== */

.paidia-fallback-content {
    padding: 30px 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.paidia-fallback-content h3 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px 0;
    text-align: center;
}

.paidia-fallback-intro {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    text-align: center;
    margin-bottom: 40px;
    line-height: 1.5;
}

/* Venue Search Section */
.paidia-fallback-venue-section {
    margin-bottom: 30px;
}

.paidia-fallback-venue-section label {
    display: block;
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.paidia-fallback-venue-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 14px 18px;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

.paidia-fallback-venue-input:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(255, 255, 255, 0.15);
}

.paidia-fallback-venue-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Venue Results List */
.paidia-fallback-venue-list {
    list-style: none;
    margin: 10px 0 0 0;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.paidia-fallback-venue-item {
    padding: 14px 18px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.paidia-fallback-venue-item:last-child {
    border-bottom: none;
}

.paidia-fallback-venue-item:hover {
    background: rgba(139, 92, 246, 0.3);
}

.paidia-fallback-venue-item i {
    color: #8b5cf6;
    font-size: 16px;
}

.paidia-fallback-venue-item span {
    flex: 1;
    font-size: 16px;
}

/* Selected Venue */
.paidia-fallback-selected {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid rgba(16, 185, 129, 0.4);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.paidia-fallback-venue-name {
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.paidia-fallback-venue-clear {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.paidia-fallback-venue-clear:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Back Button */
.paidia-fallback-back-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.paidia-fallback-back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Submit Button */
.paidia-fallback-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white !important;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    box-shadow: 0 4px 6px rgba(139, 92, 246, 0.3);
}

.paidia-fallback-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.4);
}

.paidia-fallback-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Error Message */
.paidia-fallback-error {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.4);
    border-radius: 12px;
    padding: 14px 18px;
    color: #fca5a5;
    font-size: 14px;
    margin-top: 20px;
    text-align: center;
}


/* ========================================
   Mobile Optimizations
   ======================================== */

@media (max-width: 767px) {
    .paidia-photo-modal-overlay {
        padding: 0;
    }
    
    .paidia-photo-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .paidia-photo-gallery-container {
        padding: 12px;
    }
    
    .paidia-photo-item {
        width: calc(50% - 6px);
    }
    
    .paidia-photo-modal-footer {
        flex-direction: column;
    }
    
    .paidia-camera-btn,
    .paidia-submit-photos-btn {
        width: 100%;
    }
}

/* ========================================
   Body Lock (prevent scroll when modal open)
   ======================================== */

body.paidia-photo-modal-open {
    overflow: hidden;
}
