* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Hide scrollbar */
::-webkit-scrollbar {
    display: none;
}

html {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0f23, #1a1a2e);
    color: #fff;
    min-height: 100vh;
    position: relative;
    padding-bottom: 100px;
}

body::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: url('../images/bg/bg.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-container input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid rgba(74, 222, 128, 0.3);
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
}

.search-input-container input:focus {
    border-color: #4ade80;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
}

.search-input-container input::placeholder {
    color: #94a3b8;
}

.search-icon {
    position: absolute;
    right: 15px;
    color: #94a3b8;
    pointer-events: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 30px;
}

.page-header .logo img {
    height: 45px !important;
    max-height: 45px !important;
    width: auto !important;
    object-fit: contain !important;
    min-height: 45px !important;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-btn, .login-btn {
    background: transparent;
    border: none;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    height: 48px;
    width: 48px;
    pointer-events: auto !important;
    z-index: 999;
    position: relative;
}

/* Avatar specific styles */
.avatar-img {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: none !important;
    outline: none !important;
    filter: none !important;
    transition: none !important;
}

.search-btn img, .login-btn img:not(.avatar-img) {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    transition: filter 0.3s;
}

.search-btn:hover img, .login-btn:hover img:not(.avatar-img) {
    filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(90deg);
}

.search-btn:hover, .login-btn:hover {
    color: #4ade80;
}

.login-btn span {
    display: none;
}

@media (max-width: 480px) {
    .page-header {
        padding: 15px 0;
    }
    .logo img {
        height: 55px !important;
        max-height: 55px !important;
    }
    .header-actions {
        gap: 8px;
    }
    .search-btn, .login-btn {
        padding: 8px 10px;
        font-size: 12px;
        height: 36px;
    }
    .login-btn span {
        display: none;
    }
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 20px; 
    position: relative;
    z-index: 2;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    margin: 40px 0 20px 0;
    color: #4ade80;
    display: flex;
    align-items: center;
}

#animeCount {
    display: none !important;
}

.section-nav {
    display: flex;
    gap: 10px;
    margin: 30px 0 20px 0;
    overflow-x: auto;
    padding-bottom: 10px;
}

.section-tab {
    background: rgba(15, 15, 35, 0.8);
    color: #94a3b8;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 0.9em;
    opacity: 0;
    animation: fadeIn 0.6s ease-in-out forwards;
}

.section-tab:nth-child(1) { animation-delay: 0.1s; }
.section-tab:nth-child(2) { animation-delay: 0.2s; }
.section-tab:nth-child(3) { animation-delay: 0.3s; }
.section-tab:nth-child(4) { animation-delay: 0.4s; }

.section-tab:hover {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.section-tab.active {
    background: #4ade80;
    color: #000;
}

.section-tab svg {
    width: 16px;
    height: 16px;
}

#trendingGrid {
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

#trendingGrid.switching {
    opacity: 0;
    transform: translateX(20px);
}
    font-size: 2em;
    margin: 40px 0 20px 0;
    color: #4ade80;
    display: flex;
    align-items: center;
}

.anime-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    margin-bottom: 40px;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

#trendingGrid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
}

.anime-grid.switching {
    opacity: 0;
    transform: translateX(20px);
}

.anime-card {
    background: rgba(255,255,255,0.15), url('../images/bg/bg.png');
    background-size: cover, 100px 100px;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s;
    cursor: pointer;
    height: 280px;
    width: 100%;
    opacity: 0;
    animation: fadeIn 0.6s ease-in-out forwards;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    position: relative;
}

.anime-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/bg/bg.png');
    background-size: 80px 80px;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.1;
    pointer-events: none;
    z-index: 1;
}

.anime-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.2);
}

.anime-poster {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    z-index: 2;
}

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

.anime-info {
    padding: 10px;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    z-index: 2;
    background: rgba(15, 15, 35, 0.9);
}

.anime-title {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 32px;
}

