/* Piwigo-Style Gallery Module */

.piwigo-gallery {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    width: 100%;
    padding: 20px;
    background: #fff;
    box-sizing: border-box;
}

/* Admin Bar */
.pw-admin-bar {
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #343a40;
    border-radius: 6px;
}

.pw-admin-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #28a745;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.pw-admin-btn:hover {
    background: #218838;
}

/* Breadcrumb */
.pw-breadcrumb {
    padding: 10px 0;
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 20px;
}

.pw-breadcrumb-link {
    color: #0066cc;
    text-decoration: none;
}

.pw-breadcrumb-link:hover {
    text-decoration: underline;
}

.pw-breadcrumb-separator {
    color: #999;
    margin: 0 6px;
}

.pw-breadcrumb-current {
    color: #333;
}

/* Stats */
.pw-stats {
    margin-bottom: 20px;
    font-size: 15px;
    color: #6c757d;
}

.pw-total-count {
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 500;
}

/* Albums Grid - Piwigo Style */
.pw-albums-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: flex-start;
}

.pw-album-card {
    position: relative;
    width: 200px;
    height: 150px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.pw-album-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    transform: translateY(-3px);
}

.pw-album-card a {
    text-decoration: none !important;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
}

.pw-album-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #2c3e50;
}

.pw-album-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.pw-album-card:hover .pw-album-img {
    transform: scale(1.08);
}

.pw-album-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.85) 100%);
    pointer-events: none;
}

.pw-album-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 12px;
    z-index: 2;
}

.pw-album-title {
    margin: 0 0 2px 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pw-album-count {
    font-size: 12px;
    color: #ff9500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Sub-Albums Section */
.pw-subalbums-title,
.pw-photos-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 20px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.pw-subalbums-grid {
    margin-bottom: 30px;
}

.pw-subalbum-card {
    width: 160px;
    height: 120px;
}

.pw-subalbum-card .pw-album-info {
    padding: 6px 8px;
}

.pw-subalbum-card .pw-album-name {
    font-size: 12px;
}

.pw-subalbum-card .pw-album-count {
    font-size: 10px;
}

/* Photos Toolbar */
.pw-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    flex-wrap: wrap;
    gap: 12px;
}

.pw-search {
    display: flex;
    gap: 0;
}

.pw-search-input {
    padding: 8px 14px;
    border: 1px solid #ced4da;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    min-width: 200px;
    outline: none;
}

.pw-search-input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
}

.pw-search-btn {
    padding: 8px 14px;
    background: #007bff;
    color: #fff;
    border: 1px solid #007bff;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 14px;
}

.pw-search-btn:hover {
    background: #0056b3;
}

.pw-sort-select {
    padding: 8px 14px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

/* Photos Grid - Justified Layout */
.pw-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 30px;
}

.pw-photo-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: #e9ecef;
    border-radius: 4px;
}

.pw-photo-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.pw-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.pw-photo-item:hover .pw-photo-img {
    transform: scale(1.05);
    filter: brightness(0.9);
}

/* No Content */
.pw-no-content {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
    color: #6c757d;
    font-size: 16px;
}

/* Pagination */
.pw-pagination {
    margin-top: 25px;
    text-align: center;
}

.pw-pager {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.pw-page-link {
    display: inline-block;
    padding: 6px 12px;
    color: #495057;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.pw-page-link:hover {
    background: #e9ecef;
    color: #212529;
}

.pw-page-current {
    background: #007bff !important;
    color: #fff !important;
}

.pw-page-prev,
.pw-page-next {
    font-weight: 500;
}

.pw-page-ellipsis {
    padding: 6px 8px;
    color: #adb5bd;
}

/* Lightbox - Piwigo Style */
.pw-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pw-lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pw-lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: calc(100% - 200px);
    max-height: calc(100% - 120px);
}

.pw-lightbox-content img,
.pw-lightbox-content video {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease;
}

.pw-lightbox-content audio {
    width: 400px;
    max-width: 90vw;
}

.pw-lightbox-close {
    position: fixed;
    top: 15px;
    right: 20px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.pw-lightbox-close:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.1);
}

/* Navigation with thumbnails - Piwigo style */
.pw-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 5;
}

.pw-lightbox-nav-prev {
    left: 10px;
    flex-direction: row;
}

