/* Minimal, Clean, ADHD-Friendly Theme */
:root {
    /* Soft, non-distracting colors */
    --bg-main: #f8f9fa;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;

    /* Primary brand colors */
    --primary: #6366f1;
    /* Indigo */
    --primary-hover: #4f46e5;
    --primary-light: #e0e7ff;

    /* Secondary features */
    --secondary: #10b981;
    /* Green */
    --secondary-hover: #059669;
    --secondary-light: #d1fae5;

    --warning: #f59e0b;
    --danger: #ef4444;

    /* Structural */
    --sidebar-width: 260px;
    --radius-lg: 16px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 18px;
    /* Large, readable base font for ADHD friendliness */
}

/* Layout */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 3rem;
    padding-left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-family: inherit;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-btn.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem 3rem;
}

/* Typography & Headers */
h1 {
    font-size: 2.5rem;
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.4rem;
    color: var(--text-main);
    margin-bottom: 0.8rem;
}

h4 {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Tabs */
.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: start;
}

/* Tools Column */
.tool-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 1rem;
}

.tool-tab-btn {
    background: transparent;
    border: none;
    padding: 0.8rem 1.2rem;
    font-size: 1.1rem;
    font-family: inherit;
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-tab-btn:hover {
    background-color: rgba(99, 102, 241, 0.05);
    color: var(--text-main);
}

.tool-tab-btn.active {
    background-color: var(--primary);
    color: white;
}

.tool-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tool-pane.active {
    display: block;
}

/* Cards & Inputs */
.input-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--text-main);
}

textarea,
input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    background: #fdfdfd;
    transition: border-color 0.2s;
    color: var(--text-main);
    resize: vertical;
}

textarea:focus,
input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
}

.error-msg {
    color: var(--danger);
    background: #fef2f2;
    padding: 0.8rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #fecaca;
}

.result-section {
    margin-bottom: 2rem;
}

.result-section h3,
.result-section summary.section-title {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.result-section.experiment-overview h3 {
    color: var(--primary);
}

.result-section.general-summary h3 {
    color: var(--success);
}

.result-section.importance h3 {
    color: var(--warning);
}

.result-section.how-it-worked h3 {
    color: var(--secondary);
}

.result-section.advanced-explain summary.section-title {
    color: var(--text-main);
}

.result-section.advanced-explain .advanced-text {
    margin-top: 0.5rem;
}

/* Comparison Layout Specifics */
@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr !important;
    }
}

.action-btn {
    width: 100%;
    padding: 1.2rem;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s;
}

.primary-btn {
    background-color: var(--primary);
    color: white;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.secondary-btn:hover {
    background-color: var(--primary-light);
}

/* Drag and Drop Zone */
.drag-drop-zone {
    text-align: center;
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s;
}

.drag-drop-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.icon-large {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Output Areas */
.output-card {
    background: var(--card-bg);
    border-left: 6px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.hidden {
    display: none;
}

.definition-box,
.example-box,
.citation-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f1f5f9;
    border-radius: var(--radius-md);
}

ul {
    list-style-position: inside;
}

.def-list li,
.ideas-list li,
.bullets-list li,
.support-list li,
.challenge-list li,
.citation-list li {
    margin-bottom: 1rem;
    color: var(--text-main);
}

/* Evidence Grid */
.evidence-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.evidence-support {
    background: #f0fdf4;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--secondary);
}

.evidence-challenge {
    background: #fef2f2;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--danger);
}

/* Folders Sidebar (Right Column) */
.folders-column {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: sticky;
    top: 2.5rem;
}

.folders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.icon-btn {
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: #c7d2fe;
}

.folder-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.folder-item:hover {
    background: #f1f5f9;
}

.folder-item i {
    color: var(--primary);
}

.assign-area {
    margin-top: 2rem;
    padding: 2rem 1rem;
    text-align: center;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: #f8fafc;
    color: var(--text-muted);
}

.assign-area i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
}

/* History specific */
.history-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.history-item i {
    font-size: 1.5rem;
}

.text-primary {
    color: var(--primary);
}

.text-secondary {
    color: var(--secondary);
}

.history-details p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Profile Specific */
.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 600px;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* Switch for Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* --- Global Profile Settings --- */
body.adhd-focus .advanced-explain {
    display: none !important;
}