:root {
    /* Base Variables (Default to Dark Theme) */
    --bg-color: #0d1117;
    --sidebar-bg: #161b22;
    --panel-bg: rgba(22, 27, 34, 0.7);
    --border-color: #30363d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;

    /* Accents */
    --accent-green: #2ea043;
    --accent-green-glass: rgba(46, 160, 67, 0.15);
    --accent-gold: #e3b341;
    --accent-blue: #58a6ff;
    --accent-purple: #bc8cff;

    /* UI Effects */
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 15px rgba(46, 160, 67, 0.3);

    /* Background Pattern Colors */
    --pattern-color-1: rgba(46, 160, 67, 0.1);
    --pattern-color-2: rgba(188, 140, 255, 0.08);
}

[data-theme="light"] {
    --bg-color: #f0fdf4;
    /* Pale Mint */
    --sidebar-bg: #ffffff;
    --panel-bg: rgba(255, 255, 255, 0.65);
    --border-color: #d1d5db;
    --text-primary: #111827;
    /* Dark Grey */
    --text-secondary: #4b5563;

    /* Accents */
    --accent-green: #059669;
    /* Emerald */
    --accent-green-glass: rgba(5, 150, 105, 0.15);
    --accent-gold: #d97706;
    /* Amber */
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;

    /* UI Effects */
    --glass-border: 1px solid rgba(0, 0, 0, 0.05);
    --hover-bg: rgba(0, 0, 0, 0.05);
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 15px rgba(5, 150, 105, 0.2);

    /* Background Pattern Colors */
    --pattern-color-1: rgba(5, 150, 105, 0.05);
    --pattern-color-2: rgba(124, 58, 237, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    background-image:
        radial-gradient(circle at 15% 15%, var(--pattern-color-1) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, var(--pattern-color-2) 0%, transparent 45%);
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 10;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 80px;
    padding: 2rem 0.8rem;
}

.logo {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.logo-images {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 48px;
    position: relative;
    overflow: hidden;
}

.logo-full {
    max-width: 180px;
    height: auto;
    transition: all 0.3s ease;
    opacity: 1;
}

.logo-small {
    position: absolute;
    left: 0;
    max-width: 40px;
    height: auto;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.sidebar.collapsed .logo-full {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
}

.sidebar.collapsed .logo-small {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    position: static;
}

.mobile-top-bar {
    display: none;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0 0 20px 20px;
}

.mobile-logo {
    height: 40px;
    width: auto;
}

.sidebar-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.sidebar.collapsed .sidebar-controls {
    flex-direction: column;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: var(--hover-bg);
    color: var(--accent-green);
}

.sidebar.collapsed .sidebar-toggle .icon {
    transform: rotate(180deg);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.nav-links li {
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .nav-links li {
    padding: 1rem 0;
    justify-content: center;
}

.nav-links li .icon {
    font-size: 1.4rem;
    min-width: 24px;
    display: flex;
    justify-content: center;
}

.nav-links li .text {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sidebar.collapsed .nav-links li .text {
    opacity: 0;
    transform: translateX(-10px);
    position: absolute;
    pointer-events: none;
}

.nav-links li:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-links li.active {
    background-color: var(--accent-green-glass);
    color: var(--accent-green);
    border: 1px solid rgba(46, 160, 67, 0.1);
    /* Keep direct subtle border for contrast */
}

/* Main Content */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    scroll-behavior: smooth;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header p {
    color: var(--text-secondary);
}

/* Panel Layout */
.calculator-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    height: calc(100vh - 180px);
}

/* Panel Styling */
.panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Plant Selection (Left Panel) */
.selection-panel {
    gap: 1.2rem;
}

.search-bar input {
    width: 100%;
    padding: 14px;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
}

.search-bar input:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 2px var(--accent-green-glass);
}

.category-filters {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.cat-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 24px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.85rem;
    transition: all 0.2s;
    font-weight: 500;
}

.cat-btn:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.cat-btn.active {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
    box-shadow: 0 4px 10px var(--accent-green-glass);
}

.plant-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
    padding: 0.5rem;
}

.plant-item {
    aspect-ratio: 1;
    background: var(--hover-bg);
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy */
    text-align: center;
    padding: 0.8rem;
}

.plant-item:hover {
    background: rgba(46, 160, 67, 0.08);
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-glow);
    border-color: var(--accent-green-glass);
}

.plant-item.active {
    background: var(--accent-green-glass);
    border-color: var(--accent-green);
    box-shadow: 0 0 0 2px var(--accent-green);
}

.plant-item span {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    text-transform: capitalize;
    font-weight: 600;
}

.plant-item img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Controls (Right Panel) */
.controls-panel {
    gap: 1.8rem;
    overflow-y: auto;
}

.selected-plant-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.plant-preview-icon {
    width: 80px;
    height: 80px;
    background: var(--hover-bg);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.modifiers-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 200px;
}

.modifiers-section h4 {
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-search {
    width: 100%;
    padding: 10px;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.modifiers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
    /* Space for shadow / outline */
}

.mod-btn {
    padding: 8px 14px;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.mod-btn:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.mod-btn.active {
    border-color: var(--accent-gold);
    background: rgba(227, 179, 65, 0.15);
    color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(227, 179, 65, 0.2);
    font-weight: 600;
}

.active-mods-display {
    min-height: 44px;
    padding: 12px;
    background: var(--hover-bg);
    border-radius: 10px;
    color: var(--accent-gold);
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    border: 1px dashed var(--border-color);
}

.inputs-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.input-group.full-width {
    grid-column: span 2;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.input-group input[type="number"],
.input-group input[type="text"] {
    padding: 12px;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.input-group input:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0 4px;
    margin-top: 4px;
}

input[type=range] {
    width: 100%;
    accent-color: var(--accent-green);
    cursor: pointer;
}

.result-card {
    background: linear-gradient(135deg, var(--accent-green-glass), rgba(0, 0, 0, 0));
    border: 1px solid var(--accent-green);
    padding: 2rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    opacity: 0.5;
    pointer-events: none;
}

.result-card .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    z-index: 1;
}

.result-card .value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-shadow: 0 4px 15px rgba(227, 179, 65, 0.4);
    z-index: 1;
}

.action-btn {
    margin-top: 1.5rem;
    padding: 14px 28px;
    background: var(--accent-green);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(46, 160, 67, 0.3);
    z-index: 1;
    width: 100%;
}

.action-btn:hover {
    background: #3fb959;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 160, 67, 0.4);
}

.harvest-list {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--hover-bg);
    color: var(--accent-gold);
    transform: rotate(15deg);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding: 0.8rem 1.5rem;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 1000;
        flex-direction: row;
        justify-content: center;
        border-right: none;
        border-top: 1px solid var(--border-color);
        background: rgba(22, 27, 34, 0.95);
        backdrop-filter: blur(20px);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    }

    [data-theme="light"] .sidebar {
        background: rgba(255, 255, 255, 0.95);
    }

    .mobile-top-bar {
        display: flex;
        justify-content: center;
        align-items: center;
        position: sticky;
        top: 0;
        z-index: 1001;
    }

    .logo {
        display: none;
    }

    .nav-links {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        padding: 0;
        gap: 0;
    }

    .nav-links li {
        padding: 0.6rem 1rem;
        flex-direction: column;
        gap: 0.3rem;
        font-size: 0.75rem;
        text-align: center;
        border-radius: 12px;
        border: none;
    }

    .nav-links li .icon {
        font-size: 1.4rem;
        margin-bottom: 0;
    }

    .nav-links li:hover {
        transform: none;
        background: transparent;
    }

    .nav-links li.active {
        background: var(--accent-green-glass);
        transform: translateY(-5px);
    }

    .content {
        padding: 1.5rem;
        padding-bottom: 100px;
        /* Space for bottom nav */
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    .calculator-layout {
        grid-template-columns: 1fr;
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .panel {
        padding: 1.5rem;
    }

    .plant-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        max-height: 280px;
        /* Limit height on mobile */
    }

    .inputs-section {
        grid-template-columns: 1fr;
    }

    .input-group.full-width {
        grid-column: span 1;
    }

    .site-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.5rem 1.5rem 100px 1.5rem !important;
    }
}

/* Footer Styling */
.site-footer {
    margin-top: 4rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-green);
}