.pw-lightbox-nav-next {
    right: 10px;
    flex-direction: row;
}

.pw-nav-thumb-container {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.3);
    transition: all 0.2s;
    opacity: 0.6;
}

.pw-lightbox-nav:hover .pw-nav-thumb-container {
    border-color: rgba(255,255,255,0.7);
    opacity: 1;
}

.pw-nav-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pw-lightbox-prev,
.pw-lightbox-next {
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 40px;
    height: 60px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pw-lightbox-nav-prev .pw-lightbox-prev {
    border-radius: 0 4px 4px 0;
    margin-left: -2px;
}

.pw-lightbox-nav-next .pw-lightbox-next {
    border-radius: 4px 0 0 4px;
    margin-right: -2px;
}

.pw-lightbox-prev:hover,
.pw-lightbox-next:hover {
    background: rgba(0,0,0,0.7);
}

/* Info panel with title, description, and counter */
.pw-lightbox-info {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 40px 20px 20px;
    text-align: center;
}

.pw-lightbox-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.pw-lightbox-description {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin: 0 0 10px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.pw-lightbox-counter {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
}

/* Video/Audio thumbnail overlays */
.pw-media-thumb {
    position: relative;
    width: 100%;
    height: 100%;
}

.pw-video-thumb .pw-play-icon,
.pw-audio-thumb .pw-audio-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    opacity: 0.9;
    pointer-events: none;
}

.pw-video-thumb .pw-play-icon {
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    padding-left: 4px;
}

.pw-audio-thumb .pw-audio-icon {
    width: 50px;
    height: 50px;
    background: rgba(102,51,153,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* ================================================
   PHOTO DETAIL PAGE (Piwigo-style)
   ================================================ */
.pw-detail-view {
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}

/* Toolbar at top */
.pw-detail-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #333;
    border-bottom: 1px solid #444;
}

.pw-detail-toolbar-left,
.pw-detail-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pw-detail-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #444;
    border: none;
    border-radius: 4px;
    color: #ccc;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.pw-detail-tool-btn:hover {
    background: #555;
    color: #fff;
    text-decoration: none;
}

.pw-detail-nav-btn {
    background: #555;
}

.pw-detail-counter {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    padding: 0 10px;
}

.pw-detail-container {
    display: flex;
    gap: 0;
    min-height: 500px;
}

/* Main media area - left side */
.pw-detail-media {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    padding: 20px;
}

.pw-detail-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.4);
}

.pw-detail-video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.4);
}

.pw-detail-audio-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
}

.pw-detail-audio-art {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.4);
}

.pw-detail-audio {
    width: 100%;
    max-width: 400px;
}

