/*
Theme Name: LoLLMs Nexus
Theme URI: https://lollms.com
Author: ParisNeo
Description: The official interface for the LoLLMs Network.
Version: 3.0.0
*/

/* --- 1. VARIABLES (The DNA) --- */
:root {
    --bg-deep: #020617;      /* The Void */
    --bg-panel: #0f172a;     /* The Console */
    --primary: #6366f1;      /* Indigo */
    --accent: #d946ef;       /* Fuchsia */
    --text-main: #f8fafc;    /* White-ish */
    --text-dim: #94a3b8;     /* Grey */
    --border: rgba(148, 163, 184, 0.15);
    --success: #22c55e;
}

/* --- 2. GLOBAL RESET --- */
*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--bg-deep) !important; /* Force Dark Mode */
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }

/* --- 3. LAYOUT UTILITIES --- */
.nexus-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* --- 4. HEADER --- */
.nexus-header {
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding img { height: 40px; width: auto; }
.site-branding .text-logo {
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    color: transparent;
}

.main-nav { display: flex; align-items: center; gap: 25px; }
.nav-link { font-weight: 500; font-size: 0.95rem; color: var(--text-dim); }
.nav-link:hover { color: white; }

/* User Badge */
.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-panel);
    padding: 4px 12px 4px 4px;
    border-radius: 50px;
    border: 1px solid var(--border);
    transition: 0.2s;
}
.user-badge:hover { border-color: var(--primary); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; }

/* --- 5. BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white !important;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
}
.btn-outline:hover { border-color: var(--text-main); color: var(--text-main); }

/* --- 6. HERO SECTION --- */
.hero-section {
    padding: 100px 0;
    text-align: center;
    background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.1), transparent 60%);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-dim);
    max-width: 650px;
    margin: 0 auto 40px;
}

/* Download Button Specifics */
.lollms-dl-wrapper { margin-top: 30px; }
.lollms-version-badge {
    background: rgba(0,0,0,0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 8px;
}

/* --- 7. CARDS (Grid System) --- */
.nexus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.news-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
}
.news-card:hover { border-color: var(--primary); transform: translateY(-4px); }

.card-image { height: 180px; background: #1e293b; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }

.card-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card-meta { font-size: 0.75rem; color: var(--primary); margin-bottom: 8px; text-transform: uppercase; font-weight: 700; }
.card-title { font-size: 1.25rem; margin: 0 0 10px; color: white; line-height: 1.3; }
.card-excerpt { font-size: 0.9rem; color: var(--text-dim); flex-grow: 1; margin-bottom: 20px; }
.read-more { font-size: 0.9rem; font-weight: 600; color: var(--primary); }

/* --- 8. FOOTER --- */
.nexus-footer {
    margin-top: 80px;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* --- MOBILE NAVIGATION --- */
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; color: white; cursor: pointer; }

@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(2, 6, 23, 0.95);
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--border);
    }
    .main-nav.active { display: flex; }
    .hero-title { font-size: 2.5rem; }
}

/* --- APP / TOOLS INTERFACE --- */
.app-container {
    max-width: 600px;
    margin: 40px auto;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    min-height: 500px;
}

.app-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.app-tab {
    flex: 1;
    text-align: center;
    padding: 15px;
    cursor: pointer;
    color: var(--text-dim);
    font-weight: 600;
}
.app-tab.active { color: var(--primary); border-bottom: 2px solid var(--primary); }

.input-group { display: flex; gap: 10px; margin-bottom: 20px; }
.app-input {
    flex: 1;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 8px;
    color: white;
}

.item-list { list-style: none; padding: 0; margin: 0; }
.todo-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    animation: fadeIn 0.3s;
}
.todo-checkbox {
    width: 20px; height: 20px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    margin-right: 15px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.todo-checkbox::after { content: '✓'; color: var(--bg-deep); display: none; font-weight: bold; }
.todo-item.completed .todo-checkbox { background: var(--primary); }
.todo-item.completed .todo-checkbox::after { display: block; }
.todo-item.completed span { text-decoration: line-through; opacity: 0.5; }

/* AI Suggestions */
.ai-suggestions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--border);
}
.suggestion-chip {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 5px;
    cursor: pointer;
    border: 1px solid transparent;
}
.suggestion-chip:hover { border-color: var(--primary); background: rgba(99, 102, 241, 0.2); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.app-container {
    max-width: 600px;
    margin: 40px auto;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    min-height: 600px;
}

.input-row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }

