/* Frontend Album Styles */

/* Tạo Album Button */
.pcad-tao-album-wrapper {
    margin: 20px 0;
}

.pcad-btn-tao-album {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.pcad-btn-tao-album:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.pcad-btn-tao-album .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Album Content */
.pcad-album-content {
    width: 100%;
    position: relative;
}

/* Album Loading */
.pcad-album-loading {
    text-align: center;
    padding: 60px 20px;
}

.pcad-album-loading .pcad-spinner {
    margin: 0 auto 20px;
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f1;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: pcadSpin 0.8s linear infinite;
}

.pcad-album-loading p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

/* Gallery Styles - Masonry.js Layout */
.pcad-gallery {
    margin: 0;
    padding: 0;
    width: 100%;
}

.pcad-masonry-grid {
    /* Masonry.js will handle the layout */
}

.pcad-gallery-item {
    width: calc(25% - 9px);
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: 8px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.pcad-gallery-item.loaded {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.5s ease forwards;
}

/* Responsive widths for Masonry */
@media (max-width: 1200px) {
    .pcad-gallery-item {
        width: calc(33.333% - 8px);
    }
}

@media (max-width: 768px) {
    .pcad-gallery-item {
        width: calc(50% - 6px);
    }
}

@media (max-width: 480px) {
    .pcad-gallery-item {
        width: 100%;
    }
}

.pcad-image-clickable {
    position: relative;
    display: block;
    cursor: pointer;
}

/* Image Actions - 3 nút luôn hiển thị trên thumbnail */
.pcad-image-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    z-index: 10;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.pcad-image-action-btn {
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    color: #fff;
}

.pcad-image-action-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.pcad-image-action-btn i {
    font-size: 16px;
}

.pcad-favorite-btn.favorited {
    background: rgba(220, 53, 69, 0.9);
    border-color: rgba(220, 53, 69, 1);
}

.pcad-favorite-btn.favorited i {
    color: #fff;
}

.pcad-download-btn:hover {
    background: rgba(40, 167, 69, 0.9);
}

.pcad-comment-btn:hover {
    background: rgba(0, 123, 255, 0.9);
}

.pcad-comment-btn.has-comments {
    background: rgba(0, 123, 255, 0.9);
    border-color: rgba(0, 123, 255, 1);
}

.pcad-comment-btn .comment-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1;
}

.pcad-gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: all 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.pcad-gallery-item:hover::before {
    background: rgba(0, 0, 0, 0.1);
}

.pcad-gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.pcad-image-clickable:hover {
    cursor: pointer;
}

.pcad-gallery img {
    width: 100%;
    height: auto;
    display: block;
    transition: all 0.3s ease;
}

/* Responsive Grid */
@media (max-width: 1200px) {
    .pcad-masonry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .pcad-masonry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .pcad-masonry-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty State */
.pcad-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.pcad-empty-state i {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.pcad-empty-state p {
    font-size: 18px;
    margin: 0;
}

/* Error State */
.pcad-error-state {
    text-align: center;
    padding: 60px 20px;
}

.pcad-error-state i {
    font-size: 80px;
    margin-bottom: 20px;
    color: #dc3545;
}

.pcad-error-state .pcad-error-message {
    font-size: 16px;
    color: #721c24;
    margin: 0;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    display: inline-block;
}

/* Buttons in Frontend */
.pcad-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.pcad-btn i {
    font-size: 16px;
}

.pcad-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.pcad-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    color: #fff;
}

.pcad-btn-default {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.pcad-btn-default:hover {
    background: #e9ecef;
    border-color: #ccc;
}

/* Animations */
@keyframes pcadSpin {
    to { transform: rotate(360deg); }
}

@keyframes pcadFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .pcad-album-container {
        padding: 15px;
        margin: 20px 0;
    }
    
    .pcad-password-box {
        padding: 30px 20px;
    }
    
    .pcad-password-icon .dashicons {
        font-size: 50px;
        width: 50px;
        height: 50px;
    }
    
    .pcad-password-box h3 {
        font-size: 20px;
    }
}

/* fslightbox Override */
.fslightbox-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.fslightbox-slide-number-container {
    color: #fff;
    font-size: 16px;
}

/* Custom Scrollbar for Modal */
.pcad-modal-body::-webkit-scrollbar {
    width: 8px;
}

.pcad-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.pcad-modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.pcad-modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Comment Modal */
.pcad-comment-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100001;
    align-items: center;
    justify-content: center;
}

/* FIX 2: Modal nổi trên lightbox - z-index cao hơn lightbox (2147483648) */
.pcad-comment-modal-over-lightbox {
    z-index: 2147483648 !important;
}

.pcad-comment-modal-over-lightbox .pcad-comment-modal-overlay {
    background: rgba(0, 0, 0, 0.7) !important;
}

.pcad-comment-modal-over-lightbox .pcad-comment-modal-content {
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8) !important;
}

