/* assets/css/style.css - e-anime (matching e-movies design) */

/* ==================== RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #0a0a0f;
    color: #fff;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* ==================== AUTH PAGE (Login/Register) ==================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0f;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-box {
    background: #14141a;
    border-radius: 14px;
    padding: 36px 32px;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.auth-header {
    margin-bottom: 24px;
}

.auth-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #4a9eff;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.auth-header p {
    font-size: 0.88rem;
    color: #666;
}

.tabs {
    display: flex;
    width: 100%;
    background: #0e0e14;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
    padding: 3px;
}

.tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    color: #666;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    text-align: center;
    border: none;
}

.tab.active {
    background: #1a1a24;
    color: #fff;
    font-weight: 600;
}

.tab:hover:not(.active) {
    color: #999;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

.form-group {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    background: #0e0e14;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.08);
}

.form-group input::placeholder {
    color: #555;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -6px;
    margin-bottom: 6px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 0.82rem;
    color: #888;
}

.checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4a9eff;
}

.forgot-link {
    color: #4a9eff;
    font-size: 0.82rem;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #5db0ff;
    text-decoration: underline;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: #3a8eef;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #5db0ff;
    box-shadow: 0 4px 16px rgba(58, 142, 239, 0.3);
}

.btn-block {
    width: 100%;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 0.85rem;
}

.auth-footer a {
    color: #4a9eff;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: #5db0ff;
    text-decoration: underline;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    text-align: left;
}

.alert-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
    color: #ff6b6b;
}

.alert-success {
    background: rgba(68, 255, 136, 0.1);
    border: 1px solid #44ff88;
    color: #44ff88;
}

.alert-warning {
    background: rgba(255, 170, 68, 0.1);
    border: 1px solid #ffaa44;
    color: #ffaa44;
}

/* ==================== SHARED NAVIGATION ==================== */
.site-header {
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 48px;
}

.site-header .logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #4a9eff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1;
    justify-content: center;
}

/* Mode Switch (Anime/Manga toggle) */
.mode-switch {
    display: flex;
    background: #1a1a22;
    border-radius: 8px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mode-switch-btn {
    padding: 6px 18px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #888 !important;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none !important;
    background: transparent;
}

.mode-switch-btn:hover {
    color: #bbb !important;
}

.mode-switch-btn.active {
    background: #4a9eff !important;
    color: #fff !important;
}

.mode-switch-btn.active:hover {
    color: #fff !important;
}

.nav-links a {
    color: #999;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    letter-spacing: 0.2px;
}

.nav-links a:hover {
    color: #fff;
}

.nav-links a.active {
    color: #4a9eff;
}

.nav-dropdown {
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
    margin-bottom: -8px;
}

.nav-dropbtn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0;
    transition: color 0.2s;
    letter-spacing: 0.2px;
}

.nav-dropbtn:hover {
    color: #fff;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #1a1a22;
    min-width: 170px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 9999;
    max-height: 340px;
    overflow-y: auto;
    padding: 6px 0;
}

.nav-dropdown-content a {
    color: #ccc !important;
    padding: 10px 16px;
    display: block;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.nav-dropdown-content a:hover {
    background: rgba(74, 158, 255, 0.15);
    color: #4a9eff !important;
}

.nav-dropdown:hover .nav-dropdown-content,
.nav-dropdown.open .nav-dropdown-content {
    display: block;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==================== CONTAINER ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 48px;
}

/* ==================== SECTION HEADERS ==================== */
h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    margin-top: 0;
    letter-spacing: -0.3px;
}

.content-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #1a1a22;
}

/* ==================== HORIZONTAL SCROLL ROW ==================== */
.scroll-row-wrapper {
    position: relative;
}

.scroll-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 0 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.scroll-row::-webkit-scrollbar {
    display: none;
}

.scroll-arrow {
    position: absolute;
    top: 0;
    bottom: 12px;
    width: 48px;
    background: linear-gradient(to right, rgba(10, 10, 15, 0.95), transparent);
    color: #fff;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
    opacity: 0;
    border-radius: 0;
}

.scroll-row-wrapper:hover .scroll-arrow {
    opacity: 1;
}

.scroll-arrow:hover {
    color: #4a9eff;
}

.scroll-left {
    left: 0;
    background: linear-gradient(to right, rgba(10, 10, 15, 0.95), transparent);
}

.scroll-right {
    right: 0;
    background: linear-gradient(to left, rgba(10, 10, 15, 0.95), transparent);
}

