/* Flickr Gallery Pro - Frontend Styles */

.flickr-gallery-widget {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Gallery Header */
.gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-title {
    font-size: 2.5em;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 10px 0;
}

/* Gallery Controls */
.gallery-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Search Bar */
.search-bar {
    flex: 1;
    min-width: 250px;
    position: relative;
display: none;
}

.search-input {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 2px solid #dcdcde;
    border-radius: 25px;
    font-size: 15px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #646970;
    font-size: 18px;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #dcdcde;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #646970;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: #2271b1;
    color: #2271b1;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

/* Layout Controls */
.layout-controls {
    display: flex;
    gap: 8px;
    background: #f6f7f7;
    padding: 5px;
    border-radius: 8px;
}

.layout-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    color: #646970;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-btn:hover {
    background: white;
    color: #2271b1;
}

.layout-btn.active {
    background: #2271b1;
    color: white;
}

/* Gallery Layouts */
.gallery-container {
    min-height: 400px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.gallery-masonry {
    column-count: 4;
    column-gap: 25px;
}

.gallery-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* Gallery Items */
.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    break-inside: avoid;
    margin-bottom: 25px;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.item-media-wrapper {
    position: relative;
    overflow: hidden;
    background: #f6f7f7;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.video-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(34, 113, 177, 0.95);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #2271b1;
    transition: all 0.3s;
}

.gallery-item:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
    background: white;
}

.item-content {
    padding: 20px;
}

.item-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 8px;
    line-height: 1.4;
}

.item-description {
    font-size: 14px;
    color: #646970;
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #787c82;
    padding-top: 12px;
    border-top: 1px solid #f0f0f1;
}

/* List View Specific */
.gallery-list .gallery-item {
    display: flex;
    flex-direction: row;
    min-height: 220px;
}

.gallery-list .item-media-wrapper {
    width: 35%;
    min-width: 280px;
}

.gallery-list .item-media-wrapper img {
    height: 100%;
    object-fit: cover;
}

.gallery-list .item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Pagination */
.gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 12px 20px;
    border: 2px solid #dcdcde;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #646970;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-btn:hover:not(:disabled) {
    border-color: #2271b1;
    color: #2271b1;
    transform: translateY(-2px);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 8px;
}

.page-num {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #dcdcde;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #646970;
    transition: all 0.3s;
}

.page-num:hover {
    border-color: #2271b1;
    color: #2271b1;
}

.page-num.active {
    background: #2271b1;
    color: white;
    border-color: #2271b1;
}

.page-num.dots {
    border: none;
    cursor: default;
}

.page-num.dots:hover {
    border: none;
    color: #646970;
}

/* Gallery Info */
.gallery-info {
    text-align: center;
    margin-top: 20px;
    color: #646970;
    font-size: 14px;
}

/* Loading State */
.gallery-loading {
    text-align: center;
    padding: 60px 20px;
    color: #646970;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f1;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.gallery-loading p {
    font-size: 16px;
}

/* Error State */
.gallery-error {
    background: #d63638;
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

/* Modal/Lightbox */
.flickr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    animation: fadeIn 0.3s;
}

.flickr-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.modal-content-wrapper {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-media-container img,
.modal-media-container video {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
}

/* Video wrapper for iframe */
.video-wrapper {
    width: 100%;
    max-width: 1200px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-wrapper iframe {
    display: block;
}

.modal-info {
    padding: 25px;
    border-radius: 12px;
    margin-top: 20px;
    max-width: 700px;
    text-align: center;
}

.modal-title {
    font-size: 22px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 10px;
}

.modal-description {
    font-size: 15px;
    color: #646970;
    line-height: 1.6;
}

.modal-close {
    position: fixed;
    top: 30px;
    right: 30px;
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    color: #1d2327;
    z-index: 1000000;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #2271b1;
    color: white;
    transform: rotate(90deg);
}

.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 30px;
    cursor: pointer;
    color: #1d2327;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-nav:hover {
    background: #2271b1;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 30px;
}

.modal-next {
    right: 30px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-masonry {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .gallery-title {
        font-size: 2em;
    }
    
    .gallery-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .filter-controls {
        justify-content: center;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .gallery-masonry {
        column-count: 2;
    }
    
    .gallery-list .gallery-item {
        flex-direction: column;
    }
    
    .gallery-list .item-media-wrapper {
        width: 100%;
        min-width: auto;
        height: 250px;
    }
    
    .modal-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    .modal-nav {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .modal-prev {
        left: 15px;
    }
    
    .modal-next {
        right: 15px;
    }
    
    .page-numbers {
        flex-wrap: wrap;
    }
    
    .video-wrapper iframe {
        height: 50vh !important;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-masonry {
        column-count: 1;
    }
    
    .gallery-title {
        font-size: 1.6em;
    }
    
    .filter-btn,
    .page-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #646970;
    font-size: 18px;
}