.pcad-comment-modal.active {
    display: flex;
}

.pcad-comment-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1;
}

.pcad-comment-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    z-index: 2;
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.3s ease;
}

.pcad-comment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.pcad-comment-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
	color: #000 !important;
}

.pcad-comment-modal-header h3 i {
    color: #000;
}

.pcad-comment-close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    color: #666;
    font-size: 18px;
}

.pcad-comment-close:hover {
    background: #f0f0f0;
    color: #333;
}

.pcad-comment-modal-body {
    padding: 20px;
}

.pcad-comment-image-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.pcad-comment-image-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pcad-comment-image-name i {
    color: #667eea;
}

.pcad-comment-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
	box-sizing: border-box;
}

.pcad-comment-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pcad-comment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
}

.pcad-comment-actions .pcad-btn i {
    margin-right: 5px;
}

/* Comments List */
.pcad-comments-list {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.pcad-comments-list h4 {
    margin: 0 0 15px 0;
    font-size: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pcad-comments-list h4 i {
    color: #667eea;
}

.pcad-comments-container {
    max-height: 250px;
    overflow-y: auto;
}

.pcad-comment-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.pcad-comment-item:last-child {
    margin-bottom: 0;
}

.pcad-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.pcad-comment-user {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pcad-comment-user i {
    color: #667eea;
}

.pcad-comment-time {
    color: #999;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pcad-comment-text {
    color: #555;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.pcad-comments-container::-webkit-scrollbar {
    width: 6px;
}

.pcad-comments-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.pcad-comments-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.pcad-comments-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Toast Notification */
.pcad-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: #333;
    color: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100002;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    font-size: 14px;
}

.pcad-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.pcad-toast-success {
    background: #28a745;
}

.pcad-toast-error {
    background: #dc3545;
}

/* Album Filter Buttons */
.pcad-album-filter-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    padding: 10px;
    background: rgb(255 255 255 / 14%);
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.pcad-album-filter-btn { 
	background: #fff; 
	border: 1px solid #ddd; 
	padding: 8px 16px; 
	border-radius: 20px; 
	cursor: pointer; 
	font-size: 14px; 
	color: #555; 
	display: inline-flex; 
	align-items: center; 
	gap: 6px; 
	transition: all 0.2s; 
}

.pcad-album-filter-btn:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pcad-album-filter-btn.active { 
	background: #667eea; 
	color: #fff; 
	border-color: #667eea; 
	box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3); 
}

.pcad-album-filter-btn i {
    font-size: 18px;
}

.pcad-filter-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.pcad-filter-count {
	background: rgba(0,0,0,0.1); 
	padding: 1px 6px; 
	border-radius: 10px; 
	font-size: 11px; 
	margin-left: 4px; 
}

.pcad-album-filter-btn.active .pcad-filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    min-width: 10px;
    text-align: center;
}

@media (max-width: 768px) {
    .pcad-album-filter-buttons {
        gap: 8px;
        padding: 15px;
    }
    
    .pcad-album-filter-btn {
        padding: 5px 15px;
        font-size: 14px;
    }
    
    .pcad-filter-label {
        display: none;
    }
}

/* Lightbox Custom Toolbar - Gắn vào container nhưng KHÔNG zoom theo ảnh */
.pcad-has-toolbar {
    position: relative !important;
}

.pcad-lightbox-toolbar {
    /* GIỮ position: fixed để không bị zoom theo ảnh */
    position: fixed !important;
    bottom: 20px !important; /* ← GIẢM: Xuống dưới cùng */
    left: 50% !important;
    transform: translateX(-50%) translateZ(999999px) !important; /* ← THÊM translateZ */
    display: flex !important;
    gap: 8px !important; /* ← GIẢM: Từ 12px xuống 8px */
    z-index: 2147483647 !important;
    background: rgba(0, 0, 0, 0.85) !important; /* ← Trong suốt hơn một chút */
    padding: 8px 16px !important; /* ← GIẢM: Từ 12px 20px xuống 8px 16px */
    border-radius: 50px !important;
    backdrop-filter: blur(10px) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
    pointer-events: auto !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    
    /* ===== QUAN TRỌNG: Reset transform khi parent bị zoom ===== */
    /* Khi img zoom, toolbar vẫn giữ nguyên kích thước */
    transform-origin: center bottom !important;
    
    /* ===== FIX: Luôn visible, không bị ẩn bởi bất kỳ element nào ===== */
    visibility: visible !important;
    will-change: opacity, transform !important;
    backface-visibility: visible !important;
    isolation: isolate !important; /* ← THÊM: Tạo stacking context mới */
    
    /* ===== FIX: Đảm bảo LUÔN ở trên khi zoom ===== */
    contain: layout style !important;
    filter: brightness(1) !important; /* ← Trick: Tạo stacking context mới */
    -webkit-transform: translateX(-50%) translateZ(999999px) !important;
}