/* ==================== ANIME CARD (Poster Style - matches movie-item) ==================== */
.anime-item {
    position: relative;
    min-width: 185px;
    max-width: 185px;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
    background: #14141a;
}

.anime-item:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(74, 158, 255, 0.2);
    z-index: 5;
}

.anime-item a {
    display: block;
    position: relative;
    color: #fff;
}

.anime-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px 8px 0 0;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.anime-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.95) 100%);
    color: #fff;
    padding: 32px 10px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
    line-height: 1.3;
}

.anime-item:hover .anime-title-overlay {
    opacity: 1;
}

/* Continue watching badge */
.continue-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: #e0e0e0;
    padding: 12px 8px 6px;
    font-size: 0.72rem;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Remove button */
.remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
    line-height: 1;
    opacity: 0;
}

.anime-item:hover .remove-btn {
    opacity: 1;
}

.remove-btn:hover {
    background: #4a9eff;
    border-color: #4a9eff;
}

/* Legacy grid (fallback for pages still using it) */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
}

.anime-grid .anime-item {
    min-width: 0;
    max-width: none;
}

.anime-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    background: #14141a;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.anime-card:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(74, 158, 255, 0.15);
}

.anime-card-image {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: #1a1a22;
}

.anime-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
    padding: 32px 10px 10px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.anime-grid .anime-item .anime-card-overlay {
    transform: translateY(0);
}

.anime-card:hover .anime-card-overlay,
.anime-item:hover .anime-card-overlay {
    transform: translateY(0);
}

.anime-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.anime-card-info {
    font-size: 0.78rem;
    color: #888;
}

/* ==================== ANNOUNCEMENT BANNER ==================== */
.announcement-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 14px 50px 14px 24px;
    text-align: center;
    border-bottom: 2px solid #4a9eff;
    position: relative;
    font-size: 0.95rem;
}

.announcement-close,
.dismiss-announcement {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(74, 158, 255, 0.2);
    color: white;
    border: 1px solid rgba(74, 158, 255, 0.3);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.announcement-close:hover,
.dismiss-announcement:hover {
    background: #4a9eff;
    border-color: #4a9eff;
}

/* ==================== SEARCH PAGE ==================== */
.search-container {
    text-align: center;
    padding: 40px 20px 20px;
}

.search-container h1 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.search-form {
    display: flex;
    gap: 12px;
    max-width: 640px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 14px 20px;
    background: #14141a;
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.search-input::placeholder {
    color: #555;
}

.search-form .btn {
    padding: 14px 28px;
    white-space: nowrap;
}

/* Search results grid */
.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.search-item {
    background: #14141a;
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.search-item:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(74, 158, 255, 0.15);
}

.search-item img {
    width: 100%;
    display: block;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

.search-item-info {
    padding: 12px 10px;
}

.search-title {
    font-size: 0.88rem;
    color: #e0e0e0;
    margin: 0 0 4px;
    font-weight: 600;
    line-height: 1.3;
}

.search-year {
    font-size: 0.78rem;
    color: #666;
    margin: 0;
}

.type-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.type-badge.sub {
    background: rgba(52, 152, 219, 0.15);
    color: #5dade2;
}

.type-badge.dub {
    background: rgba(58, 142, 239, 0.15);
    color: #ff6b7a;
}

/* ==================== ANIME DETAILS (Banner Style) ==================== */
.banner {
    background-size: cover;
    background-position: center top;
    padding: 100px 48px 80px;
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
}

.banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 15, 0.4) 0%,
        rgba(10, 10, 15, 0.7) 50%,
        rgba(10, 10, 15, 1) 100%
    );
}

.info-box {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    background: rgba(14, 14, 20, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    padding: 28px 32px;
    border-radius: 14px;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.06);
    gap: 28px;
}

