/* Reset ve temel stiller */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 1.75rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.selection-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

/* Butonlar */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1;
}

.btn-download {
    background: var(--accent-color);
    color: white;
}

.btn-download:hover {
    background: #e879f9;
    transform: translateY(-1px);
}

.btn-clear {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-clear:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Kategori Sekmeleri */
.category-tabs {
    margin: 2rem 0 1rem 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--surface-color);
    padding: 0.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.category-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 100px;
}

.category-tab i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.category-tab .count {
    background: var(--border-color);
    color: var(--text-muted);
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 1.5rem;
    text-align: center;
}

.category-tab:hover {
    background: var(--background-color);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.category-tab:hover .count {
    background: var(--primary-color);
    color: white;
}

.category-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.category-tab.active .count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Alt Filtreler */
.sub-filters {
    margin: 1rem 0 2rem 0;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Filtreler */
.filters {
    margin: 2rem 0;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-md);
}

/* Galeri */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.gallery-item {
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.media-container {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.media-container img,
.media-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-item:hover .media-container img,
.gallery-item:hover .media-container video {
    transform: scale(1.05);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4rem;
    height: 4rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

.gallery-item:hover .play-button {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.1) 0%,
            rgba(0, 0, 0, 0) 40%,
            rgba(0, 0, 0, 0) 60%,
            rgba(0, 0, 0, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1rem;
}

.gallery-item:hover .media-overlay {
    opacity: 1;
}

.media-actions {
    display: flex;
    gap: 0.5rem;
    align-self: flex-end;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.action-btn {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.action-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn i {
    font-size: 0.875rem;
    font-weight: 600;
}

.select-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #2d3748;
}

.select-btn:hover {
    background: #f7fafc;
    color: var(--primary-color);
}

.select-btn.selected {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.select-btn.selected:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.download-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #2d3748;
}

.download-btn:hover {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.3);
}

.media-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: white;
}

.media-category {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.media-category i {
    font-size: 0.875rem;
}

.media-name {
    font-weight: 500;
    font-size: 0.875rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.media-size {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.upload-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.upload-category {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--surface-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
}

.upload-category i {
    font-size: 1.25rem;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-close {
    position: absolute;
    top: -3rem;
    right: 0;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: background 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-media {
    max-width: 100%;
    max-height: calc(90vh - 4rem);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.lightbox-media img,
.lightbox-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox-controls {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

.lightbox-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }

    .header .container {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .logo {
        text-align: center;
    }

    .selection-info {
        justify-content: center;
        flex-wrap: wrap;
    }

    .category-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .category-tab {
        flex-direction: row;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        min-width: auto;
    }

    .category-tab i {
        font-size: 1.25rem;
        margin-bottom: 0;
    }

    .sub-filters {
        justify-content: center;
        margin: 1rem 0 1.5rem 0;
    }

    .filters {
        justify-content: center;
        margin: 1.5rem 0;
    }

    .filter-btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .lightbox-close {
        top: -2.5rem;
        right: -0.5rem;
    }

    .lightbox-controls {
        flex-direction: column;
        width: 100%;
    }

    .lightbox-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .filters {
        flex-direction: column;
    }

    .media-overlay {
        padding: 0.75rem;
    }

    .action-btn {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.8rem;
    }

    .action-btn i {
        font-size: 0.8rem;
    }
}

/* Animasyonlar */
.gallery-item {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.gallery-item:nth-child(1) {
    animation-delay: 0.1s;
}

.gallery-item:nth-child(2) {
    animation-delay: 0.15s;
}

.gallery-item:nth-child(3) {
    animation-delay: 0.2s;
}

.gallery-item:nth-child(4) {
    animation-delay: 0.25s;
}

.gallery-item:nth-child(5) {
    animation-delay: 0.3s;
}

.gallery-item:nth-child(6) {
    animation-delay: 0.35s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #0f172a;
        --surface-color: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --border-color: #334155;
    }
}

/* Focus styles for accessibility */
.btn:focus,
.filter-btn:focus,
.action-btn:focus,
.lightbox-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Daha Fazla Yükle */
.load-more-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 3rem 0;
    padding: 2rem;
}

.load-more-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    min-width: 200px;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.load-more-btn i {
    font-size: 1.25rem;
}

.load-more-btn small {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 400;
}

.loading-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.spinner-small {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Loading Placeholder */
.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 1.125rem;
}

.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: var(--radius-md);
    color: #c00;
}

/* Responsive Load More */
@media (max-width: 768px) {
    .load-more-btn {
        min-width: 180px;
        padding: 1rem 1.5rem;
        font-size: 0.875rem;
    }

    .load-more-btn i {
        font-size: 1rem;
    }
}

/* Selection styles */
::selection {
    background: var(--accent-color);
    color: white;
}