/* =========================================
   1. OVERRIDE INSTA FEED PARENT (CRITICAL FIX)
   ========================================= */
/* Ye code Insta Feed plugin ke box ka scroll band karega 
   taaki humara button sticky rahe aur double scroll na aaye */
.insta-feed-container .comment-plugin-box {
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    padding: 0 !important; /* Padding wrapper me handle karenge */
}

/* =========================================
   2. NCMT LAYOUT & SCROLL FIX
   ========================================= */
.ncmt-wrapper {
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  width: 100%;
  height: 100%; /* Full Height of Sheet */
  position: relative;
  display: flex;
  flex-direction: column;
}
.ncmt-wrapper * { box-sizing: border-box; }

/* INTERNAL SCROLL AREA */
.ncmt-list-area {
    flex: 1; /* Bachi hui jagah lega */
    overflow-y: auto; /* Scroll sirf yahan hoga */
    
    /* 🔥 MAGIC CODE: Post scroll hone se rokega */
    overscroll-behavior: contain; 
    
    padding: 15px;
    padding-bottom: 90px; /* Button ke liye jagah */
}

/* =========================================
   3. COMMENT ITEMS
   ========================================= */
.ncmt-itm { margin-bottom: 15px; opacity: 0; animation: slideUp 0.5s ease forwards; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.ncmt-content {
  display: flex;
  align-items: flex-start;
  background: #ffffff;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid #f0f0f0;
}

.ncmt-avatar-wrap { margin-right: 12px; flex-shrink: 0; }
.ncmt-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid #eee; }
.ncmt-body { flex: 1; width: 100%; }

.ncmt-auth { font-weight: 700; font-size: 15px; color: #2c3e50; margin-bottom: 3px; }
.ncmt-txt { font-size: 14px; color: #333; line-height: 1.5; margin-bottom: 8px; }

/* Actions */
.ncmt-actions { margin-top: 5px; display: flex; gap: 15px; font-size: 12px; color: #666; font-weight: 600; }
.ncmt-toggle-rly { cursor: pointer; color: #007bff; }
.ncmt-btn-give-rly { display: none; } /* Hidden by default */

/* =========================================
   4. REPLIES SECTION
   ========================================= */
.ncmt-rly-section { display: none; margin-top: 10px; border-left: 2px solid #f0f0f0; padding-left: 10px; }
.ncmt-rly-section.open { display: block; }

.ncmt-rly-itm { display: flex; margin-top: 8px; padding: 10px; background: #fbfbfb; border-radius: 8px; border: 1px solid #f1f1f1; }
.ncmt-rly-avatar { width: 28px; height: 28px; border-radius: 50%; margin-right: 8px; object-fit: cover; }
.ncmt-rly-auth { font-size: 12px; font-weight: 700; color: #444; margin-bottom: 2px; }
.ncmt-rly-txt { font-size: 12px; color: #555; line-height: 1.4; }

/* =========================================
   5. INLINE REPLY FORM
   ========================================= */
.ncmt-inline-form { margin-top: 10px; padding: 10px; background: #fff; border: 1px solid #eee; border-radius: 8px; }
.ncmt-inline-name, .ncmt-inline-txt { width: 100%; padding: 8px; margin-bottom: 6px; border: 1px solid #ddd; border-radius: 5px; font-size: 12px; }
.ncmt-inline-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ncmt-btn-submit-rly { background: #007bff; color: #fff; border: none; padding: 5px 12px; border-radius: 4px; font-size: 11px; font-weight: 600; cursor: pointer; }
.ncmt-btn-cancel { background: none; border: none; color: #888; font-size: 11px; cursor: pointer; }

/* =========================================
   6. STICKY BUTTON (Thoda Upar Lifted)
   ========================================= */
.ncmt-add-btn-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    
    /* Transparent Background */
    background: linear-gradient(to top, rgba(255,255,255,1) 50%, rgba(255,255,255,0));
    
    /* CHANGE HERE: Teesri value '80px' kar di hai (Ye Bottom Padding hai) */
    /* Pehle: 15px 20px 40px 20px */
    padding: 15px 20px 80px 20px; 
    
    z-index: 10;
    display: flex;
    justify-content: center;
    pointer-events: none; 
}


.ncmt-open-popup-btn {
    pointer-events: auto; /* Button click hona chahiye */
    width: auto;
    min-width: 220px; /* Thoda chaura Pill */
    
    /* DESI BLUE GRADIENT */
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #fff;
    border: none;
    
    padding: 14px 30px; /* Thoda bada button */
    font-size: 16px;
    border-radius: 50px; /* Pura Goli jaisa */
    cursor: pointer;
    
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    
    transition: transform 0.2s, box-shadow 0.2s;
    /* Shadow taaki button hawa me lage */
    box-shadow: 0 8px 20px rgba(0, 91, 187, 0.4); 
}

.ncmt-open-popup-btn:active { 
    transform: scale(0.95); 
}

.ncmt-open-popup-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 91, 187, 0.5);
}

.ncmt-open-popup-btn span.dashicons { 
    color: #fff; 
    font-size: 22px; 
    width: 22px; 
    height: 22px; 
}


/* =========================================
   7. MAIN MODAL
   ========================================= */
.ncmt-modal-window { 
    display: none; position: fixed; 
    z-index: 2147483647; 
    left: 0; top: 0; width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.5); backdrop-filter: blur(3px); 
    align-items: center; justify-content: center; 
}
.ncmt-modal-content { background: #fff; width: 90%; max-width: 380px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.2); animation: slideUp 0.3s ease; }
.ncmt-modal-header { background: #f9f9f9; padding: 15px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.ncmt-modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; color:#333; }
.ncmt-close-modal { font-size: 24px; cursor: pointer; color: #aaa; }
.ncmt-modal-body { padding: 20px; }
.ncmt-modal-body label { font-size: 12px; font-weight: 600; color: #555; margin-bottom: 5px; display: block; }
.ncmt-modal-body input, .ncmt-modal-body textarea { width: 100%; padding: 10px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.ncmt-modal-body textarea { height: 90px; resize: none; }
.ncmt-submit-main-btn { width: 100%; background: #28a745; color: #fff; border: none; padding: 12px; border-radius: 6px; font-weight: 700; font-size: 15px; cursor: pointer; }
