/* ============================================
   ANIMESTREAM â€” Modern Dark UI
   Clean animations, responsive, refined
   ============================================ */

/* â”€â”€ Reset & Base â”€â”€ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent:        #5865f2;
    --accent-soft:   rgba(88, 101, 242, 0.15);
    --accent-glow:   rgba(88, 101, 242, 0.25);
    --bg:            var(--tg-theme-bg-color, #0d0d14);
    --bg-card:       var(--tg-theme-secondary-bg-color, #16161f);
    --bg-elevated:   #1c1c28;
    --text:          var(--tg-theme-text-color, #f0f0f5);
    --text-muted:    rgba(240, 240, 245, 0.45);
    --border:        rgba(255, 255, 255, 0.07);
    --shadow-card:   0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-hover:  0 12px 32px rgba(0, 0, 0, 0.55);
    --radius-card:   12px;
    --radius-pill:   999px;
    --transition:    0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* â”€â”€ Scrollbar â”€â”€ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(88, 101, 242, 0.4);
    border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* â”€â”€ Keyframes â”€â”€ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.08); }
}

/* â”€â”€ Layout â”€â”€ */
.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 60px;
}

.hidden { display: none !important; }

/* â”€â”€ Header â”€â”€ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    animation: slideDown 0.4s ease both;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Ganti style logo-icon */
.logo-icon {
    width: 36px;
    height: 36px;
    animation: logoPulse 3s ease-in-out infinite;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

/* Hapus atau comment style logo-icon i sebelumnya */
/* .logo-icon i { font-size: 28px; } */
.logo-text h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text h1 span {
    background: linear-gradient(135deg, #f472b6 0%, #fb7185 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
    letter-spacing: 0.5px;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text);
}

.theme-toggle:hover {
    background: var(--bg-elevated);
    border-color: var(--accent);
    transform: rotate(20deg);
}

.theme-toggle i { font-size: 16px; }

/* â”€â”€ Search â”€â”€ */
.search-wrapper {
    margin-bottom: 20px;
    animation: slideDown 0.4s 0.05s ease both;
}

.search-container {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px 6px 4px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon { color: var(--text-muted); flex-shrink: 0; }
.search-icon i { font-size: 15px; }

.search-container input {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.search-container input::placeholder { color: var(--text-muted); }

.search-btn {
    background: var(--accent);
    border: none;
    padding: 9px 22px;
    border-radius: var(--radius-pill);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
    font-family: inherit;
    flex-shrink: 0;
}

.search-btn:hover  { opacity: 0.88; transform: scale(1.02); }
.search-btn:active { transform: scale(0.97); }

/* â”€â”€ Category Tabs â”€â”€ */
.categories-wrapper {
    overflow-x: auto;
    margin-bottom: 28px;
    scrollbar-width: none;
    animation: slideDown 0.4s 0.1s ease both;
}
.categories-wrapper::-webkit-scrollbar { display: none; }

.categories {
    display: flex;
    gap: 8px;
    padding-bottom: 4px;
}

.cat-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition), background var(--transition),
                border-color var(--transition), transform var(--transition);
    font-family: inherit;
}

.cat-btn:hover {
    color: var(--text);
    background: var(--bg-elevated);
    border-color: rgba(88, 101, 242, 0.4);
}

.cat-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.cat-btn .cat-icon { font-size: 14px; }

/* â”€â”€ Loading â”€â”€ */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 380px;
    animation: fadeIn 0.3s ease;
}

.loading-card { text-align: center; }

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    margin: 0 auto 14px;
}

.spinner-small {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    margin: 0 auto 10px;
}

.loading-card p {
    font-size: 13px;
    color: var(--text-muted);
}

/* â”€â”€ Error / Empty â”€â”€ */
.error {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 380px;
    animation: fadeIn 0.3s ease;
}

.error-card {
    text-align: center;
    padding: 40px 24px;
}

