/* Age Rating Badges */
.age-rating-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    min-width: 1.5rem;
    color: white;
}

.age-rating-L {
    background-color: #28a745;
}

.age-rating-10 {
    background-color: #17a2b8;
}

.age-rating-12 {
    background-color: #ffc107;
    color: #000;
}

.age-rating-14 {
    background-color: #fd7e14;
}

.age-rating-16 {
    background-color: #dc3545;
}

.age-rating-18 {
    background-color: #000000;
}

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 200;
    display: none;
    align-items: flex-start;
    padding-top: 100px;
}

.search-modal.active {
    display: flex;
}

.search-modal-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.search-input-large {
    width: 100%;
    padding: 1.5rem 4rem 1.5rem 2rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1.5rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-input-large:focus {
    border-color: var(--primary);
}

.search-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 2rem;
    line-height: 1;
}

.search-close:hover {
    color: var(--text-primary);
}

.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}

.search-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.search-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Watchlist Button on Cards */
.watchlist-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
}

.watchlist-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

.watchlist-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.watchlist-btn svg {
    width: 20px;
    height: 20px;
}

/* Watchlist Button in Detail Pages - Small and Discrete */
.movie-meta .watchlist-btn,
.series-meta .watchlist-btn,
.anime-meta .watchlist-btn {
    position: static;
    width: auto;
    height: auto;
    padding: 0.25rem 0.6rem;
    border-radius: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 0.5rem;
}

.movie-meta .watchlist-btn .icon,
.series-meta .watchlist-btn .icon,
.anime-meta .watchlist-btn .icon {
    font-size: 1rem;
    line-height: 1;
}

.movie-meta .watchlist-btn:hover,
.series-meta .watchlist-btn:hover,
.anime-meta .watchlist-btn:hover {
    transform: none;
    background: var(--primary);
    border-color: var(--primary);
}

/* Watchlist Modal */
.watchlist-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.watchlist-modal.active {
    display: flex;
}

.watchlist-modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    position: relative;
}

.watchlist-modal h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: white !important;
}

.watchlist-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.watchlist-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    color: white !important;
}

.watchlist-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.5rem;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 300;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .search-modal {
        padding-top: 80px;
    }

    .search-input-large {
        font-size: 1.2rem;
        padding: 1rem 3rem 1rem 1.5rem;
    }

    .watchlist-modal-content {
        max-width: 95%;
        padding: 1.5rem;
    }

    .watchlist-modal h3 {
        font-size: 1.3rem;
    }

    .watchlist-option {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .search-input-large {
        font-size: 1rem;
        padding: 0.875rem 2.5rem 0.875rem 1rem;
    }

    .search-results {
        gap: 0.75rem;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}