.info-box img {
    width: 180px;
    height: auto;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.text {
    flex: 1;
}

.text h1 {
    margin: 0 0 10px;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.meta-badge {
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
}

.meta-badge.rating-badge {
    background: rgba(230, 168, 23, 0.15);
    color: #f0c040;
    font-weight: 700;
}

.genre-tags {
    color: #777;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.overview {
    color: #b0b0b0;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 16px;
    max-height: 120px;
    overflow: hidden;
}

.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.btn-watch {
    background: #3a8eef;
    color: white;
    border: none;
    padding: 11px 28px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.2s;
    letter-spacing: 0.3px;
    text-decoration: none;
    display: inline-block;
}

.btn-watch:hover {
    background: #5db0ff;
    box-shadow: 0 4px 16px rgba(58, 142, 239, 0.3);
}

.btn-watchlist {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ccc;
    padding: 11px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.88rem;
    font-weight: 500;
}

.btn-watchlist:hover {
    background-color: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-watchlist.added {
    background-color: rgba(39, 174, 96, 0.15);
    color: #4ade80;
    border-color: rgba(39, 174, 96, 0.2);
}

/* ==================== EPISODES SECTION ==================== */
.section {
    padding: 24px 48px;
    max-width: 1400px;
    margin: 0 auto;
}

.section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: -0.2px;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.episode-card {
    background: #14141a;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.04);
    text-decoration: none;
    color: inherit;
    display: block;
}

.episode-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(74, 158, 255, 0.15);
}

.episode-card img {
    width: 100%;
    display: block;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.episode-card .play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.episode-card:hover .play-overlay {
    opacity: 1;
}

.play-icon {
    width: 50px;
    height: 50px;
    background: #4a9eff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    transform: scale(0.8);
    transition: transform 0.3s;
}

.episode-card:hover .play-icon {
    transform: scale(1);
}

.episode-title {
    font-weight: 600;
    padding: 10px 12px 4px;
    font-size: 0.9rem;
}

.episode-overview {
    font-size: 0.82rem;
    padding: 0 12px 12px;
    color: #888;
    line-height: 1.4;
}

/* ==================== VIDEO OVERLAY ==================== */
.iframe-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.iframe-popup iframe {
    width: 85%;
    height: 85%;
    border: none;
    border-radius: 12px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
}

.iframe-close {
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 36px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    z-index: 10000;
    transition: color 0.2s;
}

.iframe-close:hover {
    color: #fff;
}

.hidden {
    display: none;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #1a1a22;
    color: #e0e0e0;
    padding: 14px 22px;
    border-radius: 10px;
    border-left: 4px solid #4a9eff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    font-size: 0.88rem;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.3s, transform 0.3s;
    max-width: 340px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    border-left-color: #27ae60;
}

.toast.error {
    border-left-color: #e74c3c;
}

/* ==================== PROGRESS BARS & FILTERS ==================== */
/* Progress bar for continue watching cards */
.anime-item .progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0;
}

.anime-item .progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #27ae60 0%, #4ade80 100%);
    border-radius: 0;
    width: var(--progress, 0%);
    transition: width 0.3s ease;
}

/* Recently watched remove button style (already in .remove-btn) */

/* Filter tabs for list page */
.filter-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    border-bottom: 2px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 12px;
}

.filter-tab {
    background: transparent;
    border: none;
    color: #666;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -14px;
    position: relative;
    top: 2px;
}

.filter-tab:hover {
    color: #fff;
}

.filter-tab.active {
    color: #4a9eff;
    border-bottom-color: #4a9eff;
    background: rgba(74, 158, 255, 0.08);
}

/* Sort dropdown */
.sort-dropdown {
    background: #14141a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #ccc;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sort-dropdown:hover {
    border-color: rgba(74, 158, 255, 0.3);
    color: #fff;
}

.sort-dropdown:focus {
    outline: none;
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.08);
}

/* Recent searches row */
.recent-searches {
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(20, 20, 26, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.recent-searches h3 {
    font-size: 0.9rem;
    color: #999;
    margin: 0 0 12px 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1a1a22;
    border: 1px solid rgba(74, 158, 255, 0.2);
    color: #ccc;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.search-pill:hover {
    background: rgba(74, 158, 255, 0.15);
    border-color: rgba(74, 158, 255, 0.4);
    color: #fff;
}

.search-pill-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all 0.2s;
}

.search-pill:hover .search-pill-close {
    background: rgba(255, 255, 255, 0.2);
}

/* ==================== GENRE FILTERS ==================== */
.genre-filters {
    margin: 20px auto;
    max-width: 640px;
    text-align: center;
}

.genre-filters h3 {
    font-size: 0.9rem;
    color: #999;
    margin: 0 0 12px 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.genre-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.genre-pill {
    display: inline-block;
    background: #1a1a22;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #aaa;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.genre-pill:hover {
    background: rgba(74, 158, 255, 0.15);
    border-color: rgba(74, 158, 255, 0.3);
    color: #fff;
}

.genre-pill.active {
    background: #4a9eff;
    border-color: #4a9eff;
    color: #fff;
}

/* ==================== RECOMMENDATIONS ==================== */
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.recommendation-card {
    background: #14141a;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.04);
    text-decoration: none;
    color: inherit;
    display: block;
}

.recommendation-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border-color: rgba(74, 158, 255, 0.15);
}

.recommendation-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
}

