/* static/css/style.css */
body { margin: 0; overflow: hidden; font-family: 'Segoe UI', sans-serif; touch-action: none; background-color: #000; }

#loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #111; z-index: 9999; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.8s ease-out; }
.loader-spinner { border: 4px solid #333; border-top: 4px solid #ffae00; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin-bottom: 15px; }
.loader-text { color: #ffae00; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; font-size: 14px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

#ui-container { position: absolute; top: 10px; left: 0; width: 100%; display: flex; flex-direction: column; align-items: center; pointer-events: none; z-index: 10; transition: opacity 0.5s; }
#title { color: #888; margin-bottom: 10px; font-size: 16px; text-shadow: 1px 1px 2px black; font-weight: 600; letter-spacing: 1px; }

#searchAndResults { display: flex; justify-content: center; align-items: flex-start; width: auto; max-width: 90%; perspective: 1000px; }
#searchWrapper { position: relative; display: flex; align-items: center; pointer-events: auto; z-index: 20; }

#searchBar { 
    background: rgba(0, 0, 0, 0.4); 
    backdrop-filter: blur(10px);    
    border: 1px solid rgba(255, 255, 255, 0.2); 
    padding: 10px 40px 10px 15px; 
    border-radius: 25px; 
    color: #fff; 
    width: 300px; 
    font-size: 16px; 
    outline: none; 
    transition: all 0.3s; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); 
    flex-shrink: 0; 
}
#searchBar:focus { 
    border-color: #ffae00; 
    box-shadow: 0 0 15px rgba(255, 174, 0, 0.3); 
    width: 350px; 
    background: rgba(0,0,0,0.7); 
}

#clearBtn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #888; font-size: 18px; cursor: pointer; display: none; padding: 0; line-height: 1; transition: color 0.2s; }
#clearBtn:hover { color: #ffae00; }

#aboutBtn { 
    pointer-events: auto; position: absolute; right: 20px; top: 20px; 
    width: 44px; height: 44px; border-radius: 50%; padding: 0; 
    display: flex; justify-content: center; align-items: center;
    font-size: 22px; font-weight: bold;
    background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(5px); 
    border: 1px solid rgba(255,255,255,0.2); color: #ccc; 
    cursor: pointer; transition: all 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 50;
}
#aboutBtn:hover { 
    border-color: #ffae00; color: #fff; background: rgba(0,0,0,0.7); 
    transform: scale(1.1); box-shadow: 0 0 15px rgba(255, 174, 0, 0.3);
}

#aboutModal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 200; backdrop-filter: blur(5px); justify-content: center; align-items: center; pointer-events: auto; }
#aboutBox { background: rgba(25, 25, 25, 0.95); padding: 40px; border-radius: 15px; border: 1px solid #444; max-width: 500px; width: 85%; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.5); position: relative; transform: scale(0.9); transition: transform 0.3s; }
#aboutBox h2 { color: #ffae00; margin-top: 0; font-size: 20px; letter-spacing: 1px; border-bottom: 1px solid #444; padding-bottom: 15px; margin-bottom: 20px; }
#aboutBox p { color: #ccc; line-height: 1.6; font-size: 14px; margin-bottom: 25px; text-align: left; }
#closeAbout { background: #333; color: #fff; border: 1px solid #555; padding: 10px 30px; border-radius: 20px; cursor: pointer; transition: 0.3s; font-weight: bold; text-transform: uppercase; font-size: 12px; }
#closeAbout:hover { background: #ffae00; color: #000; border-color: #ffae00; }