.anime-meta {
    font-size: 11px;
    color: #94a3b8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.anime-card:nth-child(1) { animation-delay: 0.1s; }
.anime-card:nth-child(2) { animation-delay: 0.2s; }
.anime-card:nth-child(3) { animation-delay: 0.3s; }
.anime-card:nth-child(4) { animation-delay: 0.4s; }
.anime-card:nth-child(5) { animation-delay: 0.5s; }
.anime-card:nth-child(6) { animation-delay: 0.6s; }
.anime-card:nth-child(7) { animation-delay: 0.7s; }
.anime-card:nth-child(8) { animation-delay: 0.8s; }



.anime-poster {
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.anime-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.anime-info {
    padding: 12px;
}

.anime-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #fff;
    font-size: 0.9em;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.anime-meta {
    color: #94a3b8;
    font-size: 0.8em;
}

.load-more {
    text-align: center;
    margin: 30px 0;
}

.load-more button {
    background: #4ade80;
    color: #000;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
}

.load-more button:hover {
    background: #22c55e;
}

/* Loading States */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #94a3b8;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
}

.loading-text {
    font-size: 1.1em;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Skeleton Loading */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-card {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    overflow: hidden;
    height: 280px;
    width: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: pulse 1.5s ease-in-out infinite;
}



.skeleton-poster {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, rgba(255,255,255,0.2) 25%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    flex-shrink: 0;
}

.skeleton-info {
    padding: 10px;
    height: 80px;
    flex-grow: 1;
    background: rgba(15, 15, 35, 0.9);
}

.skeleton-title {
    height: 16px;
    background: linear-gradient(90deg, rgba(255,255,255,0.2) 25%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-meta {
    height: 12px;
    width: 70%;
    background: linear-gradient(90deg, rgba(255,255,255,0.2) 25%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 300px;
    overflow: hidden;
    margin-bottom: 40px;
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    cursor: pointer;
    display: block;
}

.hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: translateX(100%);
    transition: transform 0.8s ease-in-out;
    z-index: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 25px;
    overflow: hidden;
}

.hero-slide.active {
    z-index: 2;
}



/* Progress Dots */
.hero-progress {
    position: relative;
    bottom: 0;
    left: 0;
    transform: none;
    display: flex;
    gap: 15px;
    z-index: 10;
    justify-content: center;
    margin-top: -30px;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-dot.active {
    background: #4ade80;
    width: 40px;
    border-radius: 6px;
}

.progress-dot:hover {
    background: rgba(74, 222, 128, 0.5);
    transform: scale(1.2);
}
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

.hero-slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(0,0,0,0.8) 0%, 
        rgba(0,0,0,0.4) 50%, 
        rgba(0,0,0,0.7) 100%);
    display: flex;
    align-items: center;
    padding: 0 60px;
}

.hero-content {
    max-width: 600px;
    color: #fff;
    z-index: 2;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
    line-height: 1.2;
    background: linear-gradient(45deg, #fff, #4ade80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.2rem;
    line-height: 1.6;
    opacity: 0.9;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}



.hero-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    align-items: center;
}

.hero-dot {
    width: 40px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.hero-dot.active {
    background: rgba(74, 222, 128, 0.3);
    border: 1px solid #4ade80;
}

.hero-dot.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #4ade80;
    border-radius: 3px;
    animation: progressFill 5s linear;
}

@keyframes progressFill {
    0% { width: 0%; }
    100% { width: 100%; }
}

.hero-dot:hover {
    background: rgba(74, 222, 128, 0.5);
    transform: scale(1.1);
}

.hero-skeleton {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, 
        rgba(26, 26, 46, 0.9), 
        rgba(22, 33, 62, 0.9), 
        rgba(74, 222, 128, 0.1)
    );
    border-radius: 25px;
    position: relative;
    display: block;
}

.hero-skeleton::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
}

/* Modal */
.episode-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    display: none;
    overflow-y: auto;
}

.modal-content {
    max-width: 800px;
    margin: 50px auto;
    background: #1a1a2e;
    border-radius: 12px;
    padding: 30px;
}

.close-btn {
    float: right;
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.episode-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.episode-btn {
    background: rgba(74, 222, 128, 0.2);
    border: 1px solid #4ade80;
    color: #4ade80;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
}

.episode-btn:hover {
    background: #4ade80;
    color: #000;
}

.video-player {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    margin: 20px 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav { 
        flex-direction: row; 
        gap: 15px; 
        padding: 10px 20px;
        border-radius: 25px;
        justify-content: space-between;
    }
    .logo img {
        height: 35px;
    }
    .search-box { 
        padding: 3px;
    }
    .search-box input { 
        width: 180px;
        font-size: 14px;
        padding: 8px 12px;
    }
    .search-btn {
        width: 32px;
        height: 32px;
        padding: 6px;
    }
    .search-btn svg {
        width: 18px;
        height: 18px;
    }
    .container { padding: 10px; }
    .anime-poster { height: 200px; }
    .anime-info { padding: 8px; }
    .anime-title { font-size: 0.8em; }
    .anime-meta { font-size: 0.7em; }
    .skeleton-poster { height: 200px; }
    .skeleton-info { padding: 8px; }
    .hero-section { height: 240px; }
    .hero-skeleton { height: 240px; }
    .hero-overlay { padding: 0 15px; }
    .hero-title { font-size: 1.6em; }
    .hero-description { 
        font-size: 0.85em;
        -webkit-line-clamp: 2;
        margin-bottom: 15px;
    }
    .hero-buttons { 
        gap: 8px;
    }
    }
    .hero-dot {
        width: 30px;
        height: 4px;
    }
    .modal-content { 
        margin: 10px; 
        padding: 15px; 
        max-height: 90vh;
        overflow-y: auto;
    }
    .episode-list {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    .episode-btn {
        padding: 8px;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .nav {
        padding: 8px 15px;
        border-radius: 20px;
    }
    .logo img {
        height: 30px;
    }
    .search-box input {
        width: 140px;
        font-size: 13px;
    }
    .search-btn {
        width: 28px;
        height: 28px;
    }
    .search-btn svg {
        width: 16px;
        height: 16px;
    }
    .anime-poster { height: 180px; }
    .skeleton-poster { height: 180px; }
    .hero-section { height: 200px; }
    .hero-skeleton { height: 200px; }
    .hero-title { font-size: 1.4em; }
    .hero-description { font-size: 0.8em; }
    .hero-buttons { 
        flex-direction: column; 
        gap: 6px;
    }
    }
    .hero-dot {
        width: 25px;
        height: 3px;
    }
    .hero-nav {
        gap: 10px;
    }
    .episode-list {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* Updated Wed Oct  8 07:44:00 PM UTC 2025 */
/* Logo Link Fix */
.logo a {
    display: block;
    text-decoration: none;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    color: inherit !important;
}
/* Error State Styling */
.error-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    grid-column: 1 / -1;
}

.retry-btn {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: black;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 222, 128, 0.4);
}
