/* Library Page Styles */

.library-container {
    padding: 2rem;
    margin: 0 auto;
    max-width: 1200px;
    min-height: 80vh;
    color: var(--white);
}

/* Loading spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
}

.spinner {
    width: 5rem;
    height: 5rem;
    border: 0.5rem solid rgba(255, 255, 255, 0.1);
    border-top: 0.5rem solid var(--main-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    font-size: 1.8rem;
    color: var(--light-white);
}

/* Error message */
.error-message {
    font-size: 1.8rem;
    color: #ff5252;
    margin-bottom: 2rem;
    text-align: center;
}

/* Library header */
.library-header {
    margin-bottom: 2.5rem;
    text-align: left;
}

.library-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--main-color);
}

.library-description {
    font-size: 1.5rem;
    color: var(--light-white);
    max-width: 800px;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Filter section */
.library-filters {
    margin-bottom: 2rem;
}

.filter-group {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 1.2rem;
    background-color: var(--light-black);
    padding: 1.2rem;
    border-radius: 0.6rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.search-filter {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-filter input {
    width: 100%;
    padding: 0.9rem 3.5rem 0.9rem 1.2rem;
    border-radius: 0.4rem;
    border: 1px solid var(--gray);
    background-color: var(--dark-black);
    color: var(--white);
    font-size: 1.5rem;
}

.search-filter label {
    position: absolute;
    top: 50%;
    right: 1.2rem;
    transform: translateY(-50%);
    color: var(--gray);
    cursor: pointer;
    font-size: 1.5rem;
}

.sort-filter, .genre-filter {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.sort-filter label, .genre-filter label {
    color: var(--light-white);
    font-size: 1.4rem;
    white-space: nowrap;
}

.sort-filter select, .genre-filter select {
    padding: 0.7rem 1.2rem;
    border-radius: 0.4rem;
    border: 1px solid var(--gray);
    background-color: var(--dark-black);
    color: var(--white);
    font-size: 1.4rem;
    cursor: pointer;
    min-width: 150px;
}

/* Anime counter */
.anime-counter {
    font-size: 1.5rem;
    color: var(--light-white);
    margin-bottom: 1.5rem;
    font-weight: 500;
    padding: 0 0.5rem;
}

.anime-counter span {
    color: var(--white);
    font-weight: 600;
}

/* Library grid styles */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* List view */
.library-grid.list-view {
    grid-template-columns: 1fr;
    gap: 0.8rem;
}

.list-view .library-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: var(--light-black);
    border-radius: 0.8rem;
    transition: all 0.3s ease;
    gap: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
}

.list-view .anime-poster {
    width: 100px;
    height: 140px;
    margin: 0;
    flex-shrink: 0;
    border-radius: 0.5rem;
    overflow: hidden;
}

.list-view .anime-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-view .anime-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    padding: 0.5rem 0;
}

.list-view .anime-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: auto;
}

.list-view .anime-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.list-view .anime-meta span {
    font-size: 1.4rem;
    color: var(--light-white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Grid view item */
.library-item {
    position: relative;
    background-color: var(--light-black);
    border-radius: 0.8rem;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.library-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.anime-poster {
    position: relative;
    width: 100%;
    padding-bottom: 140%; /* 10:14 aspect ratio */
    overflow: hidden;
    cursor: pointer;
}

.anime-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.library-item:hover .anime-poster img {
    transform: scale(1.05);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.library-item:hover .overlay {
    opacity: 1;
}

.action-btn {
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    text-decoration: none;
}

.action-btn:hover {
    background-color: var(--main-color);
    transform: scale(1.1);
}

.anime-info {
    padding: 1rem;
    background-color: var(--light-black);
}

.anime-title {
    font-size: 1.5rem;
    color: var(--white);
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    height: 4rem;
}

.anime-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    color: var(--light-white);
    font-size: 1.3rem;
}

.anime-meta {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.anime-year, .anime-type, .anime-episodes {
    font-size: 1.2rem;
}

.anime-type {
    color: var(--main-color);
}

.anime-rating {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
}

.stars {
    color: #ffc107;
    font-size: 1.1rem;
}

.rating-value {
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--white);
}

/* Empty state */
.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    height: 40vh;
    background-color: var(--light-black);
    border-radius: 0.6rem;
}

.empty-state img {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.8rem;
    color: var(--white);
    margin-bottom: 0.8rem;
}

.empty-state p {
    font-size: 1.4rem;
    color: var(--light-white);
    margin-bottom: 1.5rem;
    max-width: 500px;
}

.empty-state .btn-primary {
    padding: 0.8rem 2rem;
    font-size: 1.5rem;
}

/* Pagination */
.library-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.page-btn {
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    background-color: var(--light-black);
    border: none;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
}

.page-btn:hover:not(:disabled) {
    background-color: var(--main-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.current-page {
    font-size: 1.5rem;
    color: var(--light-white);
}

/* Responsive */
@media (max-width: 991px) {
    .library-container {
        padding: 1.5rem;
    }

    .library-header h1 {
        font-size: 2.6rem;
    }

    .library-description {
        font-size: 1.4rem;
    }

    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1.2rem;
    }
    
    /* Poster oranını koruyoruz */
    .anime-poster {
        padding-bottom: 140%; /* 10:14 oranını koruyoruz */
    }
}

@media (max-width: 768px) {
    .library-container {
        padding: 1rem;
    }

    .library-header h1 {
        font-size: 2.4rem;
    }

    .library-description {
        font-size: 1.3rem;
    }

    .filter-group {
        flex-direction: column;
        padding: 1rem;
    }

    .sort-filter, .genre-filter {
        width: 100%;
    }

    .sort-filter select, .genre-filter select {
        width: 100%;
    }

    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 1rem;
    }
    
    /* Poster oranını koruyoruz */
    .anime-poster {
        padding-bottom: 140%; /* 10:14 oranını koruyoruz */
    }

    .list-view .anime-poster {
        width: 85px;
        height: 119px; /* 10:14 oranını koruyoruz (85 * 1.4 = 119) */
    }

    .list-view .anime-info {
        min-height: 119px; /* Poster yüksekliği ile aynı */
    }

    .list-view .anime-title {
        font-size: 1.6rem;
        margin-bottom: 0.8rem;
    }

    .anime-title {
        font-size: 1.4rem;
    }

    .anime-details {
        flex-direction: column;
        gap: 0.5rem;
    }

    .empty-state h3 {
        font-size: 2rem;
    }

    .empty-state p {
        font-size: 1.4rem;
    }
    
    .list-view .library-item {
        padding: 0.8rem;
        gap: 1.2rem;
    }

    .list-view .anime-meta {
        gap: 1rem;
    }

    .list-view .anime-meta span {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .library-header h1 {
        font-size: 2.2rem;
        text-align: center;
    }

    .library-description {
        font-size: 1.2rem;
        text-align: center;
    }

    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.8rem;
    }

    /* Poster oranını koruyoruz */
    .anime-poster {
        padding-bottom: 140%; /* 10:14 oranını koruyoruz */
    }

    .list-view .library-item {
        padding: 0.7rem;
        gap: 1rem;
    }

    .list-view .anime-poster {
        width: 75px;
        height: 105px; /* 10:14 oranını koruyoruz (75 * 1.4 = 105) */
    }

    .list-view .anime-info {
        min-height: 105px; /* Poster yüksekliği ile aynı */
        padding: 0.3rem 0;
    }

    .list-view .anime-title {
        font-size: 1.4rem;
        margin-bottom: 0.6rem;
    }

    .list-view .anime-meta {
        gap: 0.8rem;
    }

    .list-view .anime-meta span {
        font-size: 1.2rem;
    }

    .empty-state img {
        max-width: 200px;
    }

    .anime-info {
        padding: 0.8rem;
    }

    .anime-title {
        font-size: 1.3rem;
        height: 3.6rem;
        margin-bottom: 0.6rem;
    }
}

@media (max-width: 480px) {
    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.6rem;
    }
    
    /* Poster oranını koruyoruz */
    .anime-poster {
        padding-bottom: 140%; /* 10:14 oranını koruyoruz */
    }

    .anime-title {
        font-size: 1.2rem;
    }

    .anime-rating {
        font-size: 1.2rem;
    }

    .anime-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .anime-year, .anime-type, .anime-episodes {
        font-size: 1.1rem;
    }

    .list-view .library-item {
        padding: 0.6rem;
        gap: 0.8rem;
    }

    .list-view .anime-poster {
        width: 70px;
        height: 98px; /* 10:14 oranını koruyoruz (70 * 1.4 = 98) */
    }

    .list-view .anime-info {
        min-height: 98px; /* Poster yüksekliği ile aynı */
    }

    .list-view .anime-title {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }

    .list-view .anime-meta {
        gap: 0.6rem;
        flex-direction: column;
    }

    .list-view .anime-meta span {
        font-size: 1.1rem;
    }

    .anime-info {
        padding: 0.6rem;
    }

    .anime-title {
        font-size: 1.2rem;
        height: 3.2rem;
        margin-bottom: 0.4rem;
    }
}

/* Detaylı Filtre Buton */
.btn-secondary {
    background-color: var(--dark-black);
    border: 1px solid var(--main-color);
    color: var(--white);
    padding: 0.8rem 1.4rem;
    border-radius: 0.6rem;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-secondary:hover {
    background-color: rgba(255, 82, 82, 0.15);
    border-color: var(--main-color);
    transform: translateY(-2px);
}

.btn-secondary i {
    font-size: 1.4rem;
    color: var(--main-color);
}

.btn-secondary.active {
    background-color: rgba(255, 82, 82, 0.15);
    border-color: var(--main-color);
    color: var(--white);
}

/* Detaylı Filtreler Paneli */
.advanced-filters-panel {
    background-color: var(--light-black);
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.advanced-filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

/* Filtre Bölümleri */
.filter-section {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 0.8rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.filter-section:hover {
    border-color: rgba(255, 82, 82, 0.3);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.filter-section h3 {
    font-size: 1.6rem;
    color: var(--main-color);
    margin-bottom: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.filter-section h3::before {
    content: '';
    width: 0.5rem;
    height: 1.6rem;
    background-color: var(--main-color);
    border-radius: 2px;
    display: inline-block;
}

/* Checkbox Grupları */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.5rem;
    color: var(--light-white);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.5rem 0.7rem;
    border-radius: 0.4rem;
}

.checkbox-group label:hover {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.05);
}

.checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.8rem;
    height: 1.8rem;
    border: 2px solid var(--gray);
    border-radius: 0.3rem;
    background-color: var(--dark-black);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-group input[type="checkbox"]:checked {
    background-color: var(--main-color);
    border-color: var(--main-color);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-group input[type="checkbox"]:hover {
    border-color: var(--main-color);
}

.studio-link {
    margin-left: auto;
    color: var(--main-color);
    font-size: 1.2rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.studio-link:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* Kaydırılabilir Checkbox Grup */
.checkbox-group.scrollable {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 1rem;
    margin-right: -0.5rem;
}

.checkbox-group.scrollable::-webkit-scrollbar {
    width: 0.6rem;
}

.checkbox-group.scrollable::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
}

.checkbox-group.scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 82, 82, 0.5);
    border-radius: 0.5rem;
}

.checkbox-group.scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--main-color);
}

/* Aralık Seçici */
.range-slider {
    margin-bottom: 1.5rem;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.range-inputs input {
    width: 100%;
    padding: 0.9rem;
    border-radius: 0.6rem;
    border: 1px solid var(--gray);
    background-color: var(--dark-black);
    color: var(--white);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.range-inputs input:focus {
    border-color: var(--main-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 82, 82, 0.2);
}

.range-inputs span {
    color: var(--light-white);
    font-size: 1.6rem;
    padding: 0 0.3rem;
}

/* Filtre Butonları */
.advanced-filter-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background-color: var(--main-color);
    border: none;
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 0.6rem;
    font-size: 1.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3);
}

.btn-primary:hover {
    background-color: #ff3939;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(255, 82, 82, 0.4);
}

.advanced-filter-actions .btn-secondary {
    background-color: transparent;
    border: 1px solid var(--gray);
    color: var(--light-white);
    box-shadow: none;
}

.advanced-filter-actions .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border-color: var(--white);
}

/* Responsive */
@media (max-width: 768px) {
    .advanced-filters-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .advanced-filter-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
} 