/* Library Page Styles */

.library-container {
    min-height: 100vh;
    padding: 2rem 4%;
    background: linear-gradient(to bottom right, #0f172a, #1e3a8a, #0f172a);
}

.library-header {
    margin-bottom: 3rem;
    animation: fadeIn 0.6s ease-out;
}

.library-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.library-subtitle {
    font-size: 1.25rem;
    color: #bfdbfe;
    font-weight: 300;
}

.nav-link.active {
    color: white;
}

.nav-link.active::after {
    width: 100%;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    gap: 1.5rem;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-state p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    gap: 1.5rem;
    text-align: center;
}

.empty-icon {
    font-size: 5rem;
    opacity: 0.3;
}

.empty-state h2 {
    font-size: 2rem;
    font-weight: 600;
    color: white;
}

.empty-state p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
}

.btn-primary {
    padding: 0.875rem 2rem;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    border: none;
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

/* Media Grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.6s ease-out;
}

/* Media Card */
.media-card {
    position: relative;
    cursor: pointer;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.media-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-color: rgba(59, 130, 246, 0.5);
}

.media-poster {
    position: relative;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, #1e3a8a 0%, #7c3aed 100%);
    overflow: hidden;
}

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

.media-card:hover .media-poster img {
    transform: scale(1.1);
}

/* Poster Placeholder */
.poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.8) 0%, rgba(124, 58, 237, 0.8) 100%);
}

.placeholder-icon {
    font-size: 4rem;
    opacity: 0.4;
    margin-bottom: 1rem;
}

.placeholder-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    text-align: center;
    padding: 0 1rem;
    line-height: 1.4;
}

/* Media Info */
.media-info {
    padding: 1rem;
}

.media-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.media-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.media-year {
    color: #60a5fa;
}

.meta-separator {
    opacity: 0.5;
}

/* Play Overlay */
.play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-card:hover .play-overlay {
    opacity: 1;
}

.play-button {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-button:hover {
    transform: scale(1.1);
    background: white;
}

.play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #000;
    margin-left: 4px;
}

/* Progress Bar */
.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
}

.progress-fill {
    height: 100%;
    background: #3b82f6;
    transition: width 0.3s ease;
}

/* Quality Badge */
.quality-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

/* Type Badge (Anime vs Normal) */
.type-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(to right, #ec4899, #8b5cf6);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

/* Responsive */
@media (max-width: 1024px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .library-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .library-container {
        padding: 1.5rem 3%;
    }

    .library-title {
        font-size: 2rem;
    }

    .library-subtitle {
        font-size: 1rem;
    }

    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .media-title {
        font-size: 0.875rem;
    }

    .media-meta {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .placeholder-icon {
        font-size: 3rem;
    }

    .placeholder-title {
        font-size: 0.875rem;
    }
}