@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        background: var(--bg-color);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 2px 10px rgba(0,0,0,0.08);
        transition: background 0.3s, border-color 0.3s;
    }

    .logo-image {
        height: 35px;
        transition: filter 0.3s;
    }

    [data-theme="light"] .logo-image {
        filter: none;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--card-bg);
        flex-direction: column;
        padding: 1.5rem 1rem 1rem 1rem;
        gap: 0.75rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        box-shadow: 0 8px 30px rgba(0,0,0,0.18);
        z-index: 99;
        border-radius: 0 0 1.5rem 1.5rem;
        backdrop-filter: blur(12px);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        box-shadow: 0 12px 40px rgba(220,38,38,0.18);
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 1rem 0.5rem;
        border-radius: 0.75rem;
        font-weight: 700;
        font-size: 1.1rem;
        color: var(--text-color);
        background: transparent;
        border: 2px solid transparent;
        transition: background 0.3s, color 0.3s, border-color 0.3s;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }

    .nav-link:hover, .nav-link.active {
        background: var(--gradient);
        color: #fff;
        border-color: var(--primary-red);
        transform: scale(1.04);
        box-shadow: 0 4px 15px rgba(220,38,38,0.12);
    }

    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
        cursor: pointer;
        gap: 6px;
        background: var(--card-bg);
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border: 1px solid var(--border-color);
        transition: background 0.3s, border-color 0.3s;
    }

    .mobile-menu-btn span {
        display: block;
        width: 24px;
        height: 3px;
        background: var(--primary-red);
        border-radius: 2px;
        transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
        background: var(--dark-red);
    }
    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
        background: var(--dark-red);
    }

    .theme-btn {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
        background: var(--gradient);
        color: #fff;
        border: none;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.3s, color 0.3s;
    }
    .theme-btn[data-theme="light"] {
        background: var(--card-bg);
        color: var(--primary-red);
        border: 1px solid var(--border-color);
    }
    .theme-btn[data-theme="dark"] {
        background: var(--gradient);
        color: #fff;
        border: none;
    }

    .main-content {
        padding: 1rem;
    }

    .hero {
        padding: 3rem 1rem;
        max-height: 300px;
        min-height: 300px;
        background-attachment: scroll;
        margin-top: 0;
        border-radius: 0 0 1.5rem 1.5rem;
    }

    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 0.75rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .content-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .sidebar {
        position: static;
        padding: 1rem;
    }

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

    .anime-cover {
        height: 200px;
    }

    .status-filters {
        gap: 0.5rem;
        justify-content: center;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .history-item {
        width: 160px;
    }

    .history-cover {
        height: 100px;
    }

    .recommended-item {
        padding: 0.75rem;
        gap: 0.75rem;
        min-height: 70px;
    }

    .recommended-cover {
        width: 50px;
        height: 70px;
    }

    .recommended-title {
        font-size: 0.85rem;
        line-height: 1.2;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        min-height: 2.4em;
    }

    .recommended-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    .recommended-rating,
    .recommended-episodes {
        font-size: 0.7rem;
    }

    .modal-content {
        margin: 5% auto;
        padding: 1.5rem;
        width: 95%;
    }

    .mylist-item {
        padding: 0.75rem;
    }

    .mylist-cover {
        width: 60px;
        height: 80px;
    }

    .pagination {
        gap: 0.75rem;
        margin: 1.5rem 0;
        padding: 0.75rem;
    }

    .page-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .page-info {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .section-title::after {
        width: 40px;
    }
}

@media (max-width: 480px) {
    .logo-image {
        height: 30px;
    }
    
    .nav-container {
        padding: 0 0.75rem;
    }

    .hero {
        padding: 2.5rem 1rem;
        max-height: 250px;
        min-height: 250px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

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

    .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .anime-cover {
        height: 180px;
    }

    .history-item {
        width: 140px;
    }

    .history-cover {
        height: 90px;
    }

    .search-container {
        margin-bottom: 2rem;
    }

    #searchInput {
        padding: 0.875rem 3.5rem 0.875rem 0.875rem;
        font-size: 0.9rem;
    }

    .search-btn {
        padding: 0.5rem 0.875rem;
        font-size: 1rem;
    }

    .status-filters {
        justify-content: center;
    }

    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .recommended-list {
        gap: 0.75rem;
    }

    .recommended-item {
        padding: 0.6rem;
        gap: 0.6rem;
    }

    .recommended-cover {
        width: 45px;
        height: 60px;
    }

    .recommended-title {
        font-size: 0.8rem;
    }

    .recommended-status {
        font-size: 0.7rem;
    }

    .loading-indicator {
        padding: 2rem;
    }

    .loading-spinner {
        width: 30px;
        height: 30px;
    }

    .pagination {
        gap: 0.5rem;
        margin: 1rem 0;
        padding: 0.5rem;
    }

    .page-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }

    .page-info {
        font-size: 0.8rem;
    }

    .section-title {
        font-size: 1.3rem;
    }
}

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

    .anime-cover {
        height: 160px;
    }

    .history-item {
        width: 130px;
    }

    .filter-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.7rem;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .pagination {
        flex-direction: column;
        gap: 0.5rem;
    }

    .recommended-item {
        flex-direction: column;
        text-align: center;
        min-height: auto;
        padding: 1rem;
    }

    .recommended-cover {
        width: 80px;
        height: 110px;
    }

    .recommended-info {
        width: 100%;
    }
}

@media (hover: none) and (pointer: coarse) {
    .anime-card:hover,
    .history-item:hover,
    .recommended-item:hover,
    .nav-link:hover,
    .theme-btn:hover,
    .filter-btn:hover,
    .my-list-btn:hover,
    .favorite-btn:hover,
    .page-btn:hover {
        transform: none;
    }

    .anime-card:active,
    .history-item:active,
    .recommended-item:active,
    .nav-link:active,
    .theme-btn:active,
    .filter-btn:active,
    .my-list-btn:active,
    .favorite-btn:active,
    .page-btn:active {
        transform: scale(0.98);
    }

    .recommended-item:active::before {
        opacity: 1;
    }

    .history-item:active .history-close {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-menu,
    .anime-card,
    .history-item,
    .recommended-item,
    .nav-link,
    .theme-btn,
    .filter-btn,
    .my-list-btn,
    .favorite-btn,
    .page-btn {
        transition: none;
    }
    
    .mobile-menu-btn span {
        transition: none;
    }
    
    .anime-cover,
    .recommended-cover {
        transition: none;
    }
    
    .overlay-info {
        transition: none;
    }
}