/* ==========================================================================
   MODALS & POPUPS MODULE
   Premium White 3D Theme (Create Post, Share, Comments, Search, Alerts)
   ========================================================================== */

/* ==========================================
   1. BASE MODAL BACKGROUND & CONTENT
   ========================================== */
#comments-modal, #user-list-modal, #share-modal, 
#progress-modal, #exit-modal, #password-prompt-modal, 
#custom-confirm-modal, #custom-alert-modal, #global-notice-modal { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(16, 0, 43, 0.7); backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px);
    z-index: 6000; display: flex; justify-content: center; align-items: center; 
}

/* Premium 3D Platinum Modal Content (Default Popup Size) */
.modal-content { 
    background: #f1f5f9 !important; 
    width: 90%; max-width: 450px; 
    padding: 25px; border-radius: 28px !important; 
    text-align: center; max-height: 85vh; overflow-y: auto; position: relative; 
    border: 3.5px solid transparent !important;
    background-image: linear-gradient(#f1f5f9, #f1f5f9), 
                      linear-gradient(135deg, #ff006e, #8338ec, #00b894, #ffbe0b) !important;
    background-origin: border-box !important;
    background-clip: padding-box, border-box !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    color: #1a1a1a !important;
    transform: translateZ(0); will-change: transform;
}

/* Sunken 3D Inputs */
.modal-input { 
    width: 100%; padding: 14px !important; margin: 10px 0; 
    background: #e2e8f0 !important; border: 2px solid #cbd5e1 !important; 
    color: #000000 !important; border-radius: 16px !important; outline: none; 
    font-size: 1rem; font-weight: 600 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}
.modal-input::placeholder { color: #64748b; }

.modal-content h3 { color: #000000 !important; font-weight: 800 !important; }

/* ==========================================
   2. CREATE POST MODAL (100% FULL SCREEN)
   ========================================== */
#create-post-modal { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: #e5e7eb !important; /* Solid Platinum Gray Background */
    z-index: 5000; display: flex; flex-direction: column; 
}

/* Full Screen Card Reset */
#create-post-modal .modal-content {
    background: #f1f5f9 !important; 
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    border-radius: 0 !important; /* किनारे सीधे (No curves on corners) */
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    border: none !important;
    box-shadow: none !important;
    background-image: none !important; /* ग्रेडिएंट बॉर्डर हटा दी गई */
}

/* Header Inside Create Post */
#create-post-modal h3 {
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-size: 1.2rem !important;
}
#create-post-modal i.fa-xmark {
    color: #1a1a1a !important;
    font-size: 1.8rem !important;
}

/* Post Preview Area (Sunken 3D Look) */
.post-preview-card {
    background: #eaeff5 !important;
    border: 3px solid transparent !important;
    border-radius: 24px !important;
    margin: 20px 0 !important;
    position: relative !important;
    background-image: linear-gradient(#eaeff5, #eaeff5), 
                      linear-gradient(135deg, #ff006e, #8338ec, #00b894, #ffbe0b) !important;
    background-origin: border-box !important;
    background-clip: padding-box, border-box !important;
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.1), 0 10px 25px rgba(0,0,0,0.05) !important;
    overflow: hidden !important;
    flex: 1; /* यह बीच की पूरी जगह घेर लेगा */
    display: flex; align-items: center; justify-content: center;
}

#preview-wrapper img, #preview-wrapper video {
    border-radius: 18px !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
    width: 100%; height: 100%; object-fit: contain;
}

/* Caption Input Area */
#post-caption {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 20px !important;
    padding: 15px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05) !important;
    outline: none !important;
    height: 100px;
    resize: none;
    margin-bottom: 20px;
}
#post-caption::placeholder { color: #94a3b8 !important; }

/* Media Selection & Share Buttons */
#create-post-modal .btn-edit {
    background: #ffffff !important;
    color: #ff006e !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 20px !important;
    padding: 15px !important;
    font-weight: 800 !important;
    box-shadow: 0 6px 12px rgba(0,0,0,0.05) !important;
}

#create-post-modal button[onclick*="handlePublish"] {
    background: linear-gradient(135deg, #ff006e, #8338ec) !important;
    color: white !important;
    padding: 10px 30px !important;
    border-radius: 25px !important;
    font-weight: 800 !important;
    font-size: 1.1rem !important;
    box-shadow: 0 8px 20px rgba(255, 0, 110, 0.3) !important;
    border: none !important;
}

/* ==========================================
   3. COMMENTS MODAL
   ========================================== */