/* FAQ Accordion Section */
.faq-section {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.faq-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: left;
}

.faq-details {
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.8rem;
    overflow: hidden;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.faq-details:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-green);
    box-shadow: 0 4px 15px var(--accent-green-glass);
}

[data-theme="light"] .faq-details {
    background: var(--sidebar-bg);
}

[data-theme="light"] .faq-details:hover {
    background: rgba(0, 0, 0, 0.03);
}

.faq-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.2rem;
    user-select: none;
    list-style: none;
    /* standard */
}

.faq-summary::-webkit-details-marker {
    display: none;
    /* webkit */
}

.faq-icon {
    color: var(--accent-green);
    font-size: 1.4rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.faq-icon::before {
    content: '+';
}

.faq-details[open] .faq-icon::before {
    content: '−';
    /* proper minus sign */
}

.faq-content {
    padding: 0 1.2rem 1.2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.faq-details[open] .faq-content {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 0.2rem;
}

.faq-content p {
    margin-bottom: 0.8rem;
}

.faq-content ul {
    margin-left: 1.5rem;
    margin-bottom: 0.8rem;
    list-style-type: disc;
}

.faq-content li {
    margin-bottom: 0.4rem;
}

.faq-content p:last-child,
.faq-content ul:last-child {
    margin-bottom: 0;
}