/* ===== MIXBAG – Solar Theme ===== */
:root {
    --bg: #faf8f5;
    --bg-warm: #f5f0e8;
    --card: #fff;
    --card-border: rgba(0, 0, 0, 0.06);
    --accent: #e67e22;
    --accent-light: rgba(230, 126, 34, 0.1);
    --accent-glow: rgba(230, 126, 34, 0.25);
    --green: #27ae60;
    --red: #e74c3c;
    --text: #2c3e50;
    --text-dim: #7f8c8d;
    --border: rgba(0, 0, 0, 0.08);
    --radius: 12px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hidden {
    display: none !important;
}

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

html,
body {
    height: 100%;
    overflow: hidden;
}

body.solar-theme {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

#app {
    display: flex;
    flex-direction: column;
    height: 100dvh;
}

header {
    height: 52px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 200;
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo i {
    color: var(--accent);
    width: 22px;
    height: 22px;
}

.logo h1 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}

main {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* LIST VIEW */
#list-view {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    background: var(--bg);
}

.list-toolbar {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--card);
}

.search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 10px;
}

.search-bar i {
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-size: 14px;
    padding: 8px 0;
    outline: none;
    min-width: 0;
}

.tag-bar {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: var(--card);
}

.tag-bar::-webkit-scrollbar {
    display: none;
}

.tag-pill {
    white-space: nowrap;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    font-weight: 500;
}

.tag-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 2px 8px var(--accent-glow);
}

#checklist-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
}

/* BAG ITEMS */
.bag-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
    background: var(--card);
    border: 1px solid transparent;
}

.bag-item:hover,
.bag-item:active {
    background: var(--bg-warm);
}

.bag-item.selected {
    border-color: var(--accent);
    background: var(--accent-light);
}

.bag-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.bag-info>i {
    color: var(--text-dim);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.bag-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bag-text>span {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bag-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--accent-light);
    border: 1px solid rgba(230, 126, 34, 0.2);
    color: var(--accent);
    font-weight: 600;
}

.badge.highlight {
    background: var(--accent);
    color: white;
}

.template-badge {
    background: rgba(39, 174, 96, 0.1) !important;
    border-color: rgba(39, 174, 96, 0.25) !important;
    color: var(--green) !important;
}

.bag-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.bag-item input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
    flex-shrink: 0;
    background: var(--card);
}

.bag-item input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.bag-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 13px;
    left: 4px;
    top: 0;
}

.priority-btn {
    padding: 4px 8px !important;
    font-size: 10px !important;
    background: var(--accent-light) !important;
    border: 1px solid rgba(230, 126, 34, 0.2) !important;
    color: var(--accent) !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    white-space: nowrap;
}

.priority-btn:active {
    background: var(--accent) !important;
    color: white !important;
}

.dup-btn {
    padding: 4px !important;
    box-shadow: none !important;
}

/* RIGHT PANEL – single panel for all detail content */
#right-panel {
    position: absolute;
    inset: 0;
    background: var(--bg);
    z-index: 50;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#right-panel.active {
    display: flex;
}

#content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* BUTTONS */
button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

button:active {
    transform: scale(0.97);
}

button.secondary {
    background: var(--bg-warm);
    border: 1px solid var(--border);
    color: var(--text);
}

button.full-w {
    width: 100%;
}

.icon-btn {
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.icon-btn i {
    width: 18px;
    height: 18px;
}

.icon-btn:active {
    background: var(--bg-warm);
}

.icon-btn.active,
.star-btn.starred {
    color: #f39c12;
    border-color: rgba(243, 156, 18, 0.3);
}

.delete-bag-btn {
    color: var(--red) !important;
    border-color: rgba(231, 76, 60, 0.15) !important;
}

.glow-btn {
    background: linear-gradient(135deg, var(--accent), #d35400);
    box-shadow: 0 2px 12px var(--accent-glow);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 8px 14px;
}

#user-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

#user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 20px;
}

#user-photo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

#user-name {
    font-size: 13px;
    font-weight: 500;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

/* VIEW HEADER */
.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.view-header h2 {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
    cursor: pointer;
}

.view-header h2:hover {
    color: var(--accent);
}

.view-header-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.checklist-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#progress-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}

.glass-input {
    flex: 1;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    min-width: 0;
}

/* PROGRESS */
.progress-bar-container {
    height: 4px;
    background: var(--bg-warm);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0;
    transition: width 0.3s;
    box-shadow: 0 0 6px var(--accent-glow);
}

/* ADD ITEM */
.add-item-bar {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.add-item-bar input {
    flex: 1;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    padding: 6px 10px;
    outline: none;
    min-width: 0;
}

.cat-add-bar {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.cat-add-bar input {
    flex: 1;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--text);
    outline: none;
    min-width: 0;
}

.cat-add-bar button {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 6px;
}

/* TAG MANAGEMENT */
.tag-manage {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 16px;
}

.tag-manage .badge {
    cursor: pointer;
    padding: 3px 8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tag-manage .badge .remove-tag {
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 2px;
    color: var(--red);
}

.tag-add-row {
    display: flex;
    gap: 6px;
    padding: 4px 16px 8px;
}

.tag-add-row input {
    flex: 1;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--text);
    outline: none;
    min-width: 0;
}

/* CHECKLIST ITEMS */
.checklist-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
}

.category-group {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-light);
    margin-bottom: 4px;
}