/* Alternative: Nếu muốn toolbar absolute nhưng không zoom theo */
.pcad-has-toolbar .pcad-lightbox-toolbar {
    /* Khi parent scale, toolbar counter-scale để giữ nguyên kích thước */
    /* Công thức: nếu parent scale(2), toolbar scale(0.5) */
}

.pcad-lightbox-toolbar.show {
    opacity: 1 !important;
}

/* FIX: Full Lightbox Loading Overlay - cho TOÀN BỘ ảnh + toolbar */
.pcad-lightbox-full-loading {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.9) !important;
    z-index: 2147483646 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 15px !important;
    color: #fff !important;
    font-size: 16px !important;
    opacity: 0 !important;
    transition: opacity 0.2s ease !important;
    pointer-events: none !important;
}

.pcad-lightbox-full-loading.show {
    opacity: 1 !important;
}

.pcad-lightbox-full-loading .spinner {
    width: 50px !important;
    height: 50px !important;
    border: 4px solid rgba(255, 255, 255, 0.2) !important;
    border-top-color: #fff !important;
    border-radius: 50% !important;
    animation: pcad-spin 0.6s linear infinite !important;
}

.pcad-lightbox-full-loading span {
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
}

@keyframes pcad-spin {
    to { transform: rotate(360deg); }
}

.pcad-lb-btn {
    width: 36px !important; /* ← GIẢM: Từ 48px xuống 36px */
    height: 36px !important; /* ← GIẢM: Từ 48px xuống 36px */
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    color: #fff !important;
    font-size: 16px !important; /* ← GIẢM: Từ 20px xuống 16px */
    position: relative !important;
    pointer-events: auto !important;
}

.pcad-lb-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    transform: scale(1.15) !important;
}

.pcad-lb-btn:active {
    transform: scale(1.05) !important;
}

.pcad-lb-btn i {
    font-size: 20px !important;
    pointer-events: none !important;
}

/* Favorite button active state */
.pcad-lb-favorite.active {
    background: rgba(220, 53, 69, 0.9) !important;
    border-color: rgba(220, 53, 69, 1) !important;
}

.pcad-lb-favorite.active:hover {
    background: rgba(220, 53, 69, 1) !important;
}

/* Download button hover */
.pcad-lb-download:hover {
    background: rgba(40, 167, 69, 0.9) !important;
    border-color: rgba(40, 167, 69, 1) !important;
}

/* Comment button */
.pcad-lb-comment:hover {
    background: rgba(0, 123, 255, 0.9) !important;
    border-color: rgba(0, 123, 255, 1) !important;
}

.pcad-lb-comment.has-comments {
    background: rgba(0, 123, 255, 0.3) !important;
    border-color: rgba(0, 123, 255, 0.6) !important;
}