.error-icon { font-size: 52px; margin-bottom: 16px; opacity: 0.35; display: block; }
.empty-icon { font-size: 52px; margin-bottom: 16px; opacity: 0.35; display: block; }
.error-icon i, .empty-icon i { font-size: 52px; opacity: 0.35; }

.error-card h3, .empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-card p, .empty-state p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.error-card button {
    background: var(--accent);
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: opacity var(--transition);
}

.error-card button:hover { opacity: 0.85; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

/* â”€â”€ Grid Container â”€â”€ */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 16px;
    animation: fadeUp 0.35s ease both;
}

.anime-grid.home-view {
    display: block;
    animation: fadeIn 0.35s ease both;
}

/* â”€â”€ Home Section â”€â”€ */
.home-section {
    margin-bottom: 44px;
    animation: fadeUp 0.35s ease both;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 48px;
    height: 2px;
    background: var(--accent);
    border-radius: var(--radius-pill);
}

.section-header h2 {
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 9px;
    letter-spacing: -0.2px;
}

.section-header h2 i {
    color: var(--accent);
    font-size: 16px;
}

.section-count, .section-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
}

.view-all-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--accent);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    font-family: inherit;
}

.view-all-btn:hover {
    background: var(--accent);
    color: #fff;
}

/* â”€â”€ Horizontal Card Grid â”€â”€ */
.horizontal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
}

/* Staggered entrance */
.horizontal-grid .horizontal-card { animation: fadeUp 0.3s ease both; }
.horizontal-grid .horizontal-card:nth-child(1)   { animation-delay: 0.03s; }
.horizontal-grid .horizontal-card:nth-child(2)   { animation-delay: 0.06s; }
.horizontal-grid .horizontal-card:nth-child(3)   { animation-delay: 0.09s; }
.horizontal-grid .horizontal-card:nth-child(4)   { animation-delay: 0.12s; }
.horizontal-grid .horizontal-card:nth-child(5)   { animation-delay: 0.15s; }
.horizontal-grid .horizontal-card:nth-child(6)   { animation-delay: 0.18s; }
.horizontal-grid .horizontal-card:nth-child(7)   { animation-delay: 0.21s; }
.horizontal-grid .horizontal-card:nth-child(8)   { animation-delay: 0.24s; }
.horizontal-grid .horizontal-card:nth-child(n+9) { animation-delay: 0.27s; }

/* â”€â”€ Cards â”€â”€ */
.horizontal-card, .anime-card {
    width: 100%;
    cursor: pointer;
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition),
                border-color var(--transition);
    position: relative;
}

.horizontal-card:hover, .anime-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(88, 101, 242, 0.3);
}

.horizontal-card:active, .anime-card:active {
    transform: translateY(-2px);
}

.horizontal-card img, .anime-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    background: linear-gradient(
        90deg,
        var(--bg-elevated) 0%,
        rgba(255,255,255,0.04) 50%,
        var(--bg-elevated) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s ease infinite;
}

.horizontal-card img[src],
.anime-card img[src] {
    animation: none;
    background: none;
}

.horizontal-card-info, .anime-card-info {
    padding: 9px 10px 10px;
}

.horizontal-card-info h4, .anime-card h3 {
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
}

.episode-count, .anime-episode {
    font-size: 10px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.9;
}

.episode-count i, .anime-episode i { font-size: 9px; }

/* â”€â”€ Badges â”€â”€ */
.badge, .meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: 600;
}

.badge-type, .meta-badge {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(88, 101, 242, 0.2);
}