.category-header span:first-child {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-header span:first-child::before {
    content: '';
    width: 3px;
    height: 12px;
    background: var(--accent);
    border-radius: 2px;
    display: block;
}

.category-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.check-item:active {
    background: var(--bg-warm);
}

.check-item.checked {
    background: rgba(39, 174, 96, 0.06);
    border-color: rgba(39, 174, 96, 0.15);
}

.check-item.checked .item-text {
    text-decoration: line-through;
    color: var(--text-dim);
}

.check-box {
    color: var(--text-dim);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.check-box i {
    width: 18px;
    height: 18px;
}

.checked .check-box {
    color: var(--green);
}

.item-text {
    font-size: 14px;
    flex: 1;
    min-width: 0;
}

.delete-item-btn {
    padding: 4px !important;
    border: none !important;
    background: none !important;
    color: var(--text-dim) !important;
    box-shadow: none !important;
}

.delete-item-btn:active {
    color: var(--red) !important;
}

.delete-item-btn i {
    width: 14px;
    height: 14px;
}

.check-item.long-pressing {
    background: var(--accent-light) !important;
    border-color: var(--accent) !important;
    transition: background 0.6s;
}

/* MIXER */
.mix-preview {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
}

.mix-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-size: 14px;
}

.mix-item i {
    color: var(--green);
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.mix-item .item-text {
    flex: 1;
    min-width: 0;
}

.remove-item {
    padding: 4px !important;
    border: none !important;
    background: none !important;
    color: var(--text-dim) !important;
    box-shadow: none !important;
}

.remove-item:active {
    color: var(--red) !important;
}

.mix-actions {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--card);
}

.mix-actions button {
    flex: 1;
}

/* AI */
#ai-suggestions-container {
    margin: 0 12px;
    padding: 12px;
    background: var(--accent-light);
    border: 1px dashed var(--accent);
    border-radius: var(--radius);
}

#ai-suggestions-container h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 10px;
}

#ai-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.ai-item {
    padding: 6px 10px;
    background: var(--card);
    border: 1px solid rgba(230, 126, 34, 0.2);
    border-radius: 16px;
    font-size: 12px;
    color: var(--text);
}

.ai-actions {
    display: flex;
    gap: 8px;
}

.ai-actions button {
    flex: 1;
    font-size: 13px;
    padding: 8px;
}

/* ACTION CENTER */
#action-center {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 16px;
    background: var(--card);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 300;
    box-shadow: var(--shadow-md);
    animation: slideUp 0.3s var(--ease);
    max-width: calc(100% - 32px);
}

@keyframes slideUp {
    from {
        bottom: -80px;
        opacity: 0
    }

    to {
        bottom: 20px;
        opacity: 1
    }
}

.action-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    white-space: nowrap;
}

.action-info i {
    width: 16px;
    height: 16px;
}

.action-info span {
    color: var(--accent);
    font-weight: 700;
}

#action-center button {
    font-size: 13px;
    padding: 8px 16px;
}

/* MISC */
.large-icon {
    width: 64px;
    height: 64px;
    color: var(--text-dim);
    opacity: 0.2;
    margin-bottom: 16px;
}

#empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    color: var(--text-dim);
    font-size: 14px;
}

.empty-msg {
    padding: 24px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}

.spin {
    animation: rotate 1.5s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0)
    }

    to {
        transform: rotate(360deg)
    }
}

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

/* SETTINGS (rendered inside #content) */
.settings-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.setting-group h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
}

.setting-row .dim {
    color: var(--text-dim);
    font-size: 13px;
}

.setting-row input[type="checkbox"] {
    display: none;
}

.toggle {
    width: 44px;
    height: 24px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 1px;
    left: 1px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.setting-row input:checked+.toggle {
    background: var(--accent);
    border-color: var(--accent);
}

.setting-row input:checked+.toggle::after {
    transform: translateX(20px);
}

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-card {
    background: var(--card);
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.modal-card h3 {
    font-size: 16px;
    font-weight: 700;
}

.modal-input-row {
    display: flex;
    gap: 8px;
}

.modal-input-row input {
    flex: 1;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text);
    outline: none;
}

.modal-full-input {
    width: 100%;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text);
    outline: none;
}

.modal-actions {
    display: flex;
    gap: 8px;
}

.modal-actions button {
    flex: 1;
}

.cat-option {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
    margin-bottom: 6px;
}

.cat-option:hover,
.cat-option:active {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

/* DESKTOP */
@media(min-width:768px) {
    header {
        height: 56px;
        padding: 0 24px;
    }

    .logo h1 {
        font-size: 20px;
    }

    #list-view {
        width: 360px;
        min-width: 360px;
        border-right: 1px solid var(--border);
    }

    #right-panel {
        position: static;
        display: flex !important;
        flex: 1;
    }

    .checklist-items,
    .mix-preview {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
        padding: 20px;
        align-content: start;
    }

    #user-name {
        max-width: 150px;
    }
}