.comment-badge {
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    background: #dc3545 !important;
    color: white !important;
    font-size: 11px !important;
    font-weight: bold !important;
    padding: 2px 6px !important;
    border-radius: 10px !important;
    min-width: 18px !important;
    text-align: center !important;
    line-height: 1 !important;
    pointer-events: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .pcad-lightbox-toolbar {
        bottom: 60px !important;
        padding: 10px 15px !important;
        gap: 10px !important;
    }
    
    .pcad-lb-btn {
        width: 44px !important;
        height: 44px !important;
        font-size: 18px !important;
    }
    
    .pcad-lb-btn i {
        font-size: 18px !important;
    }
}
/* ===== ACTION BUTTONS & DROPDOWN ===== */
.pcad-album-filter-buttons {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.pcad-filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pcad-action-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Loading state cho filter buttons */
.pcad-album-filter-btn.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.pcad-album-filter-btn.loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pcad-spin 0.6s linear infinite;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

/* Loading overlay cho gallery */
.pcad-gallery.pcad-loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.pcad-gallery.pcad-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(102,126,234,0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: pcad-spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Action Button */
.pcad-action-btn { 
	background: #fff; 
	border: 1px solid #ddd;
	padding: 8px 14px; 
	border-radius: 25px; 
	cursor: pointer; 
	font-size: 13px; 
	font-weight: 600; 
	color: #555; 
	display: inline-flex; 
	align-items: center; 
	gap: 6px; }

.pcad-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.pcad-action-btn i {
    font-size: 14px;
}

/* Dropdown */
/* Dropdown Tác vụ */
.pcad-dropdown {
    z-index: 1001;
    position: relative;
}

.pcad-dropdown-icon {
    margin-left: 4px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.pcad-dropdown.show .pcad-dropdown-icon {
    transform: rotate(180deg);
}

/* MENU DROPDOWN – cố định ra ngoài body, không bị ảnh che, không bay từ góc màn hình */
.pcad-dropdown {
        position: relative !important; /* Nút mẹ làm mốc */
    }

    .pcad-dropdown-menu {
        position: absolute !important; /* Tuyệt đối theo nút mẹ */
        top: 100% !important; /* Nằm ngay dưới */
        right: 0 !important; /* Căn phải thẳng hàng với nút */
        left: auto !important; /* Bỏ căn trái */
        margin-top: 10px; /* Cách nút ra 1 chút */
        min-width: 220px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 5px 25px rgba(0,0,0,0.2);
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.2s ease;
        z-index: 9999999 !important; /* Cao hơn tất cả mọi thứ */
    }

    .pcad-dropdown-menu.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .pcad-dropdown-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 15px;
        color: #333;
        text-decoration: none;
        font-size: 14px;
        border-bottom: 1px solid #f5f5f5;
        transition: background 0.2s;
    }
    
    .pcad-dropdown-item:last-child {
        border-bottom: none;
    }

    .pcad-dropdown-item:hover {
        background: #f0f0f1;
        color: #667eea;
    }
    
    /* Đảm bảo thanh công cụ không bị che khuất (overflow) */
    .pcad-album-filter-buttons {
        overflow: visible !important; 
        position: relative;
        z-index: 100;
    }

/* ===== MODAL STYLES ===== */
.pcad-favorites-list-modal,
.pcad-comments-list-modal,
.pcad-edit-album-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pcad-favorites-list-modal.active,
.pcad-comments-list-modal.active, /* <--- ĐÃ THÊM DÒNG NÀY */
.pcad-edit-album-modal.active {
    opacity: 1;
    visibility: visible;
}

.pcad-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.pcad-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.pcad-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
}

.pcad-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3338;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pcad-modal-header h3 i {
    color: #667eea;
}

.pcad-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.pcad-modal-close:hover {
    background: #f8f9fa;
    color: #2c3338;
}

.pcad-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.pcad-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== FAVORITES LIST MODAL ===== */
.pcad-favorites-count {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #495057;
}

.pcad-favorites-count i {
    color: #667eea;
}

.pcad-favorites-count strong {
    color: #667eea;
    font-size: 18px;
}

.pcad-favorites-list-container {
    max-height: 400px;
    overflow-y: auto;
}

.pcad-fav-list {
    list-style-position: inside;
    padding: 0;
    margin: 0;
}

.pcad-fav-list li {
    padding: 10px 12px;
    border-bottom: 1px solid #e9ecef;
    color: #495057;
    font-size: 14px;
}

.pcad-fav-list li:last-child {
    border-bottom: none;
}

.pcad-fav-list li:hover {
    background: #f8f9fa;
}

/* ===== EDIT ALBUM MODAL ===== */
.pcad-form-group {
    margin-bottom: 20px;
}

.pcad-form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2c3338;
    margin-bottom: 8px;
    font-size: 14px;
}

.pcad-form-group label i {
    color: #667eea;
}

.pcad-form-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pcad-form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.pcad-form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6c757d;
}

/* Button styles */
.pcad-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pcad-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.pcad-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.pcad-btn-default {
    background: #f8f9fa;
    color: #495057;
}

.pcad-btn-default:hover {
    background: #e9ecef;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .pcad-album-filter-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pcad-filter-group,
    .pcad-action-group {
        width: 100%;
        justify-content: center;
    }
    
    .pcad-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .pcad-dropdown-menu {
        left: auto;
        right: 0;
    }
}
/* ===== COMMENTS LIST MODAL ===== */
.pcad-comments-full-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pcad-comment-item {
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.pcad-comment-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.pcad-comment-item-header strong {
    color: #2c3338;
    font-size: 15px;
}

.pcad-comment-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #667eea;
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.pcad-comment-item-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pcad-comment-text {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    color: #495057;
    font-size: 14px;
    line-height: 1.5;
}

.pcad-comment-text i {
    color: #667eea;
    margin-top: 2px;
    flex-shrink: 0;
}