.app-input {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    padding: 12px;
    border-radius: 8px;
    color: white;
    flex-grow: 1;
}

.app-input.qty { max-width: 80px; text-align: center; }
.app-input.price { max-width: 90px; text-align: right; }

.btn-scan { background: #3b82f6; color: white; border: none; padding: 0 15px; border-radius: 8px; cursor: pointer; font-size: 1.2rem; }
.btn-add { background: var(--success); color: white; border: none; padding: 0 20px; border-radius: 8px; cursor: pointer; font-weight: bold; }

/* Item List */
.todo-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    margin-bottom: 5px;
    border-radius: 6px;
}
.todo-checkbox { width: 24px; height: 24px; border: 2px solid var(--primary); border-radius: 50%; margin-right: 12px; cursor: pointer; flex-shrink: 0; }

.item-details { flex-grow: 1; display: flex; flex-direction: column; }
.item-name { font-weight: 500; font-size: 1rem; }
.item-meta { font-size: 0.8rem; color: var(--text-dim); }

/* History Mode */
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); }
.btn-delete { color: #ef4444; cursor: pointer; padding: 5px; font-size: 1.2rem; }
.btn-restore { color: var(--success); cursor: pointer; padding: 5px; font-size: 1.2rem; margin-right: 15px; }

/* SCANNER MODAL */
#scanner-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#reader { width: 100%; max-width: 500px; height: 400px; background: #000; }
.close-scan { margin-top: 20px; background: #ef4444; color: white; padding: 10px 30px; border: none; border-radius: 50px; font-size: 1.1rem; cursor: pointer; }

/*
Theme Name: LoLLMs Nexus
Theme URI: https://lollms.com
Author: ParisNeo
Description: The official interface for the LoLLMs Network.
Version: 3.3.0
*/

/* --- 1. CORE VARIABLES --- */
:root {
    --bg-app: #0f172a;       /* Slate 900 */
    --surface: #1e293b;      /* Slate 800 */
    --surface-glass: rgba(30, 41, 59, 0.7);
    --primary: #6366f1;      /* Indigo 500 */
    --primary-glow: rgba(99, 102, 241, 0.5);
    --accent: #d946ef;       /* Fuchsia 500 */
    --success: #10b981;      /* Emerald 500 */
    --danger: #ef4444;       /* Red 500 */
    --text-main: #f1f5f9;
    --text-dim: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --radius: 16px;
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    background-color: var(--bg-app) !important;
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- 2. LAYOUT & APP CONTAINER --- */
.nexus-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* On Mobile, the App fills the screen */
.app-container {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

@media (max-width: 600px) {
    .nexus-container { padding: 0; }
    .app-container {
        margin: 0;
        border-radius: 0;
        border: none;
        min-height: 100vh; /* Full height */
        padding-bottom: 100px; /* Space for footer */
    }
}

/* --- 3. TABS (Segmented Control) --- */
.app-tabs {
    display: flex;
    background: rgba(0,0,0,0.2);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.app-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
}

.app-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 10px var(--primary-glow);
}

/* --- 4. INPUTS & FORMS --- */
.input-group {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.input-row:last-child { margin-bottom: 0; }

.app-input {
    background: var(--bg-app);
    border: 1px solid var(--border);
    color: white;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 1rem;
    width: 100%;
    transition: 0.2s;
    outline: none;
}
.app-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); }

.app-input.qty { flex: 0 0 70px; text-align: center; }
.app-input.price { flex: 0 0 80px; text-align: right; }

/* Buttons */
.btn-scan {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 10px;
    width: 44px; /* Square button */
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
}
.btn-add {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    padding: 0 20px;
    flex-grow: 1;
    cursor: pointer;
}
.btn-add:active { transform: scale(0.96); }

/* --- 5. ITEM LIST (Cards) --- */
.item-list { list-style: none; padding: 0; margin: 0; }

.todo-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s;
}

.todo-item:active { transform: scale(0.98); background: rgba(255,255,255,0.05); }

/* Checkbox */
.todo-checkbox {
    width: 24px; height: 24px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}
.todo-checkbox::after {
    content: ''; position: absolute; top: 2px; left: 2px; right: 2px; bottom: 2px;
    background: var(--primary); border-radius: 50%;
    transform: scale(0); transition: 0.2s;
}
/* Click animation handled by JS via opacity, but this is future proofing */

.item-details { flex-grow: 1; display: flex; flex-direction: column; overflow: hidden; }
.item-name { font-weight: 500; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-inputs { display: flex; gap: 8px; margin-top: 6px; }

.inline-input {
    background: rgba(0,0,0,0.3);
    border: none;
    color: var(--text-dim);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
}
.inline-input:focus { background: var(--surface); color: white; outline: 1px solid var(--primary); }
.inline-input.price { color: var(--success); }

/* Mini Scan Button */
.scan-mini {
    background: none; border: none; color: var(--text-dim);
    font-size: 1.1rem; padding: 5px; cursor: pointer;
}

/* --- 6. HISTORY LIST --- */
.history-item {
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.btn-icon { background: none; border: none; font-size: 1.2rem; padding: 8px; cursor: pointer; }

/* --- 7. TOTAL FOOTER --- */
.total-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 15px 20px;
    padding-bottom: max(15px, var(--safe-bottom));
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 500;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.3);
}

.total-amount { font-size: 1.5rem; font-weight: 800; color: var(--success); text-shadow: 0 0 20px rgba(16, 185, 129, 0.3); }

/* --- 8. SCANNER MODAL --- */
#scanner-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}
#scanner-header {
    padding: 20px; text-align: center; color: white; font-weight: bold;
    background: rgba(0,0,0,0.5); position: absolute; top: 0; width: 100%; z-index: 2;
}
#reader { width: 100% !important; height: 100% !important; object-fit: cover; }
.close-scan {
    position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
    background: white; color: black; padding: 12px 30px; border-radius: 30px;
    font-weight: bold; border: none; box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    z-index: 2;
}