.recommendation-title {
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== PROFILE PAGE ==================== */
.profile-page {
    max-width: 700px;
    margin: 0 auto;
}

.profile-page h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.3px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: #14141a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #4a9eff;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.82rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-section {
    background: #14141a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 16px;
}

.profile-section h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #888;
    font-size: 0.92rem;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.sync-status.linked {
    color: #4ade80;
    background: rgba(39, 174, 96, 0.08);
}

.sync-icon {
    font-size: 1.1rem;
    font-weight: 700;
}

.sync-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.oauth-setup {
    margin-top: 10px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: #0a0a0f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: #4a9eff;
}

.form-input::placeholder {
    color: #555;
}

.btn-danger {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: rgba(231, 76, 60, 0.25);
    border-color: #e74c3c;
}

/* ==================== HISTORY PAGE ==================== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    display: flex;
    gap: 20px;
    background: #14141a;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 16px;
    transition: border-color 0.2s;
}

.history-item:hover {
    border-color: rgba(74, 158, 255, 0.15);
}

.history-poster {
    flex-shrink: 0;
}

.history-poster img {
    width: 80px;
    border-radius: 8px;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #e0e0e0;
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
    transition: color 0.2s;
}

.history-title:hover {
    color: #4a9eff;
}

.history-meta {
    font-size: 0.82rem;
    color: #888;
    margin-bottom: 8px;
}

.history-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.history-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #4ade80);
    border-radius: 4px;
    transition: width 0.3s;
}

.history-date {
    font-size: 0.78rem;
    color: #666;
    margin-bottom: 8px;
}

.history-episodes-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.history-ep-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    background: #1a1a22;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    color: #999;
    font-size: 0.78rem;
    text-decoration: none;
    transition: all 0.2s;
}

.history-ep-badge:hover {
    background: rgba(74, 158, 255, 0.15);
    border-color: rgba(74, 158, 255, 0.3);
    color: #fff;
}

.history-ep-badge.completed {
    background: rgba(39, 174, 96, 0.15);
    color: #4ade80;
    border-color: rgba(39, 174, 96, 0.2);
}

.history-ep-more {
    display: inline-flex;
    align-items: center;
    color: #666;
    font-size: 0.78rem;
    padding: 0 6px;
}

/* ==================== FOOTER ==================== */
.site-footer {
    background: rgba(10, 10, 15, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    text-align: center;
    padding: 28px 20px;
    margin-top: 60px;
    color: #444;
    font-size: 0.85rem;
}

.site-footer .footer-brand {
    color: #4a9eff;
    font-weight: 700;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #555;
}

.empty-state h2 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #888;
}

.empty-state p {
    margin-bottom: 20px;
}