.comment-item { 
    display: flex; gap: 12px; padding: 12px !important; 
    background: #ffffff !important; border-radius: 18px !important;
    margin-bottom: 10px; border: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02) !important;
    text-align: left; align-items: flex-start; 
}
.comment-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid #ff006e; cursor: pointer; }
.comment-body { flex: 1; }
.comment-user { font-weight: 800 !important; color: #000000 !important; font-size: 0.9rem; cursor: pointer; }
.comment-text { font-size: 0.9rem; color: #334155 !important; font-weight: 600; margin-top: 2px; }
.comment-like-container { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #64748b; font-size: 0.8rem; cursor: pointer; }
.comment-like-btn.liked { color: #ff4757; }

/* ==========================================
   4. SHARE MODAL
   ========================================== */
#share-modal { z-index: 6000 !important; }
#share-modal .modal-content { display: flex; flex-direction: column; max-height: 75vh; padding: 0; }
#share-options { flex: 1; overflow-y: auto; padding: 10px; padding-bottom: 80px; }

.share-option { 
    display: flex; align-items: center; gap: 15px; padding: 12px 15px !important; 
    background: #ffffff !important; border: 1.5px solid #e2e8f0 !important;
    border-radius: 18px !important; margin-bottom: 8px !important;
    cursor: pointer; transition: 0.2s; text-align: left; position: relative; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.share-option:active { transform: scale(0.97); }
.share-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid #cbd5e1; }

.share-user-selected { 
    background: #ecfdf5 !important; 
    border-color: #00b894 !important;
}
.share-user-selected .share-avatar { border: 2px solid #00b894; }

/* ==========================================
   5. GLOBAL SEARCH MODAL (Full Screen)
   ========================================== */
#global-search-modal { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: #f1f5f9 !important; z-index: 2500; display: flex; flex-direction: column; 
    transition: 0.3s; transform: translateY(100%);
}
#global-search-input {
    background: #ffffff !important; color: #000 !important; 
    border: 2px solid #e2e8f0 !important; border-radius: 20px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); font-weight: 600;
}
.search-section-title {
    font-size: 0.85rem; color: #333 !important; font-weight: 800 !important; 
    text-transform: uppercase; letter-spacing: 1px; margin: 15px 5px 10px; 
    display: flex; justify-content: space-between; border-bottom: 2px solid #ff006e; display: inline-block;
}
.clear-history-btn { color: #ff006e; cursor: pointer; text-transform: none; font-weight: 700; }
.history-delete-btn { color: #94a3b8; font-size: 1.1rem; padding: 5px; cursor: pointer; }

.search-post-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 15px !important; 
    background: #ffffff !important; border-radius: 18px !important; 
    margin-bottom: 10px !important; border: 1.5px solid #e2e8f0 !important; cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05) !important;
}
.search-post-item:active { transform: scale(0.97); }
.search-post-thumb { width: 55px; height: 55px; border-radius: 10px; object-fit: cover; border: 1px solid #e2e8f0; }
.search-post-caption { font-size: 0.9rem; color: #1a1a1a !important; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-post-type { font-size: 0.75rem; color: #64748b !important; font-weight: 600; margin-top: 3px; }

/* ==========================================
   6. CUSTOM ALERTS & CONFIRM MODALS
   ========================================== */
/* --- MODAL DESIGN FOR WHITE THEME --- */
#custom-confirm-modal .modal-content, 
#custom-alert-modal .modal-content, 
#global-notice-modal .modal-content {
    background: #ffffff !important; 
    border: 3px solid #cbd5e1 !important;
    background-image: none !important; 
    box-shadow: 0 25px 60px rgba(0,0,0,0.15) !important;
    border-radius: 20px !important; /* थोड़ा और गोल (Modern look) */
}

/* --- TITLE & TEXT COLORS (High Contrast for readability) --- */
#confirm-title, 
#custom-alert-title { 
    color: #0f172a !important;      /* एकदम डार्क नेवी ग्रे (बहुत प्रोफेशनल) */
    font-weight: 900 !important; 
    font-size: 1.3rem !important; 
    margin-bottom: 10px !important;
}

#confirm-message, 
#custom-alert-message { 
    color: #475569 !important;      /* हल्का लेकिन साफ़ पढ़ने वाला ग्रे */
    font-weight: 600 !important; 
    font-size: 0.95rem !important; 
    line-height: 1.5 !important;
}

/* --- CANCEL BUTTON (Soft Silver/Grey) --- */
#custom-confirm-modal button[onclick*="closeCustomConfirm"] {
    background: #f1f5f9 !important; 
    color: #334155 !important;      /* डार्क स्लेट ग्रे टेक्स्ट */
    border: 2px solid #cbd5e1 !important; 
    font-weight: 800 !important;
    border-radius: 12px !important;
    transition: 0.3s !important;
}

/* --- YES/CONFIRM BUTTON (Danger Red) --- */
#custom-confirm-modal button[onclick*="executeDynamicConfirm"] {
    background: #ff4757 !important; 
    color: #ffffff !important;      /* सफ़ेद टेक्स्ट ताकि लाल पर अच्छे से दिखे */
    border: none !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
}

/* बटन पर टच का इफ़ेक्ट */
#custom-confirm-modal button:active {
    transform: scale(0.95);
}

/* ==========================================
   7. MEDIA VIEWER (Full Screen Zoom)
   ========================================== */
#media-viewer-modal { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: #000 !important; z-index: 9999 !important; 
    transition: opacity 0.3s; opacity: 0; pointer-events: none; 
}
#media-viewer-modal.active { opacity: 1; pointer-events: all; }
.close-viewer-btn { 
    position: absolute; top: 20px; right: 20px;
    background: rgba(0,0,0,0.5); width: 45px; height: 45px; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; z-index: 10000;
}

/* ==========================================
   8. NOTIFICATIONS & TOASTS
   ========================================== */
.notif-item-full { 
    background: #f8fafc !important; border: 1px solid #e2e8f0 !important; 
    border-radius: 18px !important; box-shadow: 0 4px 10px rgba(0,0,0,0.02); 
}

/* Slide Animations */
.modal-slide-up { animation: fastSlideUp 0.3s cubic-bezier(0.21, 1.02, 0.49, 1) forwards; }
.modal-slide-down { animation: fastSlideDown 0.3s cubic-bezier(0.21, 1.02, 0.49, 1) forwards; }
@keyframes fastSlideUp { from { transform: translate3d(0, 100%, 0); opacity: 0.5; } to { transform: translate3d(0, 0, 0); opacity: 1; } }
@keyframes fastSlideDown { from { transform: translate3d(0, 0, 0); opacity: 1; } to { transform: translate3d(0, 100%, 0); opacity: 0; } }