.badge-status {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-status.completed {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-episode {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.anime-card-badge, .horizontal-card-badge {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.horizontal-card-badge .badge { font-size: 9px; padding: 2px 6px; }

/* â”€â”€ Pagination â”€â”€ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.page-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    color: var(--text);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition),
                transform var(--transition);
    font-family: inherit;
}

.page-btn:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.page-btn i { margin: 0 2px; }

.page-info {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-elevated);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
}

/* â”€â”€ Rec Pagination â”€â”€ */
.rec-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.rec-page-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    font-family: inherit;
}

.rec-page-btn:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
}

.rec-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.rec-page-info {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 80px;
    text-align: center;
}

/* â”€â”€ Schedule â”€â”€ */
.schedule-day { margin-bottom: 36px; }

.schedule-day h3 {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid rgba(88, 101, 242, 0.25);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    margin-bottom: 14px;
}

.schedule-day h3 i { font-size: 10px; }
.schedule-section .section-header { margin-bottom: 28px; }

/* â”€â”€ Detail Page â”€â”€ */
#animeDetail { padding: 20px 20px 8px; }

.anime-detail {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.anime-detail-img {
    width: 165px;
    flex-shrink: 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.anime-detail-img img { width: 100%; height: auto; display: block; }

.anime-detail-info { flex: 1; min-width: 0; }

.anime-detail-info h2 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.anime-detail-info p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.5;
}

.detail-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.synopsis-container {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.synopsis-container strong {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.synopsis {
    margin-top: 8px;
    line-height: 1.7;
    font-size: 13px;
    opacity: 0.85;
    max-height: 140px;
    overflow-y: auto;
    padding-right: 8px;
}

.synopsis::-webkit-scrollbar { width: 3px; }
.synopsis::-webkit-scrollbar-thumb { background: var(--accent); }

/* â”€â”€ Episode List â”€â”€ */
.episode-container {
    padding: 16px 20px 20px;
    border-top: 1px solid var(--border);
}

.episode-container h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.episode-container h3 i { color: var(--accent); }

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

.episode-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 9px 6px;
    border-radius: 10px;
    color: var(--text);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition),
                transform var(--transition);
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.episode-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.03);
    color: #fff;
}

.episode-btn i { font-size: 10px; }

/* â”€â”€ Modal â”€â”€ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 1000;
    overflow-y: auto;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}

.modal-content {
    max-width: 820px;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease both;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    justify-content: flex-end;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.modal-close {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 18px;
    color: var(--text);
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255,255,255,0.12);
    transform: rotate(90deg);
}

/* â”€â”€ Toast â”€â”€ */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 11px 22px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    z-index: 2000;
    animation: slideUp 0.28s ease;
    white-space: nowrap;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(12px);
}

/* â”€â”€ Utility Buttons â”€â”€ */
.back-btn,
.back-btn-home,
.refresh-btn,
.close-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--accent);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    margin: 6px;
    transition: opacity var(--transition), transform var(--transition);
    font-family: inherit;
}

.back-btn { margin-bottom: 20px; }

.back-btn:hover,
.back-btn-home:hover,
.refresh-btn:hover,
.close-modal-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* â”€â”€ Download â”€â”€ */
.download-section {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.download-section h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.download-links, .download-links-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
}

.download-link {
    background: var(--accent);
    color: #fff;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: opacity var(--transition), transform var(--transition);
}

.download-link:hover { opacity: 0.85; transform: translateY(-1px); }

/* â”€â”€ Video Player â”€â”€ */
.video-modal .modal-content {
    max-width: 1000px;
    background: #000;
    border-color: transparent;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.video-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #000;
    z-index: 10;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

/* â”€â”€ Info Message â”€â”€ */
.info-message {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.info-message i {
    font-size: 44px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* â”€â”€ Scroll containers â”€â”€ */
.horizontal-scroll-wrapper { position: relative; margin-bottom: 20px; }
.horizontal-scroll { display: flex; align-items: center; gap: 10px; }
.scroll-container {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 14px;
    padding: 8px 4px 14px;
    scrollbar-width: thin;
    flex: 1;
}

.scroll-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), transform var(--transition);
    flex-shrink: 0;
}

.scroll-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.05);
}

.scroll-btn i { font-size: 15px; color: var(--text); }

/* â”€â”€ Light Theme â”€â”€ */
body.light-theme {
    --bg:           #f4f4f8;
    --bg-card:      #ffffff;
    --bg-elevated:  #eeeef5;
    --text:         #111118;
    --text-muted:   rgba(17, 17, 24, 0.5);
    --border:       rgba(0, 0, 0, 0.09);
    --shadow-card:  0 4px 16px rgba(0,0,0,0.1);
    --shadow-hover: 0 10px 28px rgba(0,0,0,0.18);
}

