:root {
    --primary-color: #fff;
    --secondary-color: #ccc;
    --thumb-size: 250px;
    --bg-color: rgba(0, 0, 0, 0.9);
    --border-color: #fff;
    --transition-speed: 0.3s;
    --accent-color: #007bff;
    --download-color: #28a745;
    --copy-color: #ffc107;
    --admin-color: #dc3545;
}
* { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-image: url('tlo.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--primary-color);
    min-height: 100vh;
}
img[loading="lazy"] {
    will-change: transform;
}
img.thumb-loading {
    filter: blur(20px);
    transition: filter 0.3s ease;
}
img.thumb-loaded {
    filter: blur(0);
}
.admin-panel-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: linear-gradient(135deg, var(--admin-color), #c82333);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    backdrop-filter: blur(5px);
}
.admin-panel-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.4); background: linear-gradient(135deg, #c82333, #a71d2a); }
.admin-panel-btn:active { transform: translateY(0); }
@media (max-width: 768px) { .admin-panel-btn { padding: 8px 16px; font-size: 14px; top: 10px; right: 10px; } }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; background-color: rgba(0,0,0,0.7); border-radius: 10px; box-shadow: 0 0 20px rgba(0,0,0,0.5); }
h1 { text-align: center; margin-bottom: 30px; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
h1 a { color: var(--primary-color); text-decoration: none; transition: color var(--transition-speed); }
h1 a:hover { color: var(--secondary-color); text-decoration: underline; }
.search-container { margin: 20px 0 30px 0; text-align: center; }
.search-box { position: relative; max-width: 400px; margin: 0 auto; }
#albumSearch { width: 100%; padding: 12px 40px 12px 20px; font-size: 16px; border: 2px solid var(--border-color); border-radius: 25px; background: rgba(255,255,255,0.1); color: var(--primary-color); transition: all 0.3s ease; }
#albumSearch:focus { outline: none; border-color: var(--accent-color); background: rgba(0,0,0,0.8); }
#albumSearch::placeholder { color: rgba(255,255,255,0.6); }
.clear-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.2); border: none; color: var(--primary-color); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.clear-btn:hover { background: rgba(255,255,255,0.4); transform: translateY(-50%) scale(1.1); }
.search-info { margin-top: 10px; font-size: 0.9em; color: var(--secondary-color); min-height: 30px; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--thumb-size), 1fr)); gap: 25px; justify-content: center; margin-bottom: 40px; }
.album { background: rgba(255,255,255,0.1); border-radius: 8px; overflow: hidden; transition: transform var(--transition-speed), box-shadow var(--transition-speed); border: 1px solid var(--border-color); position: relative; }
.album:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
.album img { width: 100%; height: var(--thumb-size); object-fit: cover; display: block; }
.album a { text-decoration: none; color: inherit; display: block; }
.album-caption { padding: 15px; text-align: center; }
.album-caption .date { font-size: 0.85em; color: var(--secondary-color); margin-bottom: 5px; }
.album-caption .name { font-weight: 600; font-size: 1.1em; margin-bottom: 5px; }
.album-caption .count { font-size: 0.9em; color: var(--secondary-color); }
.download-album-btn { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.7); color: var(--download-color); border: 2px solid var(--download-color); border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; z-index: 10; text-decoration: none; font-size: 1.2em; opacity: 0; }
.album:hover .download-album-btn { opacity: 1; }
.download-album-btn:hover { background: var(--download-color); color: white; transform: scale(1.1); }
.sorting-controls { margin: 20px 0; padding: 15px; background: rgba(255,255,255,0.05); border-radius: 8px; border: 1px solid var(--border-color); display: flex; flex-wrap: wrap; align-items: center; gap: 15px; }
.sorting-controls label { font-weight: bold; color: var(--primary-color); }
.sorting-controls select { padding: 8px 12px; background: rgba(0,0,0,0.8); border: 1px solid var(--border-color); border-radius: 4px; color: var(--primary-color); font-size: 14px; min-width: 220px; cursor: pointer; }
.sorting-info { flex-grow: 1; text-align: right; font-size: 0.9em; color: var(--secondary-color); }
.photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; margin-bottom: 30px; }
.photo-item { position: relative; }
.photos-grid img { width: 100%; height: 250px; object-fit: cover; cursor: pointer; border: 1px solid var(--border-color); border-radius: 4px; transition: transform 0.3s ease, filter 0.3s ease; background: #444; }
.photos-grid img:hover { transform: scale(1.02); }
.photo-checkbox-container { position: absolute; top: 5px; left: 5px; z-index: 15; background: rgba(0,0,0,0.6); border-radius: 5px; padding: 4px; opacity: 0; transition: opacity 0.3s ease; }
.photo-item:hover .photo-checkbox-container { opacity: 1; }
.photo-select { width: 22px; height: 22px; cursor: pointer; }
.download-photo-btn { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,0.7); color: var(--download-color); border: 2px solid var(--download-color); border-radius: 50%; width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; z-index: 10; text-decoration: none; font-size: 1em; opacity: 0; }
.photo-item:hover .download-photo-btn { opacity: 1; }
.download-photo-btn:hover { background: var(--download-color); color: white; transform: scale(1.1); }
.copy-photo-btn { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.7); color: var(--copy-color); border: 2px solid var(--copy-color); border-radius: 50%; width: 35px; height: 35px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; z-index: 10; font-size: 1em; opacity: 0; border: none; }
.photo-item:hover .copy-photo-btn { opacity: 1; }
.copy-photo-btn:hover { background: var(--copy-color); color: black; transform: scale(1.1); }
.album-title-section { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 20px 0 20px 0; padding-bottom: 15px; border-bottom: 2px solid var(--border-color); }
.album-title-main { font-size: 1.8em; font-weight: bold; }
.album-subtitle { font-size: 0.9em; color: var(--secondary-color); font-style: italic; }
.album-buttons { display: flex; gap: 10px; align-items: center; }
.download-full-album-btn { display: inline-block; padding: 8px 16px; background: var(--download-color); color: white; text-decoration: none; border-radius: 6px; transition: all 0.3s ease; font-weight: bold; font-size: 0.9em; white-space: nowrap; }
.download-full-album-btn:hover { background: #218838; transform: translateY(-2px); }
.copy-album-link-btn { display: inline-block; padding: 8px 16px; background: var(--copy-color); color: #333; text-decoration: none; border-radius: 6px; transition: all 0.3s ease; font-weight: bold; cursor: pointer; border: none; font-size: 0.9em; white-space: nowrap; }
.copy-album-link-btn:hover { background: #e0a800; transform: translateY(-2px); }
.batch-actions { margin-bottom: 20px; padding: 15px; background: rgba(255,255,255,0.1); border-radius: 8px; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.batch-actions button { padding: 8px 16px; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; transition: all 0.3s ease; }
#selectAllBtn { background: #007bff; color: white; }
#deselectAllBtn { background: #6c757d; color: white; }
#downloadSelectedBtn { background: #28a745; color: white; }
.batch-actions button:hover { transform: translateY(-2px); opacity: 0.9; }
#selectedCount { font-weight: bold; font-size: 1.1em; }
.history-panel { position: fixed; right: 20px; top: 80px; width: 320px; background: rgba(0,0,0,0.95); border-radius: 12px; border: 1px solid #444; z-index: 1000; backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0,0,0,0.5); display: none; }
.history-panel.show { display: block; animation: slideIn 0.3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }
.history-header { padding: 12px 15px; background: rgba(255,255,255,0.1); border-radius: 12px 12px 0 0; font-weight: bold; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #444; }
.history-header button { background: #dc3545; color: white; border: none; padding: 5px 10px; border-radius: 5px; cursor: pointer; font-size: 12px; }
.history-list { max-height: 350px; overflow-y: auto; }
.history-item { display: flex; align-items: center; gap: 12px; padding: 10px 15px; border-bottom: 1px solid #333; cursor: pointer; transition: background 0.2s ease; }
.history-item:hover { background: rgba(255,255,255,0.1); }
.history-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; }
.history-item-info { flex: 1; }
.history-item-title { font-size: 13px; font-weight: bold; margin-bottom: 3px; }
.history-item-date { font-size: 10px; color: #888; }
.empty-history { padding: 30px; text-align: center; color: #888; }
.exif-info { position: absolute; bottom: 20px; left: 20px; background: rgba(0,0,0,0.7); padding: 8px 15px; border-radius: 8px; font-size: 0.8em; color: var(--secondary-color); z-index: 1001; backdrop-filter: blur(5px); font-family: monospace; pointer-events: none; }
.exif-info span { margin-right: 12px; white-space: nowrap; }
.exif-info .camera { color: #ffc107; }
.exif-info .date { color: #4caf50; }
.exif-info .aperture { color: #2196f3; }
.exif-info .iso { color: #ff9800; }
.lightbox-controls { position: absolute; top: 20px; right: 20px; display: flex; gap: 10px; z-index: 1001; }
.slideshow-btn, .copy-lightbox-btn, .copy-lightbox-photo-btn, .download-lightbox-btn, .reset-zoom-btn, .close-btn { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; border: none; font-size: 1.2em; background: rgba(0,0,0,0.6); color: var(--primary-color); }
.slideshow-btn:hover, .copy-lightbox-btn:hover, .copy-lightbox-photo-btn:hover, .download-lightbox-btn:hover, .reset-zoom-btn:hover, .close-btn:hover { transform: scale(1.1); }
.slideshow-btn:hover { background: var(--accent-color); }
.copy-lightbox-btn:hover { background: var(--copy-color); color: black; }
.copy-lightbox-photo-btn:hover { background: var(--copy-color); color: black; }
.download-lightbox-btn:hover { background: var(--download-color); color: white; }
.reset-zoom-btn:hover, .close-btn:hover { background: rgba(255,255,255,0.3); }
.slideshow-btn.active { background: #4caf50; color: white; }
.slideshow-speed { position: absolute; bottom: 20px; right: 20px; background: rgba(0,0,0,0.7); padding: 8px 12px; border-radius: 20px; font-size: 0.7em; z-index: 1001; display: flex; align-items: center; gap: 8px; backdrop-filter: blur(5px); }
.slideshow-speed label { color: var(--secondary-color); }
.slideshow-speed input { width: 80px; cursor: pointer; background: #333; accent-color: var(--accent-color); }
.slideshow-speed span { color: var(--primary-color); min-width: 35px; }
.lightbox-overlay { display: none; position: fixed; z-index: 1000; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-color); justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s ease; }
.lightbox-overlay.show { display: flex; opacity: 1; }
.lightbox-img-container { position: relative; max-width: 90%; max-height: 90%; transition: transform 0.2s ease; }
.lightbox-overlay img { max-width: 100%; max-height: 90vh; display: block; }
.nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); font-size: 3em; color: var(--primary-color); cursor: pointer; padding: 20px 15px; background: rgba(0,0,0,0.5); border-radius: 50%; user-select: none; z-index: 1001; }
#prev { left: 20px; }
#next { right: 20px; }
.counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: var(--primary-color); font-size: 0.9em; background: rgba(0,0,0,0.5); padding: 5px 12px; border-radius: 20px; z-index: 1001; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; padding: 15px; background: rgba(255,255,255,0.05); border-radius: 8px; border: 1px solid var(--border-color); }
.pagination a, .pagination span { padding: 8px 12px; background: rgba(255,255,255,0.1); border-radius: 4px; color: var(--primary-color); text-decoration: none; transition: all 0.3s ease; min-width: 40px; text-align: center; }
.pagination a:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }
.pagination .current { background: rgba(255,255,255,0.3); font-weight: bold; }
.pagination .disabled { opacity: 0.5; cursor: not-allowed; }
.top-pagination { margin-bottom: 25px; }
.bottom-pagination { margin-top: 25px; }
.page-nav-arrows { position: fixed; top: 50%; left: 0; right: 0; transform: translateY(-50%); z-index: 100; pointer-events: none; }
.page-nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); pointer-events: auto; display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; background: rgba(0,0,0,0.7); border-radius: 50%; color: var(--primary-color); text-decoration: none; font-size: 1.8em; transition: all 0.3s ease; opacity: 0.8; border: 2px solid var(--border-color); z-index: 101; box-shadow: 0 4px 8px rgba(0,0,0,0.3); }
.page-nav-arrow:hover { opacity: 1; background: rgba(0,0,0,0.9); transform: translateY(-50%) scale(1.1); }
.page-nav-arrow.hidden { display: none; }
.page-nav-arrow.prev { left: 20px; }
.page-nav-arrow.next { right: 20px; }
.back-link { display: inline-block; margin-bottom: 20px; padding: 10px 20px; background: rgba(255,255,255,0.1); border-radius: 5px; color: var(--primary-color); text-decoration: none; border: 1px solid var(--border-color); }
.back-link:hover { background: rgba(255,255,255,0.2); }
.loading { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-color); display: flex; justify-content: center; align-items: center; z-index: 9999; transition: opacity 0.3s ease; }
.loading.hidden { opacity: 0; pointer-events: none; }
.copy-toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.9); color: #4caf50; padding: 12px 24px; border-radius: 8px; font-size: 14px; z-index: 9999; animation: fadeOut 2s ease forwards; border: 1px solid #4caf50; pointer-events: none; }
@keyframes fadeOut { 0% { opacity: 1; bottom: 30px; } 70% { opacity: 1; bottom: 30px; } 100% { opacity: 0; bottom: 50px; visibility: hidden; } }
@media (max-width: 768px) {
    :root { --thumb-size: 200px; }
    .photos-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .photos-grid img { height: 150px; }
    .nav-arrow { font-size: 2em; padding: 10px; }
    .pagination a, .pagination span { padding: 5px 8px; min-width: 30px; font-size: 0.8em; }
    .sorting-controls { flex-direction: column; }
    .sorting-info { text-align: left; }
    .page-nav-arrow { width: 40px; height: 40px; font-size: 1.5em; }
    .page-nav-arrow.prev { left: 10px; }
    .page-nav-arrow.next { right: 10px; }
    .download-album-btn { opacity: 1; width: 35px; height: 35px; font-size: 1em; }
    .download-photo-btn { opacity: 1; width: 30px; height: 30px; font-size: 0.9em; }
    .copy-photo-btn { opacity: 1; width: 30px; height: 30px; font-size: 0.9em; }
    .exif-info { font-size: 0.6em; bottom: 10px; left: 10px; }
    .exif-info span { margin-right: 6px; white-space: normal; }
    .slideshow-speed { bottom: 10px; right: 10px; font-size: 0.6em; }
    .slideshow-speed input { width: 60px; }
    .album-title-section { flex-direction: column; text-align: center; }
    .album-buttons { justify-content: center; }
    .history-panel { width: 280px; right: 10px; top: 70px; }
    .batch-actions { flex-direction: column; align-items: stretch; }
    .batch-actions button { width: 100%; }
}
@media (max-width: 480px) {
    :root { --thumb-size: 150px; }
    .photos-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .photos-grid img { height: 120px; }
    body { padding: 10px; }
    .container { padding: 15px; }
    .album-title-main { font-size: 1.4em; }
    .page-nav-arrows { display: none; }
}
.admin-panel-btn-inline:hover { background: #5a6268 !important; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }