:root {
    --bg-color: #f8fafc;
    --sidebar-bg: #ffffff;
    --accent-color: #4f46e5;
    --secondary-color: #ec4899;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.08);
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Background animated elements */
.bg-blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 60%);
    filter: blur(100px);
    opacity: 0.1;
    z-index: -1;
    animation: move 25s infinite alternate;
}
.bg-blob-2 {
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary-color) 0%, transparent 60%);
    filter: blur(100px);
    opacity: 0.08;
    z-index: -1;
    animation: move 20s infinite alternate-reverse;
}
@keyframes move {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(150px, 150px) scale(1.1); }
}

/* Sidebar styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--glass-border);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar .brand {
    font-size: 1.7rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--accent-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.3rem; /* Tighter gap */
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem; /* Tighter padding */
    border-radius: 0.6rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    transition: all 0.2s ease;
}
.nav-item:hover { background: rgba(0, 0, 0, 0.03); color: var(--text-color); }
.nav-item.active { background: rgba(99, 102, 241, 0.1); color: var(--accent-color); border: 1px solid rgba(99, 102, 241, 0.2); }
.nav-item.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.sidebar-footer {
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.ad-sidebar-box {
    margin-bottom: 1.5rem;
    width: 100%;
    height: 150px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Main Content styling */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden; /* Fix horizontal scrollbar */
    position: relative;
}
.top-bar {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--page-theme-gradient, linear-gradient(135deg, var(--accent-color), var(--secondary-color)));
    display: flex;
    align-items: center;
    z-index: 20;
    position: sticky;
    top: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); /* Elegant shadow */
}
.top-bar-title {
    margin-left: 1rem;
    font-weight: 800;
    font-size: 1.15rem;
    color: #ffffff; /* White for strong contrast */
    letter-spacing: -0.5px;
}
.menu-toggle {
    display: flex;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #ffffff; /* White for header contrast */
    padding: 0.4rem;
    border-radius: 0.4rem;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.menu-toggle:hover { background: rgba(255,255,255,0.2); }

.main-content-inner {
    padding: 1.5rem 2rem; /* Reduced top padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1;
}
.content-wrapper {
    display: flex;
    gap: 2rem;
    width: 100%;
    max-width: 1100px;
    justify-content: center;
    align-items: flex-start;
}
.container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 2.5rem 3rem; /* Tighter padding */
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    flex: 1;
    max-width: 900px;
    width: 100%;
    animation: fadeIn 0.8s ease-out;
}
.ad-side-banner {
    width: 160px;
    height: 500px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
    position: sticky;
    top: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

/* Tabs UI */
.tabs-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: #f1f5f9;
    padding: 0.4rem;
    border-radius: 0.75rem;
    width: fit-content;
}
.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.3s;
}
.tab-btn:hover { color: var(--text-color); }
.tab-btn.active {
    background: #ffffff;
    color: var(--accent-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Batch List UI */
.batch-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.batch-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.batch-thumb-wrapper {
    width: 140px;
    height: 140px;
    border-radius: 0.6rem;
    background: #f8fafc;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.batch-thumb { max-width: 100%; max-height: 100%; object-fit: contain; }
.batch-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    overflow: hidden;
}
.batch-name { font-size: 0.9rem; font-weight: 700; color: var(--text-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-status { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.status-done { color: #10b981; }
.status-error { color: #ef4444; }

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

/* Desktop specific behavior */
@media (min-width: 769px) {
    .sidebar.collapsed { margin-left: calc(-1 * var(--sidebar-width)); }
}

/* Mobile Responsive Design */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (max-width: 1050px) {
    .ad-side-banner { display: none !important; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 100;
    }
    .sidebar.open { left: 0; }
    .sidebar-overlay.open { display: block; opacity: 1; z-index: 50; }
    .main-content-inner { padding: 1.5rem 1rem; }
    .top-bar { padding: 0.75rem 1.25rem; }
    .container { padding: 2rem 1.5rem; }
    h1 { font-size: 2rem; }
}