body.light-theme .anime-card,
body.light-theme .horizontal-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* â”€â”€ Misc icon spacing normalization â”€â”€ */
button i, .badge i, .meta-badge i { margin-right: 0; }
.section-header h2 i { margin-right: 0; }
.back-btn i, .back-btn-home i { margin-right: 0; }
.page-btn i { margin: 0; }
.detail-meta .meta-badge i { margin-right: 3px; }
.logo-icon i { animation: logoPulse 3s ease-in-out infinite; }

/* ============================================
   RESPONSIVE
   ============================================ */

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

@media (max-width: 768px) {
    .app { padding: 16px 16px 50px; }

    .horizontal-grid {
        grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
        gap: 12px;
    }

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

    .section-header h2 { font-size: 16px; }
    .home-section { margin-bottom: 36px; }
    .anime-detail-img { width: 140px; }
    .anime-detail-info h2 { font-size: 17px; }
}

@media (max-width: 640px) {
    .app { padding: 14px 14px 50px; }
    .header { margin-bottom: 18px; padding-bottom: 16px; }
    .logo-text h1 { font-size: 18px; }

    .horizontal-grid {
        grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
        gap: 10px;
    }

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

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .section-header::after { display: none; }

    .horizontal-card-info, .anime-card-info { padding: 7px 8px 8px; }
    .horizontal-card-info h4, .anime-card h3 { font-size: 10.5px; }
    .cat-btn { padding: 8px 14px; font-size: 12px; }

    .anime-detail { flex-direction: column; align-items: center; text-align: center; }
    .anime-detail-img { width: 140px; }
    .episode-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    .modal-content { border-radius: 16px; }
    .toast { white-space: normal; text-align: center; max-width: 82%; font-size: 12px; }
    .pagination { gap: 8px; }
    .page-btn { padding: 9px 16px; font-size: 12px; }
}

@media (max-width: 400px) {
    .horizontal-grid {
        grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
        gap: 8px;
    }

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

    .horizontal-card-info h4, .anime-card h3 { font-size: 10px; }
    .episode-count, .anime-episode { font-size: 9px; }
}

/* ============================================
   FULLSCREEN BUTTON - DI BAWAH VIDEO
   ============================================ */

/* Container untuk tombol-tombol di bawah video */
.video-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Tombol Fullscreen */
.fullscreen-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
    font-family: 'Inter', -apple-system, sans-serif;
}

.fullscreen-btn i {
    font-size: 16px;
    margin-right: 6px;
}

.fullscreen-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #4752c4 0%, #3b45a8 100%);
    box-shadow: 0 6px 16px rgba(88, 101, 242, 0.5);
}

.fullscreen-btn:active {
    transform: translateY(1px);
}

/* Tombol Buka di Browser */
.browser-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    font-family: 'Inter', -apple-system, sans-serif;
}

.browser-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.5);
}

.browser-btn:active {
    transform: translateY(1px);
}

.browser-btn i {
    font-size: 16px;
    margin-right: 6px;
}

/* Info box (opsional) */
.fullscreen-info {
    background: rgba(88, 101, 242, 0.1);
    border-left: 4px solid #5865f2;
    border-radius: 12px;
    padding: 12px 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.fullscreen-info i {
    font-size: 18px;
    color: #5865f2;
    flex-shrink: 0;
}

.fullscreen-info span {
    flex: 1;
    line-height: 1.4;
    opacity: 0.85;
}

/* Responsive Mobile */
@media (max-width: 640px) {
    .fullscreen-btn, .browser-btn {
        padding: 10px 20px;
        font-size: 12px;
    }
    
    .fullscreen-btn i, .browser-btn i {
        font-size: 14px;
    }
    
    .video-actions {
        gap: 12px;
        margin-top: 16px;
    }
}