/* Professional Gallery Styles - Fixed Version */

/* Reset ve Base Styles */
.professional-gallery-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
    background: #fff;
}

/* Loading Spinner */
.gallery-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.gallery-loading p {
    color: #333;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

/* Gallery Controls */
.gallery-controls {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.gallery-filter {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.gallery-filter:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.gallery-filter.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.gallery-filter i {
    margin-right: 8px;
    font-size: 16px;
}

/* Gallery Grid - CSS Grid Style */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
    opacity: 1;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gallery Item */
.gallery-item {
    position: relative;
    width: 100%;
    height: 300px; /* Sabit yükseklik */
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.gallery-item:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* Gallery Image */
.gallery-image {
    width: 100%;
    height: 100%; /* Container'ı tamamen doldur */
    object-fit: cover; /* Resmi kırpmadan sığdır */
    object-position: center;
    transition: all 0.3s ease;
    border-radius: 12px;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

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

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.8) 0%, rgba(52, 152, 219, 0.8) 100%);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3;
    border-radius: 12px;
    width: 100%;
    height: 100%;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-content {
    text-align: center;
    color: white;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-overlay-content {
    transform: translateY(0);
}

.gallery-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.gallery-action-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: scale(1.1);
}

/* Loading Animation for Images */
.gallery-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-grid[data-columns="6"] .gallery-item {
        width: calc(20% - 12px);
    }
    
    .gallery-grid[data-columns="5"] .gallery-item {
        width: calc(25% - 11.25px);
    }
}

@media (max-width: 992px) {
    .gallery-grid[data-columns="6"] .gallery-item,
    .gallery-grid[data-columns="5"] .gallery-item,
    .gallery-grid[data-columns="4"] .gallery-item {
        width: calc(33.333% - 10px);
    }
    
    .gallery-controls {
        padding: 15px;
    }
    
    .gallery-filter {
        padding: 10px 20px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .professional-gallery-container {
        padding: 15px;
    }
    
    .gallery-grid[data-columns="6"] .gallery-item,
    .gallery-grid[data-columns="5"] .gallery-item,
    .gallery-grid[data-columns="4"] .gallery-item,
    .gallery-grid[data-columns="3"] .gallery-item {
        width: calc(50% - 7.5px);
    }
    
    .gallery-controls {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .gallery-filter {
        width: 100%;
        max-width: 200px;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .gallery-grid[data-columns="6"] .gallery-item,
    .gallery-grid[data-columns="5"] .gallery-item,
    .gallery-grid[data-columns="4"] .gallery-item,
    .gallery-grid[data-columns="3"] .gallery-item,
    .gallery-grid[data-columns="2"] .gallery-item {
        width: 100%;
    }
    
    .gallery-controls {
        padding: 10px;
    }
    
    .gallery-filter {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .gallery-action-btn {
        width: 40px;
        height: 40px;
    }
}

/* Error States */
.gallery-error {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.gallery-error i {
    font-size: 48px;
    color: #e74c3c;
    margin-bottom: 20px;
}

.retry-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s;
}

.retry-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Fade out animation */
.fade-out {
    opacity: 0 !important;
    transform: scale(0.8) !important;
    transition: all 0.3s ease !important;
}

/* Gallery item loading state */
.gallery-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    position: relative;
}

.gallery-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #ddd;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

/* Gallery item error state */
.gallery-item.error {
    display: none !important;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

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