.empty-state a {
    color: #4a9eff;
    font-weight: 600;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .container {
        padding: 24px 24px;
    }

    .header-inner {
        padding: 14px 24px;
    }

    .anime-item {
        min-width: 160px;
        max-width: 160px;
    }

    .banner {
        padding: 80px 32px 60px;
    }

    .section {
        padding: 20px 24px;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .header-inner {
        padding: 10px 14px;
    }

    .site-header .logo {
        font-size: 1.3rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 8px 16px 12px;
        gap: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        z-index: 999;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 10px 0;
        font-size: 0.92rem;
        width: 100%;
        text-align: left;
        color: #bbb;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    .mode-switch {
        margin: 8px 0;
        align-self: center;
    }

    .container {
        padding: 16px 12px;
    }

    h2 {
        font-size: 1.15rem;
    }

    .section-header {
        border-bottom: none;
        margin-bottom: 8px;
        padding-bottom: 0;
    }

    .anime-item {
        min-width: 120px;
        max-width: 120px;
        border-radius: 6px;
    }

    .anime-item img {
        border-radius: 6px 6px 0 0;
    }

    .anime-item:hover {
        transform: none;
        box-shadow: none;
    }

    .scroll-arrow {
        display: none;
    }

    .scroll-row {
        gap: 10px;
        padding: 4px 0 8px;
    }

    .anime-title-overlay {
        position: static;
        background: none;
        opacity: 1;
        padding: 6px 6px 8px;
        font-size: 0.72rem;
        color: #ccc;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .anime-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .anime-card {
        border-radius: 8px;
    }

    .anime-card:hover {
        transform: none;
        box-shadow: none;
    }

    .anime-card-overlay {
        position: static;
        background: none;
        transform: none;
        padding: 8px 6px;
    }

    .anime-card-title {
        font-size: 0.78rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .banner {
        padding: 20px 12px;
        min-height: auto;
    }

    .info-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 16px 14px;
        gap: 14px;
        border-radius: 10px;
    }

    .info-box img {
        width: 120px;
        border-radius: 8px;
    }

    .text h1 {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    .meta-info {
        justify-content: center;
    }

    .overview {
        font-size: 0.85rem;
        max-height: 80px;
        line-height: 1.5;
    }

    .action-buttons {
        justify-content: center;
        gap: 8px;
    }

    .btn-watch {
        padding: 10px 22px;
        font-size: 0.88rem;
    }

    .episode-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .section {
        padding: 16px 12px;
    }

    .section h2 {
        font-size: 1.15rem;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form .btn {
        width: 100%;
    }

    .search-results {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .search-title {
        font-size: 0.78rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .content-section {
        margin-bottom: 20px;
    }

    .auth-box {
        padding: 28px 20px;
    }

    .iframe-popup iframe {
        width: 100%;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .toast-container {
        bottom: 14px;
        right: 14px;
        left: 14px;
    }

    .toast {
        max-width: none;
        font-size: 0.82rem;
        padding: 12px 16px;
    }

    .site-header {
        position: relative;
    }

    .profile-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .profile-section {
        padding: 16px;
    }

    .sync-actions {
        flex-direction: column;
    }

    .history-item {
        flex-direction: column;
        gap: 12px;
    }

    .history-poster img {
        width: 60px;
    }

    .recommendations-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .genre-pills {
        gap: 6px;
    }

    .genre-pill {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

/* ==================== MANGA SECTION ==================== */

/* Manga Tabs */
.manga-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.06);
}

.manga-tab {
    background: transparent;
    border: none;
    color: #666;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.manga-tab:hover {
    color: #fff;
}

.manga-tab.active {
    color: #4a9eff;
    border-bottom-color: #4a9eff;
}

/* Manga Genre Filters */
.manga-genre-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.manga-genre-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #888;
    background: #14141a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.2s;
}

.manga-genre-pill:hover {
    color: #fff;
    border-color: rgba(74, 158, 255, 0.3);
    background: #1a1a24;
}

.manga-genre-pill.active {
    background: #4a9eff;
    color: #fff;
    border-color: #4a9eff;
}

/* Manga Grid */
.manga-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

/* Manga Card — Overlay style */
.manga-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.manga-card:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.manga-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    background: #1a1a22;
}

.manga-card .manga-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 8px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Status badge on manga card */
.manga-status-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    z-index: 2;
}

.manga-status-badge.ongoing {
    background: rgba(74, 158, 255, 0.85);
    color: #fff;
}

.manga-status-badge.completed {
    background: rgba(74, 222, 128, 0.85);
    color: #fff;
}

.manga-status-badge.hiatus {
    background: rgba(255, 170, 68, 0.85);
    color: #fff;
}

/* Skeleton loading */
.skeleton-card {
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    background: #14141a;
    position: relative;
}

.skeleton-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Chapter List */
.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chapter-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #14141a;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.chapter-item::after {
    content: '\203A';
    position: absolute;
    right: 16px;
    font-size: 1.2rem;
    color: #444;
    transition: all 0.2s;
}

.chapter-item:hover {
    border-color: rgba(74, 158, 255, 0.15);
    background: #1a1a22;
}

.chapter-item:hover::after {
    color: #4a9eff;
    right: 12px;
}

.chapter-number {
    font-size: 0.88rem;
    font-weight: 700;
    color: #4a9eff;
    min-width: 60px;
    flex-shrink: 0;
}

.chapter-info {
    flex: 1;
    min-width: 0;
}

.chapter-title {
    font-size: 0.88rem;
    font-weight: 500;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter-meta {
    font-size: 0.78rem;
    color: #666;
    margin-top: 2px;
}

/* Alternative Sources */
.alt-sources-loading {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 0.9rem;
}

.alt-source-card {
    background: #14141a;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.alt-source-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.alt-source-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.alt-source-badge.ninemanga {
    background: #e74c3c;
    color: #fff;
}

.alt-source-badge.mangafire {
    background: #f39c12;
    color: #000;
}

.alt-source-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: #ccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alt-source-load {
    flex-shrink: 0;
}

.btn-sm {
    padding: 6px 14px !important;
    font-size: 0.78rem !important;
}

.alt-source-chapters {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    max-height: 400px;
    overflow-y: auto;
}

.alt-source-chapters .chapter-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.alt-source-chapters .chapter-item:last-child {
    border-bottom: none;
}

/* Reader */
.reader-controls {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    padding: 10px 20px;
    gap: 16px;
}

.reader-back {
    color: #999;
    font-size: 1.4rem;
    text-decoration: none;
    transition: color 0.2s;
    flex-shrink: 0;
}

.reader-back:hover {
    color: #fff;
}

.reader-title {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reader-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.reader-nav-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s;
}

.reader-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.reader-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.reader-chapter-select {
    background: #14141a;
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    max-width: 120px;
}

.reader-chapter-select:focus {
    outline: none;
    border-color: #4a9eff;
}

/* Reader Container */
.reader-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 0 20px;
    min-height: 100vh;
    background: #0a0a0f;
}

.reader-page {
    width: 100%;
    max-width: 800px;
    display: block;
    margin: 0 auto;
}

/* Bottom Navigation */
.reader-bottom-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 24px 20px 40px;
    max-width: 800px;
    margin: 0 auto;
}

