@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* VibedAI Inspired Palette */
    --primary: #e94d89; /* VibedAI Pink */
    --primary-hover: #d13d76;
    --bg-main: #fcfaf7; /* Soft Cream */
    --bg-card: #ffffff;
    --text-main: #1a1d2d;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }

body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-main); 
    color: var(--text-main); 
    margin: 0; 
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 40px 20px; 
}

/* --- TAB LOGIC (CRITICAL FIX) --- */
.tab-content { 
    display: none; /* Hide everything by default */
}
.tab-content.active { 
    display: block; /* Show only active tab */
    animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- HEADER --- */
.top-nav { 
    background: white; 
    border-bottom: 1px solid var(--border); 
    padding: 12px 0; 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
}
.nav-container { 
    display: flex; justify-content: space-between; align-items: center; 
    max-width: 1200px; margin: 0 auto; padding: 0 20px; 
}
.logo { font-weight: 800; font-size: 1.4rem; color: var(--text-main); letter-spacing: -0.5px; }

/* --- TAB BUTTONS --- */
.tabs { display: flex; gap: 8px; }
.tab-btn { 
    background: transparent; color: var(--text-main); 
    border: none; padding: 10px 20px; border-radius: 50px;
    font-weight: 600; cursor: pointer; transition: 0.2s; font-size: 0.9rem;
}
.tab-btn:hover { background: #f3f4f6; }
.tab-btn.active { background: var(--text-main); color: white; }
.tab-btn.btn-danger { color: var(--danger); }
.tab-btn.btn-danger:hover { background: #fee2e2; }

/* --- CARDS & SECTIONS --- */
.card { 
    background: var(--bg-card); border-radius: 24px; padding: 32px; 
    border: 1px solid var(--border); box-shadow: var(--shadow); margin-bottom: 24px;
}
h3 { margin-top: 0; font-size: 1.25rem; font-weight: 700; color: var(--text-main); }
.subtitle { color: var(--text-muted); font-size: 0.9rem; margin-top: -10px; margin-bottom: 25px; }

/* --- BUTTONS --- */
button { font-family: inherit; cursor: pointer; transition: 0.2s; }

.btn-primary { 
    background: var(--primary); color: white; font-weight: 700;
    padding: 14px 28px; border-radius: 12px; border: none; font-size: 1rem;
    box-shadow: 0 4px 14px 0 rgba(233, 77, 137, 0.3);
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-secondary { 
    background: #f3f4f6; color: var(--text-main); font-weight: 600;
    padding: 10px 20px; border-radius: 10px; border: 1px solid var(--border);
}
.btn-secondary:hover { background: #e5e7eb; }

.btn-danger { 
    background: #fee2e2; color: var(--danger); font-weight: 700;
    padding: 5px 12px; border-radius: 8px; border: none;
}

.btn-large { width: 100%; display: block; }

/* --- FORM INPUTS --- */
.modern-input { 
    background: white; border: 1px solid var(--border); 
    color: var(--text-main); padding: 14px 18px; border-radius: 12px; 
    width: 100%; box-sizing: border-box; font-size: 1rem; transition: border-color 0.2s;
}
.modern-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(233, 77, 137, 0.1); }
.code-input { font-family: 'Menlo', 'Monaco', monospace; font-size: 0.85rem; background: #f9fafb; }

/* --- DISCOVERY LAYOUT --- */
.main-layout { display: grid; grid-template-columns: 280px 1fr; gap: 30px; margin-top: 30px; }
.sidebar { 
    background: white; border-radius: 24px; padding: 25px; 
    border: 1px solid var(--border); box-shadow: var(--shadow); height: fit-content;
}
.source-item {
    padding: 12px 15px; border-radius: 12px; margin-bottom: 8px;
    background: #f9fafb; font-size: 0.9rem; font-weight: 500; transition: 0.2s;
}
.source-item:hover { background: white; border-color: var(--primary); color: var(--primary); }

.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.manga-card { 
    background: white; border-radius: 20px; overflow: hidden; 
    border: 1px solid var(--border); transition: 0.3s; box-shadow: var(--shadow);
}
.manga-card:hover { transform: translateY(-5px); border-color: var(--primary); }
.manga-card img { width: 100%; height: 240px; object-fit: cover; }
.manga-info { padding: 15px; }

/* --- TABLES --- */
.table-container { background: white; border-radius: 20px; border: 1px solid var(--border); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { padding: 18px; text-align: left; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; background: #f9fafb; }
td { padding: 18px; border-bottom: 1px solid var(--border); font-size: 0.95rem; }

/* --- TERMINAL --- */
.terminal { background: #1a1d2d; border-radius: 24px; overflow: hidden; margin-top: 20px; }
.terminal-header { background: #24283b; padding: 12px 20px; color: #94a3b8; font-size: 0.7rem; font-weight: 700; }
.terminal pre { margin: 0; padding: 20px; color: #10b981; height: 180px; overflow-y: auto; font-family: monospace; }

/* --- MODAL --- */
.modal { 
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(26, 29, 45, 0.4); backdrop-filter: blur(8px); z-index: 2000; 
    align-items: center; justify-content: center; padding: 20px;
}
.modal-content { 
    background: white; width: 100%; max-width: 480px; 
    padding: 40px; border-radius: 30px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.2);
}

/* --- LOGIN SCREEN --- */
.login-container { display: flex; align-items: center; justify-content: center; min-height: 90vh; }
.login-card { width: 100%; max-width: 400px; text-align: center; }

@media (max-width: 850px) {
    .main-layout { grid-template-columns: 1fr; }
    .nav-container { flex-direction: column; gap: 15px; }
}