/* --- 9. GLOBAL NAV (Mobile) --- */
.nexus-header { padding: 10px 0; }
.menu-toggle { font-size: 1.8rem; padding: 5px; }
/* --- LIST MANAGER OVERLAY --- */
.list-manager-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
}

.list-manager-card {
    background: var(--surface);
    border: 1px solid var(--primary);
    padding: 25px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.list-option {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px; border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.list-option:hover { background: rgba(255,255,255,0.05); }
.list-option.active { color: var(--primary); font-weight: bold; }

.manage-actions { display: flex; gap: 10px; margin-top: 20px; }
.btn-secondary { background: var(--surface); border: 1px solid var(--border); color: var(--text-main); padding: 10px; border-radius: 8px; flex: 1; cursor: pointer; text-align: center; }
.btn-secondary:hover { border-color: var(--primary); }

/* Header List Selector */
.current-list-btn {
    background: transparent; border: 1px solid var(--border);
    color: var(--text-main); padding: 5px 15px; border-radius: 20px;
    font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; gap: 5px;
    margin-bottom: 15px; align-self: center;
}
.current-list-btn:hover { border-color: var(--primary); }
/* --- CALENDAR WIDGET --- */
.calendar-wrapper {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
}

.calendar-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 15px;
}

.month-label { font-size: 1.2rem; font-weight: bold; color: white; }
.cal-nav-btn { 
    background: transparent; border: 1px solid var(--border); 
    color: var(--text-dim); border-radius: 8px; padding: 5px 12px; 
    cursor: pointer; transition: 0.2s; 
}
.cal-nav-btn:hover { border-color: var(--primary); color: white; }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}

.cal-day-header {
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: bold;
    padding-bottom: 10px;
    text-transform: uppercase;
}

.cal-day {
    aspect-ratio: 1; /* Square cells */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: 0.2s;
    font-size: 0.9rem;
    color: var(--text-main);
    border: 1px solid transparent;
}

.cal-day:hover { background: rgba(255,255,255,0.05); }
.cal-day.empty { pointer-events: none; }

.cal-day.today { 
    color: var(--primary); 
    border-color: var(--primary); 
    font-weight: bold; 
}

.cal-day.selected { 
    background: var(--primary); 
    color: white; 
    border-color: var(--primary);
}

/* Task Indicator Dot */
.task-dot {
    width: 5px; height: 5px;
    background-color: var(--accent);
    border-radius: 50%;
    position: absolute;
    bottom: 6px;
    display: none;
    box-shadow: 0 0 5px var(--accent);
}
.cal-day.has-task .task-dot { display: block; }
