/* ==========================================================
   INSTAGRAM-STYLE GALLERY - PREMIUM LARGE-SCREEN CLEAN CSS
   ========================================================== */

/* 1. Backdrop modal modal dimmer */
.insta-gallery-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    z-index: 2500;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.insta-gallery-backdrop.active {
    display: flex;
    opacity: 1;
}

/* 2. Expanded Container for Large Screens */
.insta-gallery-container {
    width: 92% !important; 
    max-width: 1000px !important; /* Absorbs residual empty margin space space canvas workspace workspace */    height: 85vh !important;
    background: #FFFFFF;
    border-radius: 20px;
    display: flex !important;
    flex-direction: row !important;
    overflow: hidden;
    transform: scale(0.98);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.15); /* Stronger shadow */
}

.insta-gallery-backdrop.active .insta-gallery-container {
    transform: scale(1);
}

/* --- LEFT PANE (Dashboard Grid) --- --- --- */
.insta-left-pane {
    width: 44% !important; 
    border-right: 1px solid #EAEAEA;
    display: flex !important;
    flex-direction: column !important;
    background: #FFFFFF;
}

.insta-pane-header {
    padding: 22px 25px;
    border-bottom: 1px solid #EAEAEA;
    position: relative;
    background: #FFFFFF;
}

.insta-pane-header h2 {
    font-family: 'Inter', 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #111111;
}

.insta-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.insta-search-wrapper i {
    position: absolute;
    left: 14px;
    color: #888888;
    font-size: 1rem;
}

.insta-search {
    width: 100%;
    background: #F8F9FA;
    border: 1px solid #E9ECEF;
    border-radius: 10px;
    padding: 10px 14px 10px 38px;
    color: #333333;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.insta-search:focus {
    border-color: #E1306C;
    background: #FFFFFF;
}

/* 3. STRICT 3-COLUMN ABSOLUTE GRID - NO OVERLAPS NO MASONRY */
.insta-thumbnails-grid {
    flex: 1;
    overflow-y: auto !important;
    padding: 18px !important;
    
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-template-rows: none !important; 
    grid-auto-rows: min-content !important; 
    gap: 15px !important; /* Spacious spacing offsets frames frames */
    align-items: start !important;
    align-content: start !important;
    position: relative !important;
    
    columns: unset !important;
    column-count: unset !important;
    break-inside: unset !important;
}

.insta-thumbnails-grid::-webkit-scrollbar { width: 5px; }
.insta-thumbnails-grid::-webkit-scrollbar-thumb { background: #E0E0E0; border-radius: 5px; }

.insta-thumb-item {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important; 
    border-radius: 18px !important; /* Highly Rounded like screenshot design design layout trigger */
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    background: #F8F9FA !important;
    border: 1px solid rgba(0, 0, 0, 0.03) !important;
    
    float: none !important;
    box-sizing: border-box !important;
    transform: translateZ(0) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.insta-thumb-item:hover {
    transform: scale(1.04) translateZ(0) !important;
    z-index: 5 !important;
}

.insta-thumb-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; 
    display: block !important;
}

/* --- RIGHT PANE (Post Display) --- --- --- */
.insta-right-pane {
    width: 56% !important; 
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important; /* Align top for scroll scroll scroll flows flow */
    align-items: center !important;
    padding: 30px 20px !important; /* Shrunk cushioning offsets offsets setup */
    background: #FAF6F4 !important; /* Soft tinted light offset backdrop matching uploaded picture */
    border-left: 1px solid #EAEAEA;
    position: relative !important;
    overflow-y: auto !important; /* FIX Scroll overflow inside right sheet canvas Canvas */
}

/* Premium Artistic Vertical Watermark Background Canvas Canvas Canvas */
.insta-right-pane::after {
    content: "S\A D\A A\A C";
    position: absolute;
    top: 50%;
    right: 48px; 
    transform: translateY(-50%);
    font-size: 8.5rem;
    font-weight: 900;
    color: rgba(225, 48, 108, 0.08) !important; /* Soft peach/pink tint matching reference layout triggers triggers */
    font-family: 'Outfit', 'Inter', sans-serif;
    white-space: pre !important; 
    text-align: center;
    line-height: 1.1;
    user-select: none; pointer-events: none;
    z-index: 0;
}

.insta-post-card {
    width: 100% !important;
    max-width: 480px !important; 
    background: #FFFFFF !important;
    border-radius: 20px;
    border: 1px solid #EAEAEA;
    overflow: hidden;
    position: relative !important;
    z-index: 10 !important;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.05);
}

.insta-post-header {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #F5F6F7;
}

.insta-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #E1306C 0%, #FBA300 100%);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.8rem; color: #FFFFFF;
}

.insta-header-info div:first-child {
    font-weight: 700; font-size: 0.9rem; color: #1A1A1A;
}
.insta-header-info div:last-child {
    font-size: 0.75rem; color: #6C757D;
}

.insta-post-media {
    width: 100%;
    aspect-ratio: auto !important;
    background: #000000 !important;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}

.insta-post-media img {
    width: 100%; 
    height: auto !important;
    max-height: 480px !important;
    object-fit: contain !important; 
    display: block !important;
}

.insta-post-footer {
    padding: 14px 18px;
}

.insta-actions {
    display: flex; gap: 14px; margin-bottom: 10px;
}

.insta-actions i {
    font-size: 1.4rem; color: #495057; cursor: pointer; transition: all 0.2s;
}

.insta-actions i:hover {
    color: #E1306C;
}

.insta-caption {
    font-size: 0.88rem; color: #343A40; line-height: 1.5;
    max-height: 90px; overflow-y: auto;
}

/* 4. AbsoluteToolbar absolute close closes closes close triggers and */
.insta-close-absolute {
    position: absolute; top: 20px; right: 20px;
    background: #FFFFFF; border: 1px solid #EAEAEA;
    border-radius: 50%; width: 36px; height: 36px; color: #495057;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; cursor: pointer; z-index: 10;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.insta-close-absolute:hover { background: #F8F9FA; color: #111111; }

/* Align both floating triggers trigger buttons buttons correctly correctly flawless flawless */
#sdac-bot-toggle,
#floating-gallery-trigger {
    right: 20px !important; /* Force identical offset alignments alignments alignment setup setup */
    width: 50px !important; 
    height: 50px !important;
}

#floating-gallery-trigger {
    position: fixed;
    bottom: 95px; /* Offset above the AI bot bot Bot */
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #E1306C 0%, #FBA300 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(225, 48, 108, 0.3);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#floating-gallery-trigger i {
    font-size: 1.5rem !important; /* Large icon size sizes size */
    flex-shrink: 0 !important; /* Prevents shrinking inside Flex setups setups */
    display: block !important;
}

#floating-gallery-trigger:hover {
    transform: scale(1.1) rotate(5deg);
}

@media (max-width: 900px) {
    .insta-gallery-container { flex-direction: column !important; height: 85vh; width: 94%; }
    .insta-left-pane { width: 100% !important; height: 45% !important; border-right: none; border-bottom: 1px solid #EAEAEA; }
    .insta-right-pane { width: 100% !important; height: 55% !important; padding: 20px !important; }
    .insta-post-card { max-width: 100% !important; }
}
