/* =========================================
   1. ALAPBEÁLLÍTÁSOK ÉS VÁLTOZÓK
   ========================================= */
:root {
    --primary: #222;
    --bg: #f3f5f7;
    --text: #333;
    --white: #ffffff;
    
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;

    --radius: 12px;
    --card-shadow: 0 5px 15px rgba(0,0,0,0.05);
    --transition: 0.2s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body { 
    font-family: Arial, Helvetica, sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    margin: 0; 
    padding: 15px; 
    -webkit-tap-highlight-color: transparent; 
}

input, button, select, textarea {
    font-family: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* =========================================
   2. NAVIGÁCIÓ
   ========================================= */
nav { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: var(--white); 
    padding: 10px 20px; 
    border-radius: var(--radius); 
    box-shadow: var(--card-shadow); 
    margin-bottom: 25px; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
}

.brand { 
    font-size: 22px; 
    font-weight: bold; 
    color: var(--primary); 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    transition: opacity var(--transition);
}

.brand:hover {
    opacity: 0.8;
}

.nav-logo {
    height: 40px; 
    width: auto;
    object-fit: contain;
}

/* =========================================
   3. VEZÉRLŐK (KERESÉS, SZŰRÉS)
   ========================================= */
.controls { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 15px; 
    margin-bottom: 30px; 
    background: var(--white); 
    padding: 20px; 
    border-radius: var(--radius); 
    align-items: center; 
    box-shadow: var(--card-shadow);
}

.search-box { flex: 2; min-width: 200px; }
.filter-box { flex: 1; min-width: 150px; }

.search-box input, 
.filter-box select { 
    width: 100%; 
    padding: 12px; 
    border: 2px solid #eee; 
    border-radius: 8px; 
    font-size: 16px; 
    outline: none; 
    transition: border-color var(--transition);
}

.search-box input:focus,
.filter-box select:focus {
    border-color: #bbb;
}

/* =========================================
   4. ALBUM RÁCS (GRID)
   ========================================= */
.albums-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
    gap: 20px; 
}

.album-card { 
    background: var(--white); 
    border-radius: var(--radius); 
    overflow: hidden; 
    box-shadow: var(--card-shadow); 
    cursor: pointer; 
    transition: transform var(--transition); 
}

.album-card:hover { 
    transform: translateY(-5px); 
}

.album-cover { 
    height: 180px; 
    width: 100%; 
    object-fit: cover; 
    background-color: #e0e0e0;
    transition: opacity 0.3s ease-in;
}

.album-info { padding: 18px; }

.album-title { 
    margin: 0; 
    font-size: 18px; 
    color: var(--primary); 
    font-weight: bold; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.album-meta { 
    margin-top: 8px; 
    font-size: 13px; 
    color: #888; 
    display: flex; 
    justify-content: space-between; 
}

.album-badge { 
    background: #eee; 
    color: #555; 
    padding: 4px 10px; 
    border-radius: 20px; 
    font-weight: bold; 
    font-size: 12px; 
}

.no-results-msg {
    text-align: center; 
    display: none; 
    padding: 40px; 
    color: #888;
}

/* =========================================
   5. LAPOZÓ (PAGINATION)
   ========================================= */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-btn {
    background: var(--white);
    border: 1px solid #ddd;
    color: var(--text);
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover { background: var(--bg); border-color: #bbb; }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }


.page-btn.dots {
    border: none;
    background: transparent;
    cursor: default;
    color: #888;
    min-width: 30px;
}

.page-btn.dots:hover {
    background: transparent;
    border: none;
}

.page-btn i {
    font-size: 12px;
}

/* =========================================
   6. GALÉRIA BELSŐ NÉZET
   ========================================= */
#singleGalleryView { display: none; }

.gallery-header { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    margin-bottom: 25px; 
}

.back-btn {
    background-color: var(--white);
    color: var(--primary);
    border: 1px solid #ddd;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.back-btn:hover {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateX(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.back-btn i {
    font-size: 1.1em;
}

.gallery-title-wrapper { flex: 1; overflow: hidden; }
#viewAlbumTitle { margin: 0; font-size: 20px; overflow: hidden; text-overflow: ellipsis; }

.photos-grid {
    display: block;
    column-count: 2;
    column-gap: 15px;
}

@media (min-width: 700px) { .photos-grid { column-count: 3; } }
@media (min-width: 1000px) { .photos-grid { column-count: 4; } }
@media (min-width: 1200px) { .photos-grid { column-count: 5; } }
@media (min-width: 1600px) { .photos-grid { column-count: 6; } }

.photo-item {
    break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 15px 0;
    display: inline-block;
    width: 100%;
    vertical-align: top;
    border-radius: 8px;
    overflow: hidden;
    background-color: #e0e0e0;
}

@keyframes smoothReveal {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}


.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.4s ease;
    cursor: pointer;
}

.photo-item img.loaded {
    opacity: 1;
}

@media (hover: hover) {
    .photo-item:hover img.loaded {
        transform: scale(1.08);
    }
}



/* =========================================
   7. LIGHTBOX (NAGYÍTÁS)
   ========================================= */
#lightbox { 
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.95); 
    z-index: 2000; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
}

.lb-content { 
    position: relative; 
    width: 100%; 
    height: 80%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

#lightboxImg { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain;
    transition: opacity 0.3s ease-in-out;
    will-change: opacity;
}

.lb-fade {
    opacity: 0;
}


.lb-btn { 
    position: absolute; 
    top: 50%; transform: translateY(-50%); 
    background: rgba(255,255,255,0.15); 
    color: white; 
    border: none; 
    font-size: 24px; 
    width: 50px; height: 50px; 
    border-radius: 50%; 
    cursor: pointer; 
    display: flex; justify-content: center; align-items: center; 
    transition: background var(--transition);
}
.lb-btn:hover { background: rgba(255,255,255,0.3); }

.lb-prev { left: 15px; } 
.lb-next { right: 15px; }

.lb-close { 
    position: absolute; 
    top: 20px; right: 20px; 
    width: 50px; height: 50px; 
    display: flex; justify-content: center; align-items: center;
    color: white; 
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 50%; 
    font-size: 28px; 
    cursor: pointer; 
    z-index: 3000; 
    transition: all 0.3s;
    user-select: none; 
}
.lb-close:hover { background: var(--danger); transform: rotate(90deg); }
.lb-footer { height: 10%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; gap: 10px; }
.lb-download { color: var(--primary); background: white; text-decoration: none; padding: 8px 20px; border-radius: 20px; font-weight: bold; font-size: 14px; transition: transform var(--transition); }
.lb-download:hover { transform: scale(1.05); }

/* =========================================
   8. MOBIL OPTIMALIZÁLÁS ÉS EGYEBEK
   ========================================= */

@media (max-width: 768px) { 
    body { padding: 10px; } 
    
    .controls { 
        flex-direction: row; 
        flex-wrap: wrap; 
        gap: 10px; 
        padding: 12px;
    } 

    .search-box { 
        flex: 1 1 100%; 
        min-width: 100%; 
    }

    .filter-box { 
        flex: 1; 
        min-width: 0;
    }

    .search-box input, 
    .filter-box select {
        padding: 10px;
        font-size: 14px;
    }

    
    #lightbox {
        height: 100dvh; 
        padding-bottom: env(safe-area-inset-bottom); 
        touch-action: none; 
    }

    .lb-content {
        height: 85%;
    }

    .lb-btn {
        display: none;
    }

    .lb-close {
        top: max(15px, env(safe-area-inset-top));
        right: max(15px, env(safe-area-inset-right));
        width: 40px; 
        height: 40px;
        font-size: 24px;
        background: rgba(0, 0, 0, 0.5);
    }

    .lb-footer {
        height: 15%;
    }
}

footer {
    text-align: center;
    padding: 30px 10px;
    margin-top: 50px;          
    border-top: 1px solid #ddd;
    color: #888;                
    font-size: 14px;
    background: var(--white);          
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
}

footer strong { color: var(--primary); }




/* =========================================
   9. KÖZÖSSÉGI MÉDIA GOMBOK
   ========================================= */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #fff;
    color: #555;
    text-decoration: none;
    font-size: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-5px);
    color: white;
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.social-link.fb:hover { background-color: #1877F2; }
.social-link.insta:hover { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.social-link.yt:hover { background-color: #FF0000; }