/* ==========================================================================
   OurMoods Gallery - Основен Стил (Дървовидно меню и Решетка)
   Файл: style_01.css - Част 1: Глобална структура и Ляво Меню
   ========================================================================== */

#nc-gallery-wrapper {
    display: flex;
    width: 100%;
    min-height: 500px;
    gap: 20px;
    font-family: sans-serif;
    box-sizing: border-box;
}

/* --- ЛЯВА СЕКЦИЯ (НАВИГАЦИЯ ЗА АЛБУМИ) --- */
#nc-sidebar-panel {
    flex: 0 0 280px;
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 15px;
    box-sizing: border-box;
    overflow-y: auto;
}

#nc-sidebar-panel h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    color: #1a202c;
    border-bottom: 2px solid #74B93B;
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Дървовидна навигация (Дърво) */
.nc-tree-branch {
    list-style: none;
    padding-left: 12px;
    margin: 4px 0;
}
#nc-sidebar-panel > .nc-tree-branch {
    padding-left: 0;
}

.nc-tree-node {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
    user-select: none;
    color: #4a5568;
    font-weight: 500;
}

.nc-tree-node:hover {
    background: #f7fafc;
    color: #2d3748;
}

.nc-tree-node.active {
    background: #edf2f7;
    font-weight: bold;
}

.nc-node-toggle {
    margin-right: 6px;
    font-size: 11px;
    width: 12px;
    text-align: center;
    display: inline-block;
    color: #a0aec0;
    transition: transform 0.2s ease;
}

.nc-node-icon {
    margin-right: 8px;
    font-size: 14px;
}

.nc-node-text {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nc-tree-sub-branches {
    display: none;
}
/* --- ЕЛЕГАНТНИ БРОЯЧИ ПОД АЛБУМИТЕ --- */
.nc-menu-meta-box {
    margin: 4px 0 8px 30px;
    padding: 6px 10px;
    background: #f8fafc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: sans-serif;
}

.nc-menu-meta-line {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    margin: 3px 0;
    line-height: 1;
}

/* --- ДЯСНА СЕКЦИЯ (МЕДИЙНА РЕШЕТКА) --- */
#nc-main-canvas {
    flex-grow: 1;
    background: #ffffff;
    padding: 0;
    box-sizing: border-box;
}

#nc-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    width: 100%;
}

.nc-gallery-card {
    background: #fafafa;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-sizing: border-box;
    aspect-ratio: 1 / 1;
}

.nc-card-anchor {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
}
.nc-gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- ЗНАЧКА ЗА ВИДЕО КЛИПОВЕ В РЕШЕТКАТА --- */
.nc-video-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    border-radius: 3px;
    z-index: 2;
    pointer-events: none;
    letter-spacing: 0.5px;
}

/* --- СИСТЕМА ЛАЙТБОКС (ПОПРАВЕНА ВИЗУАЛИЗАЦИЯ) --- */
#nc-lightbox-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.93) !important;
    z-index: 99999999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#nc-lightbox-content-wrapper {
    max-height: 85vh;
    max-width: 90vw;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 100000000;
}

#nc-lightbox-img {
    max-height: 85vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    z-index: 100000001;
}

#nc-lightbox-video {
    max-height: 85vh;
    width: 100%;
    background: #000;
    object-fit: contain;
    display: block;
}
/* Бутони за управление */
.nc-lightbox-btn {
    position: absolute;
    color: rgba(255, 255, 255, 0.7);
    font-size: 36px;
    cursor: pointer;
    user-select: none;
    z-index: 100000010 !important;
    transition: color 0.2s;
}

.nc-lightbox-btn:hover {
    color: #ffffff;
}

#nc-lightbox-close { top: 20px; right: 25px; font-size: 40px; }
#nc-lightbox-prev { left: 25px; }
#nc-lightbox-next { right: 25px; }

/* Динамичен Воден Знак */
.nc-lightbox-watermark {
    position: absolute;
    pointer-events: none;
    z-index: 100000005;
    font-family: monospace;
    white-space: nowrap;
}

/* --- МЕТА ПАНЕЛ И EXIF ТАБЛИЦА В ЛАЙТБОКСА --- */
#nc-lightbox-meta-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    z-index: 100000020 !important;
    box-sizing: border-box;
}

.nc-meta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#nc-meta-filename {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.nc-meta-btn-info {
    background: #444;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.nc-meta-btn-info:hover, .nc-meta-btn-info.active {
    background: #666;
}

#nc-meta-exif-box {
    max-height: 250px;
    overflow-y: auto;
}

.nc-exif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 15px 20px;
}

.nc-exif-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nc-exif-label {
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nc-exif-value {
    font-size: 13px;
    font-weight: 500;
}

/* --- СЪЩИНСКА АНИМАЦИЯ ЗА ПРЕМИГВАНЕ (EXIF LOADING PULSE) --- */
.exif-pulse {
    animation: exifPulseAnimation 1.4s ease-in-out infinite !important;
}

@keyframes exifPulseAnimation {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

/* Адаптивност за мобилни устройства (Напълно оптимизирана за меню и 2-колонна решетка) */
@media (max-width: 768px) {
    
    /* 1. Главният контейнер става вертикален */
    .nc-gallery-container { 
        display: flex !important;
        flex-direction: column !important; 
        gap: 15px !important;
    }
    
    /* 2. Менюто заема 100% ширина най-отгоре */
    .nc-gallery-sidebar { 
        flex: none !important; 
        width: 100% !important; 
        max-width: 100% !important;
        min-width: 0 !important;
        border-right: none !important; 
        border-bottom: 1px solid #ddd !important; 
        padding-right: 0 !important;
        padding-bottom: 20px !important;
        margin-bottom: 10px !important;
    }

    #nc-directory-menu {
        width: 100% !important;
        display: block !important;
    }

    /* 3. Дясната част заема пълна ширина под менюто */
    .nc-gallery-content {
        width: 100% !important;
        flex: none !important; /* Премахваме десктоп стила flex: 4 */
        padding-left: 0 !important;
        margin-left: 0 !important;
    }

    /* 4. РЕШЕТКАТА СЪС СНИМКИ - СИМЕТРИЧНИ 2 КОЛОНИ */
    #nc-images-grid {
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 10px !important; 
    }

    /* --- Запазени контроли на Лайтбокса --- */
    .nc-lightbox-btn { font-size: 28px; }
    #nc-lightbox-close { top: 15px; right: 15px; }
    #nc-lightbox-prev { left: 15px; }
    #nc-lightbox-next { right: 15px; }
}