#resultsList { pointer-events: auto; margin-left: 15px; margin-top: 0; width: 320px; height: 250px; padding-bottom: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -ms-overflow-style: none; background: transparent; display: none; touch-action: pan-y; cursor: grab; mask-image: linear-gradient(to bottom, black 40%, transparent 100%); -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%); }
#resultsList::-webkit-scrollbar { display: none; }
#resultsList:active { cursor: grabbing; }
.list-spacer { width: 100%; height: 125px; pointer-events: none; }
.result-item { padding: 15px 20px; margin-bottom: 10px; background: rgba(15, 15, 15, 0.9); border-radius: 12px; border: 1px solid #333; cursor: pointer; color: #ccc; text-align: left; transition: transform 0.1s ease-out, opacity 0.1s ease-out, filter 0.1s; transform-origin: center top; will-change: transform, opacity; }
.result-item:active { background: #333; }
.result-title { font-weight: bold; font-size: 16px; color: #ffae00; margin-bottom: 2px; }
.result-author { font-size: 13px; color: #aaa; }
.result-collection { font-size: 11px; color: #666; font-style: italic; margin-top: 2px;}

#nav-dock { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: row; gap: 20px; z-index: 20; pointer-events: auto; padding: 15px; background: rgba(20, 20, 20, 0.4); backdrop-filter: blur(10px); border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37); transition: opacity 0.5s; }
.nav-btn { width: 70px; height: 70px; border-radius: 15px; background-size: cover; background-position: center; background-color: #222; border: 2px solid #444; cursor: pointer; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.5); }
.nav-btn:hover { transform: scale(1.15) translateY(-5px); border-color: #ffae00; box-shadow: 0 0 20px rgba(255, 174, 0, 0.4); z-index: 25; }
.nav-btn::after { content: attr(data-title); position: absolute; left: 50%; top: -40px; transform: translateX(-50%); background: rgba(0,0,0,0.9); color: #fff; padding: 5px 10px; border-radius: 5px; font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: all 0.2s; border: 1px solid #ffae00; }
.nav-btn:hover::after { opacity: 1; transform: translateX(-50%) translateY(-5px); }

#btn-show-details { 
    position: absolute; bottom: 130px; left: 50%; transform: translateX(-50%); 
    display: none; 
    width: 60px; height: 60px; 
    border-radius: 50%; padding: 0;
    display: flex; justify-content: center; align-items: center;
    font-size: 26px; 
    background: rgba(20, 20, 20, 0.7); backdrop-filter: blur(5px);
    border: 1px solid #ffae00; color: #ffae00; 
    cursor: pointer; z-index: 250; 
    box-shadow: 0 0 15px rgba(0,0,0,0.8); transition: all 0.3s ease; 
}
#btn-show-details:hover { 
    background: #ffae00; color: #000; 
    box-shadow: 0 0 25px rgba(255, 174, 0, 0.5); 
    transform: translateX(-50%) scale(1.1); 
}

.nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.6); color: #ffae00; border: 2px solid #ffae00; border-radius: 50%; width: 50px; height: 50px; font-size: 24px; font-weight: bold; display: none; align-items: center; justify-content: center; cursor: pointer; z-index: 160; transition: all 0.3s; user-select: none; }
.nav-arrow:hover { background: #ffae00; color: #000; transform: translateY(-50%) scale(1.1); box-shadow: 0 0 15px rgba(255, 174, 0, 0.6); }
#btn-prev { left: 40px; }
#btn-next { right: 40px; }

@media (max-width: 600px) {
    #btn-prev { left: 10px; width: 40px; height: 40px; font-size: 18px; }
    #btn-next { right: 10px; width: 40px; height: 40px; font-size: 18px; }
    #searchBar { width: 80%; font-size: 16px; } 
    #searchBar:focus { width: 90%; }
    #resultsList { width: 90%; margin-left: 0; margin-top: 15px; height: 200px; }
    .list-spacer { height: 100px; }
    #aboutBtn { right: 10px; padding: 0; font-size: 18px; top: 5px; width: 40px; height: 40px; } 
    #popup { bottom: 90px; width: 85%; padding: 15px; } 
    #nav-dock { bottom: 10px; width: 90%; gap: 10px; }
    .nav-btn { width: 50px; height: 50px; }
    #btn-show-details { bottom: 130px; width: 50px; height: 50px; font-size: 22px; }
}

#popup { position: absolute; display: none; bottom: 30px; left: 50%; transform: translateX(-50%); background: rgba(15, 15, 15, 0.95); backdrop-filter: blur(5px); padding: 20px; border-radius: 12px; box-shadow: 0 5px 30px rgba(0,0,0,0.8); border: 1px solid #444; pointer-events: auto; width: 90%; max-width: 400px; z-index: 100; color: #e0e0e0; transition: opacity 0.3s, transform 0.3s; text-align: center; }
#popup h3 { margin: 0 0 5px 0; font-size: 18px; color: #ffae00; border-bottom: 1px solid #444; padding-bottom: 5px;}
#popup .author { font-style: italic; color: #aaa; margin-bottom: 5px; font-weight: bold; font-size: 14px;}
#popup .collection-tag { color: #4da6ff; font-size: 12px; margin-bottom: 10px; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; font-weight: bold; display: inline-block; transition: color 0.2s; }
#popup .collection-tag:hover { color: #80c1ff; text-decoration: underline; }
#popup .descriere-content { font-size: 13px; color: #ccc; line-height: 1.4; max-height: 100px; overflow-y: auto; text-align: left; }
#popup-highres { margin-bottom: 10px; display: none; text-align: center; }
#popup-highres img { max-width: 100%; max-height: 180px; border-radius: 4px; box-shadow: 0 0 10px rgba(0,0,0,0.5); border: 1px solid #444; }

.popup-actions { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 15px; width: 100%; }

.btn-open { flex: 1; display: block; background: linear-gradient(45deg, #ffae00, #ff8800); color: #000; text-align: center; padding: 10px 0; border-radius: 25px; text-decoration: none; font-weight: bold; font-size: 14px; box-shadow: 0 4px 15px rgba(255, 174, 0, 0.3); transition: transform 0.2s; cursor: pointer; }
.btn-open:active { transform: scale(0.95); }

.btn-copy { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #555; background: rgba(255,255,255,0.1); color: #ccc; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: all 0.2s; }
.btn-copy:hover { border-color: #ffae00; color: #ffae00; transform: scale(1.1); background: rgba(255,255,255,0.2); }

#hover-tooltip { position: fixed; background: rgba(0, 0, 0, 0.9); color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 13px; pointer-events: none; z-index: 9000; display: none; border: 1px solid #ffae00; box-shadow: 4px 4px 15px rgba(0,0,0,0.7); transform-origin: top left; transform: rotate(-90deg) translateX(-100%); white-space: nowrap; font-family: 'Segoe UI', sans-serif; text-transform: uppercase; letter-spacing: 1px; }

#book-viewer { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.95); z-index: 10000; flex-direction: column; justify-content: center; align-items: center; backdrop-filter: blur(10px); }
#viewer-content { display: flex; align-items: center; justify-content: center; gap: 20px; height: 85%; width: 100%; overflow: hidden; position: relative;}

#panzoom-container { width: 80%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: grab; }
#panzoom-container:active { cursor: grabbing; }

#viewer-image { 
    max-height: 100%; max-width: 100%; 
    box-shadow: 0 0 30px rgba(0,0,0,0.8); 
    border: 1px solid #333; border-radius: 4px; 
    transition: opacity 0.3s ease; 
    touch-action: none; user-select: none; -webkit-user-drag: none;
}

.viewer-arrow { background: rgba(255, 174, 0, 0.1); color: #ffae00; border: 1px solid #ffae00; border-radius: 50%; width: 50px; height: 50px; font-size: 20px; cursor: pointer; transition: all 0.3s; z-index: 10001; flex-shrink: 0;}
.viewer-arrow:hover { background: #ffae00; color: #000; transform: scale(1.1); }
#viewer-close { position: absolute; top: 20px; right: 20px; background: transparent; color: #888; border: 1px solid #444; padding: 10px 20px; border-radius: 20px; cursor: pointer; text-transform: uppercase; font-size: 12px; transition: 0.3s; z-index: 10002;}
#viewer-close:hover { border-color: #ffae00; color: #ffae00; }
#viewer-counter { color: #888; margin-top: 15px; font-family: 'Segoe UI', sans-serif; letter-spacing: 2px; font-size: 14px; z-index: 10002;}

#viewer-reset { 
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); 
    background: rgba(0, 0, 0, 0.6); border: 1px solid #ffae00; color: #ffae00; 
    border-radius: 30px; padding: 8px 20px; font-size: 14px; cursor: pointer; 
    z-index: 10002; text-transform: uppercase; letter-spacing: 1px; font-weight: bold; 
    display: flex; align-items: center; gap: 5px; backdrop-filter: blur(5px);
    transition: all 0.2s;
}
#viewer-reset:active { background: #ffae00; color: #000; }

/* STILURI ARTICOL STIL ZIAR */
#html-container { 
    display:none; width: 90%; max-width:800px; height: 100%; background: #fff; color: #111; padding: 40px; 
    overflow-y: auto; box-sizing: border-box; border-radius: 4px; font-family: 'Georgia', serif; line-height: 1.6; text-align:left;
}
.article-header { border-bottom: 2px solid #000; margin-bottom: 20px; padding-bottom: 10px; display: flex; justify-content: space-between; align-items: flex-end; }
.art-title { font-family: 'Impact', 'Arial Black', sans-serif; font-size: 48px; text-transform: uppercase; margin: 0; line-height: 1.1; flex: 1; }
.art-meta { text-align: right; font-size: 14px; color: #444; font-family: 'Segoe UI', sans-serif; font-weight: bold; }

.article-columns { column-count: 2; column-gap: 30px; text-align: justify; }
@media (max-width: 600px) { .article-columns { column-count: 1; } }

.article-columns p { margin-top: 0; margin-bottom: 15px; }
.article-img-std { width: 100%; margin-bottom: 15px; border-radius: 2px; break-inside: avoid; display: block; }
.article-img-wide { width: 100%; margin-bottom: 15px; border-radius: 2px; break-inside: avoid; column-span: all; display: block; }

#html-date { color:#666; font-size:12px; margin-top:30px; border-top:1px solid #eee; padding-top:10px; text-align:right; font-family: sans-serif; }

@media (max-width: 600px) {
    #panzoom-container { width: 100%; }
    .viewer-arrow { position: absolute; bottom: 50px; }
    #viewer-prev { left: 20px; }
    #viewer-next { right: 20px; }
    #viewer-content { width: 100%; gap: 0; }
    .art-title { font-size: 32px; }
}

@media (max-height: 500px) and (orientation: landscape) {
    #nav-dock { bottom: auto; left: auto; top: 50%; right: 15px; transform: translateY(-50%); flex-direction: column; width: auto; gap: 10px; padding: 10px; }
    .nav-btn { width: 50px; height: 50px; }
    #btn-show-details { bottom: 15px; left: 20px; right: auto; transform: none; }
    #btn-next { right: 90px; }
    #btn-prev { left: 20px; bottom: 80px; top: auto; }
    #ui-container { top: 5px; }
    #title { display: none; }
    #searchBar { padding: 5px 15px; font-size: 14px; width: 250px; }
}

#pano-container { width: 80%; height: 100%; display: none; }
@media (max-width: 600px) {
    #pano-container { width: 100%; }
}

/* PANORAMA IN ARTICOLE */
.pannellum-article-viewer { position: relative; height: 350px; margin-bottom: 15px; border-radius: 4px; break-inside: avoid; overflow: hidden; border: 1px solid #ccc; background: #eee; display: block; }
.pannellum-article-viewer.article-img-wide { column-span: all; }