* {
    font-display: swap;
}

:root {
    --bg-main: #0b0c15;
    --bg-card: #151820;
    --bg-input: #0f1115;
    --accent: #5b68f6;
    --accent-hover: #4853c4;
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --border: #27272a;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --scroll-thumb: #3f3f46;
}
[data-theme="light"] {
    --bg-main: #f0f2f5;
    --bg-card: #ffffff;
    --bg-input: #f3f4f6;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --text-main: #111827;
    --text-muted: #4b5563;
    --border: #e5e7eb;
    --success: #059669;
    --error: #dc2626;
    --warning: #d97706;
    --scroll-thumb: #d1d5db;
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-main); color: var(--text-main); overflow-x: hidden; line-height: 1.6; transition: background-color 0.3s, color 0.3s; }

.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50; 
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; }
.logo-icon { width: 35px; height: 35px; background: var(--accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-btn { 
    background: var(--bg-input); 
    border: 1px solid var(--border); 
    color: var(--text-muted); 
    width: 35px; height: 35px; 
    border-radius: 8px; 
    cursor: pointer; 
    display: flex; align-items: center; justify-content: center; 
    transition: all 0.2s ease; 
    font-size: 1rem; 
}
.theme-btn:hover { background: var(--bg-card); color: var(--accent); border-color: var(--accent); }
.menu-btn { background: none; border: none; color: var(--text-main); font-size: 1.4rem; cursor: pointer; padding: 5px; }

.sidebar-overlay { 
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 90; 
    opacity: 0; visibility: hidden; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    backdrop-filter: blur(4px);
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }
.sidebar { 
    position: fixed; top: 0; right: 0; width: 280px; height: 100vh; 
    background: var(--bg-card); border-left: 1px solid var(--border); 
    z-index: 100; transform: translateX(100%); 
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column; 
    box-shadow: -5px 0 25px rgba(0,0,0,0.5);
}
.sidebar.active { transform: translateX(0); }
.sidebar-header { padding: 25px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.close-sidebar-btn { background: none; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; transition: 0.2s; }
.close-sidebar-btn:hover { color: var(--text-main); transform: rotate(90deg); }
.sidebar-links { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.sidebar-link { text-decoration: none; color: var(--text-muted); padding: 12px 15px; border-radius: 8px; display: flex; align-items: center; gap: 15px; transition: 0.2s; font-weight: 500; }
.sidebar-link:hover, .sidebar-link.active { background: var(--bg-input); color: var(--text-main); border-left: 3px solid var(--accent); }
.sidebar-link i { width: 20px; text-align: center; }
.divider { height: 1px; background: var(--border); margin: 15px 0; }
.sidebar-subtitle { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px; padding-left: 15px; font-weight: 700; }
.sidebar-footer { padding: 20px; text-align: center; font-size: 0.8rem; color: var(--text-muted); border-top: 1px solid var(--border); background: var(--bg-input); }

.main-container { max-width: 800px; margin: 0 auto; padding: 20px; }
.hero-section { text-align: center; margin: 20px 0 30px; }
.hero-title { font-size: 2.2rem; font-weight: 800; margin-bottom: 10px; background: linear-gradient(to right, var(--text-main), var(--text-muted)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { color: var(--text-muted); font-size: 1rem; margin-bottom: 20px; }
.tool-container { background: var(--bg-card); padding: 20px; border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 4px 20px rgba(0,0,0,0.05); transition: background-color 0.3s, border-color 0.3s; }

.mode-switcher { display: flex; justify-content: center; gap: 10px; margin-bottom: 15px; background: var(--bg-input); padding: 5px; border-radius: 50px; width: fit-content; margin-left: auto; margin-right: auto; border: 1px solid var(--border); }
.mode-btn { background: transparent; border: none; color: var(--text-muted); padding: 8px 20px; border-radius: 50px; cursor: pointer; font-weight: 600; transition: 0.3s; display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.mode-btn.active { background: var(--accent); color: white; box-shadow: 0 2px 10px rgba(91, 104, 246, 0.3); }
.mode-btn:hover:not(.active) { color: var(--text-main); }
textarea { width: 100%; height: 120px; background: var(--bg-input); border: 1px solid var(--border); color: var(--text-main); padding: 15px; border-radius: 10px; resize: none; outline: none; font-size: 1rem; transition: 0.2s; }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(91, 104, 246, 0.2); }
.controls-wrapper { margin-top: 20px; display: flex; flex-direction: column; gap: 15px; }

.toggle-container { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; width: fit-content; margin: 0 auto; transition: 0.3s; }
.toggle-container.hidden { display: none !important; }
.toggle-container input { display: none; }
.toggle-slider { width: 44px; height: 24px; background-color: var(--bg-input); border: 1px solid var(--border); border-radius: 34px; position: relative; transition: .3s; }
.toggle-slider:before { content: ""; position: absolute; height: 18px; width: 18px; left: 2px; bottom: 2px; background-color: var(--text-muted); border-radius: 50%; transition: .3s; }
.toggle-container input:checked + .toggle-slider { background-color: var(--accent); border-color: var(--accent); }
.toggle-container input:checked + .toggle-slider:before { transform: translateX(20px); background-color: white; }
.toggle-label { font-size: 0.95rem; color: var(--text-main); font-weight: 500; }

.status-dropdown { width: 100%; background: var(--bg-input); border: 1px solid var(--border); color: var(--text-main); padding: 14px; border-radius: 10px; font-size: 1rem; cursor: pointer; outline: none; transition: 0.2s; appearance: none; }
.status-dropdown:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(91, 104, 246, 0.2); }
.btn-primary { background: var(--accent); color: white; border: none; padding: 14px; border-radius: 10px; font-weight: 600; cursor: pointer; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; transition: 0.2s; font-size: 1rem; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }

.status-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; min-height: 40px; }
.toast { 
    background: var(--bg-card); 
    padding: 8px 16px; 
    border-radius: 50px; 
    border: 1px solid var(--border); 
    color: var(--text-muted); 
    font-size: 0.85rem; 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    transition: 0.3s;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; 
}
.toast.hidden { opacity: 0; visibility: hidden; }
#toast-msg {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-text { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; transition: 0.2s; margin-left: auto; flex-shrink: 0; }
.btn-text:hover { color: var(--accent); }

.results-section { animation: fadeIn 0.5s; }
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding: 0 5px; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.badge { background: var(--bg-card); padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; border: 1px solid var(--border); color: var(--accent); font-weight: 600; }
.btn-stop-header, .btn-clear { 
    background: rgba(239, 68, 68, 0.1); 
    border: 1px solid var(--error); 
    color: var(--error); 
    width: 32px; height: 32px; 
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.2s; 
    display: flex; align-items: center; justify-content: center;
}
.btn-stop-header:hover, .btn-clear:hover { background: var(--error); color: white; }

.scroll-box-wrapper { background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px; height: 450px; overflow: hidden; position: relative; }
.anime-scroll-list { height: 100%; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.anime-scroll-list::-webkit-scrollbar { width: 6px; }
.anime-scroll-list::-webkit-scrollbar-track { background: var(--bg-input); }
.anime-scroll-list::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 10px; }
.empty-placeholder { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); opacity: 0.5; text-align: center; }
.empty-placeholder i { font-size: 3rem; margin-bottom: 15px; color: var(--text-muted); }
.empty-placeholder p { font-size: 1rem; font-weight: 600; }

.anime-card { 
    background: var(--bg-card); 
    padding: 12px; 
    border-radius: 10px; 
    display: flex; 
    gap: 15px; 
    align-items: flex-start; 
    border: 1px solid var(--border); 
    animation: slideIn 0.3s ease; 
    flex-shrink: 0; 
    transition: all 0.2s; 
    cursor: default; 
}
.anime-card:hover { 
    border-color: var(--accent); 
    transform: translateY(-2px); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.anime-card img { width: 70px; height: 105px; object-fit: cover; border-radius: 6px; flex-shrink: 0; transition: transform 0.2s; }
.anime-card img:hover { transform: scale(1.05); }

.card-info { 
    flex-grow: 1; 
    min-width: 0; 
    display: flex; 
    flex-direction: column; 
    gap: 8px;
} 

.card-text-group { 
    display: flex; 
    flex-direction: column;
}
.card-title-main { font-size: 1rem; font-weight: 600; color: var(--text-main); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; line-height: 1.2; }
.card-title-sub { font-size: 0.8rem; color: var(--text-muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.card-meta { 
    font-size: 0.8rem; 
    color: var(--text-muted); 
    display: flex; 
    gap: 8px; 
    align-items: center; 
    flex-wrap: wrap;
}
.card-tag { background: var(--bg-input); padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; border: 1px solid var(--border); }
.status-badge { 
    padding: 1px 5px; 
    border-radius: 4px; 
    font-size: 0.65rem; 
    font-weight: bold; 
    border: 1px solid; 
    white-space: nowrap;
    display: inline-block;
}

.controls-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto; 
}

.status-group {
    display: flex;
    gap: 2px;
    background: var(--bg-input);
    padding: 2px 4px;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.status-btn {
    width: 24px; 
    height: 24px;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.1s;
}
.status-btn:hover { background: rgba(91, 104, 246, 0.2); color: var(--accent); }
.status-btn.active { background: var(--accent); color: white; }

.action-group { display: flex; gap: 5px; }
.action-btn { 
    background: var(--bg-input); 
    border: 1px solid var(--border); 
    color: var(--text-muted); 
    width: 28px; height: 28px; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: 0.2s; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 0.85rem;
}
.action-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.action-btn.btn-del:hover { background: var(--error); border-color: var(--error); }
.btn-pre i { color: #f59e0b; }
.btn-seq i { color: #8b5cf6; }
.btn-del i { color: #ef4444; }

.controls-row-2 {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--border); 
    flex-wrap: nowrap;
    overflow-x: auto; 
}
.star-icon { color: var(--warning); font-size: 0.9rem; margin-right: 2px; }

.rating-btn {
    flex: 1; 
    height: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    background: var(--bg-input);
    color: var(--text-muted);
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.1s;
    min-width: 20px;
    border: 1px solid transparent;
}
.rating-btn:hover { background: rgba(245, 158, 11, 0.2); color: var(--warning); border-color: rgba(245, 158, 11, 0.3); }
.rating-btn.active { background: var(--warning); color: #000; font-weight: 800; }


.guide-section { margin-top: 60px; display: flex; flex-direction: column; gap: 20px; }
.section-title { font-size: 1.5rem; margin-bottom: 10px; color: var(--text-main); justify-content: center; display: flex; }
.guide-card { background: var(--bg-card); padding: 25px; border-radius: 16px; border: 1px solid var(--border); display: flex; gap: 20px; align-items: flex-start; transition: transform 0.2s; }
.guide-card.hidden { display: none !important; }
.guide-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.step-number { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; flex-shrink: 0; opacity: 0.8; }
.guide-content h3 { font-size: 1.1rem; margin-bottom: 10px; color: var(--text-main); }
.guide-content p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 10px; }
.code-block { background: #000; padding: 10px; border-radius: 6px; font-family: monospace; font-size: 0.9rem; color: var(--warning); border: 1px solid var(--border); margin: 10px 0; }
.guide-content a { color: var(--accent); text-decoration: none; font-weight: 600; }
.guide-content a:hover { text-decoration: underline; }

footer { text-align: center; margin-top: 50px; padding: 30px; border-top: 1px solid var(--border); color: var(--text-muted); }
footer a { color: var(--accent); text-decoration: none; font-weight: 600; }
.footer-note { font-size: 0.8rem; opacity: 0.6; margin-top: 5px; }
.hidden { display: none; }
.btn-success { background: var(--success); color: white; border: none; padding: 14px; width: 100%; border-radius: 10px; font-weight: bold; cursor: pointer; display: flex; justify-content: center; gap: 8px; font-size: 1rem; margin-top: 20px; }
.btn-success:hover { background: #059669; }

.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 200; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal-content { background: var(--bg-card); width: 90%; max-width: 450px; border-radius: 16px; border: 1px solid var(--border); padding-bottom: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.modal-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; color: var(--text-main); }
.switch-list { max-height: 60vh; overflow-y: auto; padding: 10px; }
.switch-item { display: flex; gap: 15px; padding: 12px; cursor: pointer; border-radius: 8px; border-bottom: 1px solid var(--border); }
.switch-item:hover { background: var(--bg-input); }
.switch-item img { width: 45px; height: 65px; object-fit: cover; border-radius: 4px; }

.close-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px; height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}
.close-btn:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.floating-progress {
    position: fixed;
    bottom: 20px; right: 20px; width: 320px;
    background: var(--bg-card); padding: 15px; border-radius: 12px;
    border: 1px solid var(--border); box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    z-index: 2000; animation: slideUp 0.4s ease-out;
}
.progress-info { 
    display: flex; 
    justify-content: space-between; 
    font-size: 0.9rem; 
    color: var(--text-main); 
    margin-bottom: 8px; 
    font-weight: 500;
    width: 100%;
}
#progress-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 75%;
    display: block;
}
.progress-track { width: 100%; height: 8px; background: var(--bg-input); border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width 0.3s ease; border-radius: 10px; }

@keyframes slideUp { from { transform: translateY(50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.home-hero { padding: 80px 0 60px; text-align: center; background: radial-gradient(circle at top, rgba(91, 104, 246, 0.15), transparent 70%); }
.badge-pill { background: rgba(91, 104, 246, 0.1); color: var(--accent); border: 1px solid var(--accent); padding: 6px 16px; border-radius: 50px; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; display: inline-block; margin-bottom: 20px; }
.hero-title-large { font-size: 3.5rem; font-weight: 800; line-height: 1.1; margin-bottom: 20px; color: var(--text-main); }
.text-gradient { background: linear-gradient(90deg, var(--accent), #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub-text { font-size: 1.1rem; color: var(--text-muted); max-width: 600px; margin: 0 auto 40px; }
.hero-buttons { display: flex; justify-content: center; gap: 15px; }
.btn-cta { width: auto; padding: 14px 30px; font-size: 1.1rem; }
.btn-secondary { padding: 14px 30px; border-radius: 10px; font-weight: 600; color: var(--text-main); background: var(--bg-card); border: 1px solid var(--border); text-decoration: none; transition: 0.2s; }
.btn-secondary:hover { border-color: var(--text-muted); }

.platforms-section { padding: 40px 0; border-bottom: 1px solid var(--border); background: var(--bg-input); }
.section-label { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 25px; font-weight: 500; }
.platform-grid { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; }
.platform-card { background: var(--bg-card); border: 1px solid var(--border); padding: 15px 25px; border-radius: 12px; display: flex; align-items: center; gap: 15px; position: relative; min-width: 160px; justify-content: center; }
.platform-card img { height: 25px; opacity: 0.8; filter: grayscale(100%); transition: 0.3s; }
.platform-card.active { border-color: var(--accent); box-shadow: 0 4px 20px rgba(91, 104, 246, 0.1); }
.platform-card.active img { filter: grayscale(0%); opacity: 1; }
.status-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; box-shadow: 0 0 8px var(--success); }
.coming-soon-badge { position: absolute; top: -8px; right: -5px; background: var(--bg-input); border: 1px solid var(--border); font-size: 0.6rem; padding: 2px 6px; border-radius: 4px; color: var(--text-muted); }
.text-logo { font-weight: 900; color: var(--text-muted); font-size: 1.2rem; }

.features-section { padding: 80px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.feature-card { background: var(--bg-card); padding: 30px; border-radius: 16px; border: 1px solid var(--border); transition: 0.3s; }
.feature-card:hover { transform: translateY(-5px); border-color: var(--accent); }
.icon-box { width: 50px; height: 50px; background: var(--bg-input); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 1.5rem; margin-bottom: 20px; }
.feature-card h3 { margin-bottom: 10px; font-size: 1.2rem; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

.info-section { padding: 60px 0; background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.info-content { max-width: 700px; margin: 0 auto; text-align: center; }
.info-content h2 { font-size: 1.8rem; margin-bottom: 20px; }
.info-content p { color: var(--text-muted); line-height: 1.7; }

.footer-content { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; flex-wrap: wrap; gap: 20px; }
.footer-brand h4 { font-size: 1.5rem; font-weight: 700; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-muted); transition: 0.2s; }
.footer-links a:hover { color: var(--accent); }
.copyright { text-align: center; color: var(--text-muted); font-size: 0.8rem; opacity: 0.6; border-top: 1px solid var(--border); padding-top: 20px; }

.status-badge.status-upcoming { color: var(--warning); border-color: var(--warning); }
.status-badge.status-ongoing { color: var(--success); border-color: var(--success); }

@media (max-width: 768px) {
    .hero-title-large { font-size: 2.2rem; }
    .hero-buttons { flex-direction: column; }
    .btn-cta, .btn-secondary { width: 100%; text-align: center; }
    .footer-content { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .main-container { padding: 10px; }
    .navbar { padding: 10px 15px; }
    .hero-title { font-size: 1.8rem; }
    .anime-card { flex-wrap: wrap; }
    
    .controls-row-1 {
        flex-direction: row; 
        justify-content: space-between;
    }
}
