/* Media Gallery Elementor Styles */
.media-gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.gallery-search-form {
    margin-bottom: 30px;
    text-align: center;
}

.gallery-search-form .search-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.gallery-search-form input[type="text"] {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    width: 300px;
    max-width: 100%;
    font-size: 16px;
}

.gallery-search-form button {
    padding: 10px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.gallery-search-form button:hover {
    background: #005a87;
}

.clear-search {
    color: #ff4444;
    text-decoration: none;
    margin-left: 10px;
}

.clear-search:hover {
    text-decoration: underline;
}

.gallery-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.gallery-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.gallery-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.gallery-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gallery-grid.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

.gallery-grid.columns-6 {
    grid-template-columns: repeat(6, 1fr);
}

.gallery-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.gallery-info {
    padding: 15px;
}

.image-title {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-actions {
    display: flex;
    gap: 8px;
}

.gallery-actions button,
.gallery-actions .download-button {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: block;
    font-family: inherit;
}

.view-image {
    background: #28a745;
    color: white;
}

.view-image:hover {
    background: #218838;
}

.download-button {
    background: #007cba;
    color: white;
}

.download-button:hover {
    background: #005a87;
    color: white;
}

.gallery-pagination {
    text-align: center;
    margin-top: 30px;
}

.page-numbers {
    display: inline-flex;
    gap: 5px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-numbers li {
    margin: 0;
}

.page-numbers a,
.page-numbers span {
    padding: 8px 16px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #007cba;
    border-radius: 4px;
    display: block;
}

.page-numbers .current {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.no-images-found {
    text-align: center;
    padding: 40px;
    color: #666;
    grid-column: 1 / -1;
}

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

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

.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
    to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

#modalCaption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    font-size: 16px;
    background: rgba(0,0,0,0.7);
    padding: 10px 20px;
    border-radius: 5px;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s ease;
}

.close:hover {
    color: #bbb;
}

/* Responsive */
@media (max-width: 1024px) {
    .gallery-grid.columns-4,
    .gallery-grid.columns-5,
    .gallery-grid.columns-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-grid.columns-3,
    .gallery-grid.columns-4,
    .gallery-grid.columns-5,
    .gallery-grid.columns-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-search-form .search-form {
        flex-direction: column;
    }
    
    .gallery-search-form input[type="text"] {
        width: 100%;
        max-width: 300px;
    }
    
    .gallery-image {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr !important;
    }
    
    .media-gallery-container {
        padding: 10px;
    }
    
    .gallery-actions {
        flex-direction: column;
    }
}