/* Info panel - right side */
.pw-detail-info {
    width: 280px;
    background: #404040;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Prev/Next thumbnail navigation */
.pw-detail-nav-thumbs {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.pw-detail-thumb-link {
    display: block;
    width: 70px;
    height: 70px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid #555;
    transition: all 0.2s;
}

.pw-detail-thumb-link:hover {
    border-color: #fff;
    transform: scale(1.05);
}

.pw-detail-thumb-prev {
    position: relative;
}

.pw-detail-thumb-prev::before {
    content: '◄';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 12px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    z-index: 1;
}

.pw-detail-thumb-next {
    position: relative;
}

.pw-detail-thumb-next::before {
    content: '►';
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 12px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    z-index: 1;
}

.pw-detail-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Meta info fields */
.pw-detail-meta {
    flex: 1;
}

.pw-detail-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

.pw-detail-field {
    margin-bottom: 15px;
}

.pw-detail-label {
    display: block;
    color: #999;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.pw-detail-value {
    display: block;
    color: #fff;
    font-size: 14px;
}

.pw-detail-link {
    color: #f90;
    text-decoration: none;
}

.pw-detail-link:hover {
    color: #fb0;
    text-decoration: underline;
}

.pw-detail-date {
    color: #f90;
}

.pw-detail-desc {
    color: #ccc;
    font-size: 14px;
    line-height: 1.5;
    margin: 4px 0 0 0;
}

/* Responsive Design */
@media (max-width: 992px) {
    .pw-album-card {
        width: 180px;
        height: 135px;
    }
    .pw-photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .piwigo-gallery {
        padding: 10px;
    }
    .pw-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .pw-search {
        width: 100%;
    }
    .pw-search-input {
        flex: 1;
        min-width: auto;
    }
    .pw-albums-grid {
        justify-content: center;
    }
    .pw-album-card {
        width: 160px;
        height: 120px;
    }
    .pw-album-title {
        font-size: 12px;
    }
    .pw-album-count {
        font-size: 11px;
    }
    .pw-photos-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }
    .pw-lightbox-prev,
    .pw-lightbox-next {
        width: 45px;
        height: 60px;
        font-size: 22px;
    }
    /* Detail page responsive */
    .pw-detail-container {
        flex-direction: column;
    }
    .pw-detail-info {
        width: 100%;
    }
    .pw-detail-nav-thumbs {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .pw-album-card {
        width: calc(50% - 8px);
        height: 100px;
    }
    .pw-photos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pw-detail-thumb-link {
        width: 55px;
        height: 55px;
    }
}

/* Edit Module Styles */
.dnnMediaGalleryEdit {
    padding: 20px;
    background: #f8f9fa;
}

.mg-grid {
    width: 100%;
    margin-top: 15px;
    background: #fff;
}

.mg-grid-thumb {
    border-radius: 4px;
    object-fit: cover;
}

.mg-action-btn {
    display: inline-block;
    padding: 5px 10px;
    margin-right: 5px;
    color: #007bff;
}

.mg-action-btn:hover {
    color: #0056b3;
}

.mg-action-delete {
    color: #dc3545 !important;
}

.mg-action-delete:hover {
    color: #a71d2a !important;
}

.mg-sort-order,
.mg-number-input {
    width: 80px;
}

.mg-return-link {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

/* File Upload Styles */
.mg-current-file {
    display: block;
    margin-top: 8px;
    color: #28a745;
    font-size: 13px;
    font-weight: 500;
}

.mg-file-hint {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

/* Upload Method Tabs */
.mg-upload-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.mg-upload-tab {
    padding: 8px 16px;
    border: 1px solid #ced4da;
    border-radius: 4px 4px 0 0;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.mg-upload-tab:hover {
    background: #e9ecef;
}

.mg-upload-tab.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.mg-upload-content {
    border: 1px solid #ced4da;
    border-radius: 0 4px 4px 4px;
    padding: 15px;
    background: #fff;
}

/* Drag and Drop Zone */
.mg-dropzone {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mg-dropzone:hover,
.mg-dropzone-active {
    border-color: #007bff;
    background: #e7f1ff;
}

.mg-dropzone-small {
    min-height: 100px;
    padding: 15px;
}

.mg-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mg-dropzone-icon {
    font-size: 48px;
    line-height: 1;
    opacity: 0.6;
}

.mg-dropzone-small .mg-dropzone-icon {
    font-size: 32px;
}

.mg-dropzone-text {
    margin: 0;
    font-size: 16px;
    color: #495057;
}

.mg-dropzone-or {
    margin: 0;
    font-size: 12px;
    color: #6c757d;
}

.mg-browse-btn {
    display: inline-block;
    padding: 8px 20px;
    background: #007bff;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.mg-browse-btn:hover {
    background: #0056b3;
}

.mg-browse-btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.mg-file-input {
    display: none;
}

.mg-dropzone-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mg-dropzone-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mg-dropzone-preview span {
    font-size: 13px;
    color: #495057;
    word-break: break-all;
}

.mg-remove-file {
    padding: 4px 10px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.mg-remove-file:hover {
    background: #c82333;
}

/* DNN Media Library Picker */
.mg-library-picker {
    display: flex;
    gap: 10px;
    align-items: center;
}

.mg-library-path {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #f8f9fa;
    font-size: 14px;
    color: #495057;
}

.mg-browse-library {
    white-space: nowrap;
}

.mg-library-preview {
    margin-top: 15px;
    text-align: center;
}

.mg-library-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Icons for Edit */
.mg-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
}

/* Share Notification */
.mg-share-notification {
    position: fixed;
    z-index: 10001;
    background: #333;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    max-width: 400px;
    min-width: 280px;
    animation: mgShareSlideIn 0.3s ease;
}

@keyframes mgShareSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mg-share-message {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #4ade80;
}

.mg-share-url {
    font-size: 12px;
    color: #9ca3af;
    word-break: break-all;
    background: #222;
    padding: 8px 10px;
    border-radius: 4px;
    max-height: 60px;
    overflow-y: auto;
}

.mg-share-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #222;
    color: #fff;
    font-size: 12px;
}

.mg-share-close {
    position: absolute;
    top: 5px;
    right: 8px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.mg-share-close:hover {
    color: #fff;
}

/* Tag Filter Bar */
.pw-tag-filter {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.pw-tag-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pw-tag-filter-label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.pw-tag-clear {
    color: #dc3545;
    font-size: 13px;
    text-decoration: none;
}

.pw-tag-clear:hover {
    text-decoration: underline;
}

.pw-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pw-tag-item {
    display: inline-block;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    color: #495057;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pw-tag-item:hover {
    background: #0066cc;
    border-color: #0066cc;
    color: #fff;
    text-decoration: none;
}

.pw-tag-item.pw-tag-active {
    background: #0066cc;
    border-color: #0066cc;
    color: #fff;
}

.pw-tag-count {
    opacity: 0.7;
    font-size: 11px;
}

/* Tag Results View */
.pw-tag-results-header {
    margin-bottom: 20px;
}

.pw-tag-results-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.pw-current-tag {
    color: #0066cc;
}

/* Photo Album Badge (for tag results) */
.pw-photo-item {
    position: relative;
}

.pw-photo-album-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    font-size: 11px;
    padding: 20px 8px 6px;
    text-align: center;
    pointer-events: none;
}

.pw-photo-album-badge:empty {
    display: none;
}

/* Tags Input in Edit Form */
.mg-tags-input {
    width: 100%;
    max-width: 500px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* Bulk Upload Styles */
.mg-bulk-upload-container {
    max-width: 800px;
    padding: 20px;
}

.mg-bulk-upload-container h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
}

.mg-bulk-description {
    color: #666;
    margin-bottom: 20px;
}

.mg-bulk-album-select {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.mg-bulk-dropzone {
    border: 3px dashed #ccc;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    margin: 20px 0;
}

.mg-bulk-dropzone.mg-dropzone-active {
    border-color: #0066cc;
    background: #e8f4ff;
}

/* Upload Queue */
.mg-upload-queue {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.mg-upload-queue h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.mg-queue-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.mg-queue-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 8px;
    gap: 10px;
}

.mg-queue-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.mg-queue-name {
    flex-grow: 1;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mg-queue-size {
    color: #6c757d;
    font-size: 12px;
    flex-shrink: 0;
}

.mg-queue-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.mg-queue-remove:hover {
    background: #fee;
}

.mg-queue-actions {
    display: flex;
    gap: 10px;
}

/* Upload Progress */
.mg-upload-progress {
    margin: 20px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.mg-upload-progress h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

.mg-progress-bar {
    width: 100%;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.mg-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0066cc, #00aaff);
    border-radius: 12px;
    transition: width 0.3s ease;
    width: 0%;
}

.mg-progress-text {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* Upload Results */
.mg-upload-results {
    margin: 20px 0;
    padding: 30px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    text-align: center;
}

.mg-upload-results h4 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #155724;
}

.mg-upload-results p {
    color: #155724;
    margin-bottom: 20px;
}

/* ================================================
   ALBUM MENU (Navigation Sidebar)
   ================================================ */

.mg-album-menu {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    background: #2d2d2d;
    color: #b0b0b0;
    padding: 15px;
    border-radius: 6px;
    min-width: 200px;
}

.mg-menu-title {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4da6ff;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #404040;
}

.mg-menu-section {
    margin-bottom: 5px;
}

.mg-menu-section-header {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    padding: 12px 0 8px 0;
    text-decoration: none !important;
    border-bottom: 1px solid #3a3a3a;
    margin-bottom: 5px;
    transition: color 0.2s ease;
}

.mg-menu-section-header:hover {
    color: #fff;
}

.mg-menu-section-header .mg-menu-album-name {
    color: inherit;
}

.mg-menu-item {
    display: block;
    padding: 8px 0 8px 15px;
    color: #b0b0b0 !important;
    text-decoration: none !important;
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.mg-menu-item:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #4da6ff;
    padding-left: 18px;
}

.mg-menu-item .mg-menu-album-name {
    color: inherit;
}

/* Photo count styling */
.mg-menu-section-header .mg-menu-album-count,
.mg-menu-item .mg-menu-album-count {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

/* Settings page checkbox list styling */
.mg-album-checklist label {
    display: block;
    padding: 5px 0;
}

.mg-album-checklist input[type="checkbox"] {
    margin-right: 8px;
}

/* ================================================
   FEATURED PHOTOS MODULE
   ================================================ */

.mg-featured-photos {
    padding: 10px;
}

.mg-featured-title {
    display: block;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.mg-featured-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.mg-featured-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mg-featured-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}

.mg-featured-link {
    display: block;
    text-decoration: none !important;
}

.mg-featured-image {
    display: block;
    object-fit: cover;
}

.mg-featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    padding: 30px 10px 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mg-featured-item:hover .mg-featured-overlay {
    opacity: 1;
}

.mg-featured-item-title {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.mg-featured-empty {
    padding: 20px;
    text-align: center;
    color: #666;
    background: #f8f9fa;
    border-radius: 6px;
}

/* Roles checklist styling */
.mg-roles-checklist label {
    display: block;
    padding: 3px 0;
}

.mg-roles-checklist input[type="checkbox"] {
    margin-right: 8px;
}

/* ================================================
   DARK THEME
   ================================================ */

/* Theme toggle button */
.mg-theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #333;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 24px;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.mg-theme-toggle:hover {
    transform: scale(1.1);
    background: #444;
}

/* Dark theme styles */
.piwigo-gallery.mg-dark-theme {
    background: #1a1a1a;
    color: #e0e0e0;
}

.mg-dark-theme .pw-breadcrumb {
    color: #999;
}

.mg-dark-theme .pw-breadcrumb-link {
    color: #4da6ff;
}

.mg-dark-theme .pw-toolbar {
    background: #2d2d2d;
    border-color: #404040;
}

.mg-dark-theme .pw-search-input,
.mg-dark-theme .pw-sort-select {
    background: #333;
    color: #e0e0e0;
    border-color: #555;
}

.mg-dark-theme .pw-search-btn {
    background: #4da6ff;
}

.mg-dark-theme .pw-album-title,
.mg-dark-theme .pw-grid-title {
    color: #e0e0e0;
}

.mg-dark-theme .pw-album-count,
.mg-dark-theme .pw-grid-info {
    color: #888;
}

.mg-dark-theme .pw-album-card,
.mg-dark-theme .pw-sub-album-card {
    background: #2d2d2d;
    border-color: #404040;
}

.mg-dark-theme .pw-album-card:hover,
.mg-dark-theme .pw-sub-album-card:hover {
    background: #363636;
    border-color: #555;
}

.mg-dark-theme .pw-grid-item {
    background: #2d2d2d;
}

.mg-dark-theme .pw-detail-toolbar {
    background: #2d2d2d;
    border-color: #404040;
}

.mg-dark-theme .pw-detail-tool-btn {
    background: #3a3a3a;
    color: #e0e0e0;
}

.mg-dark-theme .pw-detail-tool-btn:hover {
    background: #4a4a4a;
    color: #fff;
}

.mg-dark-theme .pw-detail-info {
    background: #2d2d2d;
    border-color: #404040;
}

.mg-dark-theme .pw-detail-label {
    color: #888;
}

.mg-dark-theme .pw-no-items,
.mg-dark-theme .pnlNoAlbums {
    background: #2d2d2d;
    color: #888;
}

.mg-dark-theme .pw-tag-cloud {
    background: #2d2d2d;
    border-color: #404040;
}

.mg-dark-theme .pw-tag-link {
    background: #3a3a3a;
    color: #e0e0e0;
    border-color: #555;
}

.mg-dark-theme .pw-tag-link:hover {
    background: #4a4a4a;
    color: #fff;
    border-color: #666;
}

.mg-dark-theme .pw-pagination-btn {
    background: #3a3a3a;
    color: #e0e0e0;
    border-color: #555;
}

.mg-dark-theme .pw-pagination-btn:hover {
    background: #4a4a4a;
    border-color: #666;
}

.mg-dark-theme .pw-pagination-btn.active {
    background: #4da6ff;
    border-color: #4da6ff;
    color: #fff;
}

/* Light theme toggle icon */
.mg-dark-theme .mg-theme-toggle {
    background: #f0f0f0;
    color: #333;
}

.mg-dark-theme .mg-theme-toggle:hover {
    background: #fff;
}