/* Reader Progress Bar */
.reader-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: #4a9eff;
    z-index: 1001;
    transition: width 0.1s linear;
}

/* Reader Page Counter */
.reader-page-counter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ccc;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    z-index: 999;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Auto-Advance Overlay */
.reader-auto-advance {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(74, 158, 255, 0.2);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 1000;
    animation: slide-up 0.3s ease;
}

@keyframes slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.reader-auto-advance .advance-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: #e0e0e0;
}

.reader-auto-advance .advance-text span {
    color: #4a9eff;
    font-weight: 700;
}

.reader-auto-advance .btn-advance {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.reader-auto-advance .btn-advance.primary {
    background: #4a9eff;
    color: #fff;
}

.reader-auto-advance .btn-advance.primary:hover {
    background: #5db0ff;
}

.reader-auto-advance .btn-advance.dismiss {
    background: rgba(255, 255, 255, 0.08);
    color: #999;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.reader-auto-advance .btn-advance.dismiss:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

/* Start Reading Button */
.btn-start-reading {
    display: inline-block;
    padding: 12px 28px;
    background: #4a9eff;
    color: #fff;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-start-reading:hover {
    background: #5db0ff;
    box-shadow: 0 4px 16px rgba(74, 158, 255, 0.3);
    color: #fff;
}

/* Manga responsive */
@media (max-width: 768px) {
    .manga-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .manga-card:hover {
        transform: none;
        box-shadow: none;
    }

    .manga-card .manga-title-overlay {
        font-size: 0.75rem;
        padding: 18px 6px 6px;
    }

    .manga-tab {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .manga-genre-filters {
        gap: 6px;
        margin-bottom: 16px;
    }

    .manga-genre-pill {
        padding: 4px 10px;
        font-size: 0.72rem;
    }

    .chapter-item {
        padding: 12px;
        gap: 10px;
    }

    .chapter-item::after {
        right: 12px;
    }

    .chapter-number {
        font-size: 0.82rem;
        min-width: 50px;
    }

    .reader-controls {
        padding: 8px 12px;
        gap: 10px;
    }

    .reader-title {
        font-size: 0.82rem;
    }

    .reader-nav-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .reader-chapter-select {
        max-width: 80px;
        font-size: 0.75rem;
    }

    .reader-container {
        padding: 50px 0 10px;
    }

    .reader-bottom-nav {
        padding: 16px 12px 30px;
        gap: 10px;
    }

    .reader-bottom-nav .btn {
        font-size: 0.82rem;
        padding: 10px 16px;
    }

    .reader-page-counter {
        bottom: 12px;
        right: 12px;
        font-size: 0.72rem;
        padding: 4px 10px;
    }

    .reader-auto-advance {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .reader-auto-advance .advance-text {
        font-size: 0.82rem;
        width: 100%;
        text-align: center;
    }

    .mode-switch-btn {
        padding: 5px 14px;
        font-size: 0.75rem;
    }

    .btn-start-reading {
        padding: 10px 20px;
        font-size: 0.88rem;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .manga-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .manga-status-badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    .anime-item {
        min-width: 105px;
        max-width: 105px;
    }

    .anime-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .search-results {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .episode-grid {
        grid-template-columns: 1fr;
    }

    .info-box img {
        width: 100px;
    }
}
