/* Photo Album Styles */
.photo-album-container {
    margin-top: 10px;
}

.photo-upload-section {
    margin-bottom: 15px;
}

.photo-upload-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 6px 12px !important;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px !important;
    transition: background-color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.photo-upload-btn:hover {
    background-color: #45a049;
}

.photo-upload-btn i {
    font-size: 11px;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
    min-height: 50px;
}

.photo-gallery.photo-drag-over {
    background-color: rgba(76, 175, 80, 0.1);
    border: 2px dashed #4CAF50;
    border-radius: 4px;
}

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

.photo-thumbnail-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.photo-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.photo-thumbnail:hover {
    transform: scale(1.05);
}

.photo-delete-btn {
    position: absolute;
    top: 0px;
    right: 0px;
    background-color: rgba(244, 67, 54, 0.9);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    padding: 10px 15px !important;
    margin: 4px !important;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.photo-item:hover .photo-delete-btn {
    opacity: 1;
}

.photo-delete-btn:hover {
    background-color: rgba(244, 67, 54, 1);
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
    padding: 5px 8px;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    /* padding: 20px; */
    color: #999 !important;
    font-size: 12px;
}

.photo-loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #999;
}

.photo-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: photo-spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes photo-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.photo-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #f44336;
    font-size: 14px;
}

/* Photo Lightbox */
.photo-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
}

.photo-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    cursor: default;
}

.photo-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.photo-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9);
    color: #000;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.photo-lightbox-close:hover {
    background-color: white;
}

.photo-lightbox-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 14px;
    padding: 10px;
}

.photo-lightbox-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.photo-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    color: #000;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 32px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    z-index: 10001;
    user-select: none;
    padding-bottom: 7px;
}

.photo-lightbox-nav:hover:not(:disabled) {
    background-color: white;
}

.photo-lightbox-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.photo-lightbox-prev {
    left: 20px;
}

.photo-lightbox-next {
    right: 20px;
}

.photo-lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    padding: 5px 15px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .photo-gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .photo-upload-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .photo-pagination-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .photo-gallery {
        grid-template-columns: repeat(6, 1fr);
    }
}

body.light-mode .photo-item {
    background-color: #e0e0e0;
}

body.light-mode .photo-empty-state,
body.light-mode .photo-loader {
    color: #666;
}

/* Pagination Container */
.photo-pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.photo-pagination-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 6px 12px !important;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px !important;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.photo-pagination-btn:hover:not(:disabled) {
    background-color: #45a049;
}

.photo-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.photo-pagination-info {
    color: #999;
    font-size: 14px;
    min-width: 80px;
    text-align: center;
}

/* Delete Button Tooltip */
.photo-delete-tooltip {
    position: fixed;
    z-index: 2147483647;
    background-color: #dc3545;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

