/* Packesel PWA - Full CSS without Variables */

/* 2. Basic Resets & Global Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Offline Banner */
.offline-banner {
    background-color: #f44336; /* Red background for error/warning */
    color: white;
    text-align: center;
    padding: 10px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000; /* Ensure it's on top of everything */
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.offline-banner.hidden {
    display: none;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f4f2; /* --background-color */
    color: #2d2d2d; /* --text-primary */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

input, textarea {
    font-family: inherit;
}

/* 3. Main App Layout */
#app {
    max-width: 480px;
    margin: 0 auto;
    background-color: #ffffff; /* --card-background */
    min-height: 100vh;
    padding: 16px 16px 100px 16px; /* --spacing-m, with bottom padding */
    display: flex;
    flex-direction: column;
    gap: 24px; /* --spacing-l */
    position: relative;
}

.main-header h1 {
    font-size: 2rem;
    font-weight: 700;
}

/* Utility classes to be used later */
.hidden {
    display: none !important;
}

/* 4. Component Styles */

/* Search Container */
.search-container {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex; /* Use flex to align input and button */
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238e8e8e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1; /* Ensure icon is above input */
}

#item-search, #trip-list-search, #packing-item-search { /* Selektor erweitert */
    width: 100%;
    padding: 16px 48px 16px 48px; /* Adjusted padding to make space for clear button */
    padding-left: 48px; /* Space for the search icon */
    border-radius: 12px; /* --border-radius-input */
    border: 1px solid #d9d9d9; /* --border-color */
    background-color: #f4f4f2; /* --background-color */
    font-size: 1rem;
    outline: none;
}
#item-search:focus, #trip-list-search:focus, #packing-item-search:focus { /* Selektor erweitert */
    border-color: #698a21; /* --pill-background-active */
}

#clear-search-btn, #clear-trip-list-search-btn, #clear-packing-search-btn { /* Selektor erweitert */
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 48px; /* Make it touch-friendly */
    height: 48px; /* Make it touch-friendly */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8e8e8e; /* Icon color */
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

#clear-search-btn svg, #clear-trip-list-search-btn svg, #clear-packing-search-btn svg { /* Selektor erweitert */
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Category Filters */
.category-filters {
    margin-top: 16px;
    display: flex;
    gap: 8px; /* --spacing-s */
    overflow-x: auto;
    padding-bottom: 8px; /* --spacing-s */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.category-filters::-webkit-scrollbar {
    display: none;
}

.category-pill {
    flex-shrink: 0;
    padding: 8px 16px; /* --spacing-s, --spacing-m */
    border-radius: 20px; /* --border-radius-pill */
    background-color: #e6e9e2; /* --pill-background */
    color: #2d2d2d; /* --text-primary */
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.category-pill .item-count {
    color: #8e8e8e; /* --text-secondary */
    margin-left: 8px; /* --spacing-s */
}

.category-pill.active {
    background-color: #698a21; /* --pill-background-active */
    color: #ffffff; /* --pill-text-active */
    border: 1px solid #698a21; /* --pill-background-active */
}

.category-pill.active .item-count {
    color: #ffffff; /* --pill-text-active */
}

/* Item List */
.item-list-section {
    margin-top: 24px; /* --spacing-l */
}

.item-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px; /* --spacing-m */
}

.item-list-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.more-options-btn {
    width: 24px;
    height: 24px;
    position: relative;
}
.more-options-btn::before {
    content: '...';
    position: absolute;
    top: -10px;
    left: 5px;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
    color: #5f5f5f; /* --icon-color */
}

.item-list {
    display: flex;
    flex-direction: column;
    gap: 8px; /* --spacing-s */
}

.item-row {
    display: flex;
    align-items: center;
    padding: 16px 0; /* --spacing-m */
    border-bottom: 1px solid #f4f4f2; /* --background-color */
}

.drag-handle {
    width: 24px;
    height: 24px;
    margin-right: 16px; /* --spacing-m */
    cursor: grab;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23c9c9c9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='5' r='1'%3E%3C/circle%3E%3Ccircle cx='12' cy='12' r='1'%3E%3C/circle%3E%3Ccircle cx='12' cy='19' r='1'%3E%3C/circle%3E%3Ccircle cx='5' cy='5' r='1'%3E%3C/circle%3E%3Ccircle cx='5' cy='12' r='1'%3E%3C/circle%3E%3Ccircle cx='5' cy='19' r='1'%3E%3C/circle%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.item-name {
    flex-grow: 1;
    font-size: 1rem;
}

.trip-list-title { /* NEU */
    font-size: 1rem;
    font-weight: 600;
}

.item-actions {
    display: flex;
    gap: 16px; /* --spacing-m */
}

.icon-btn {
    padding: 12px; /* Makes a 20px icon into a 44x44px touch target */
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px; /* Ensure icon size remains 20x20px */
}

.info-btn {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235f5f5f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='16' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'%3E%3C/line%3E%3C/svg%3E");
}

.edit-btn {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235f5f5f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z'%3E%3C/path%3E%3C/svg%3E");
}

.delete-btn {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235f5f5f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'%3E%3C/polyline%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'%3E%3C/path%3E%3C/svg%3E");
}

.edit-trip-list-btn {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235f5f5f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z'%3E%3C/path%3E%3C/svg%3E");
}

.delete-trip-list-btn {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235f5f5f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'%3E%3C/polyline%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'%3E%3C/path%3E%3C/svg%3E");
}

.import-csv-btn {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235f5f5f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'%3E%3C/path%3E%3Cpolyline points='7 10 12 15 17 10'%3E%3C/polyline%3E%3Cline x1='12' y1='15' x2='12' y2='3'%3E%3C/line%3E%3C/svg%3E");
}

/* Buttons */
.add-item-inline-btn {
    width: 100%;
    padding: 16px; /* --spacing-m */
    margin-top: 16px; /* --spacing-m */
    border: 2px dashed #c9c9c9; /* --dashed-border-color */
    border-radius: 12px; /* --border-radius-input */
    color: #8e8e8e; /* --text-secondary */
    font-weight: 500;
    font-size: 1rem;
    text-align: center;
    transition: background-color 0.2s ease;
}
.add-item-inline-btn:hover {
    background-color: #e6e9e2; /* --pill-background */
}

.fab {
    position: fixed;
    bottom: 108px; /* Adjusted to account for bottom navigation bar height and provide more space */
    right: 32px; /* --spacing-xl */
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #f98072; /* --fab-background */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1); /* --shadow-strong */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 990; /* Ensure FAB is above other content but below modals */
}
.fab::before {
    content: '+';
    font-size: 2.5rem;
    color: #ffffff; /* --fab-text */
    font-weight: 300;
    line-height: 1;
    padding-bottom: 4px;
}

/* FAB Menu Popover */
.fab-menu-popover {
    position: fixed;
    bottom: 172px; /* Position above the FAB */
    right: 32px; /* Align with FAB */
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 989; /* Below FAB */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 200px;
}

.fab-menu-item {
    padding: 12px 16px;
    text-align: left;
    color: #2d2d2d;
    font-size: 1rem;
    border-bottom: 1px solid #f4f4f2;
    transition: background-color 0.2s ease;
}

.fab-menu-item:last-child {
    border-bottom: none;
}

.fab-menu-item:hover {
    background-color: #f4f4f2;
}


/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#edit-modal {
    z-index: 1002; /* Higher than fullscreen modal (1000) and its context menu (1001) */
}

.modal-content {
    background-color: #ffffff; /* --card-background */
    padding: 24px; /* --spacing-l */
    border-radius: 16px; /* --border-radius-card */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1); /* --shadow-strong */
    width: calc(100% - 48px);
    max-width: 400px;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 24px; /* --spacing-l */
}

.form-group {
    margin-bottom: 16px; /* --spacing-m */
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px; /* --spacing-s */
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    min-height: 48px; /* Ensure good touch target size */
    border: 1px solid #d9d9d9; /* --border-color */
    border-radius: 12px; /* --border-radius-input */
    font-size: 1rem;
    background-color: #f4f4f2; /* --background-color */
    -webkit-appearance: none; /* Remove default iOS styling */
    -moz-appearance: none;
    appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238e8e8e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); /* Custom dropdown arrow */
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px; /* --spacing-m */
    margin-top: 24px; /* --spacing-l */
}

.btn-primary, .btn-secondary {
    padding: 8px 16px; /* --spacing-s, --spacing-m */
    border-radius: 20px; /* --border-radius-pill */
    font-weight: 500;
}

.btn-primary {
    background-color: #698a21; /* --pill-background-active */
    color: #ffffff; /* --pill-text-active */
}

.btn-secondary {
    background-color: #e6e9e2; /* --pill-background */
    color: #2d2d2d; /* --text-primary */
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    z-index: 999;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 8px 0;
    color: #8e8e8e; /* text-secondary */
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-item.active {
    color: #698a21;
    border-bottom: 2px solid #698a21;
}

.nav-item span {
    margin-top: 4px;
}

/* Specific icons */
/* Removed specific icon styles as they are now inline SVGs */

/* View Container Styles */
.view-container {
    width: 100%;
    /* min-height: 100%; */ /* Handled by #app flex-grow */
    flex-grow: 1; /* Allow view to take available space */
    display: flex;
    flex-direction: column;
    /* gap: 24px; */ /* Gap is handled by #app */
}

.view-container.hidden {
    display: none !important;
}

/* Context Menu Styling */
.context-menu {
    position: absolute;
    top: 100%; /* Position below the trigger button */
    right: 0;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    min-width: 180px;
    overflow: hidden; /* Ensures rounded corners apply to content */
}

#fullscreen-edit-context-menu {
    z-index: 1001; /* Ensure it's above the fullscreen modal (z-index 1000) */
}

.context-menu-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    color: #2d2d2d;
    font-size: 1rem;
    border-bottom: 1px solid #f4f4f2; /* Light separator */
}

.context-menu-item:last-child {
    border-bottom: none;
}

.context-menu-item:hover {
    background-color: #f4f4f2;
}

/* Fullscreen Modal Specific Styles */
.fullscreen-modal {
    width: 100%;
    max-width: none; /* Override max-width from .modal-content */
    height: 100%;
    border-radius: 0; /* No border-radius for fullscreen */
    padding: 0; /* No padding for fullscreen, content will handle it */
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f4f4f2;
    background-color: #ffffff;
    position: relative; /* Added for positioning context menus */
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    flex-grow: 1;
    text-align: center;
}

.close-fullscreen-modal-btn, .toggle-edit-mode-btn {
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f5f5f;
}

.close-fullscreen-modal-btn svg, .toggle-edit-mode-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.modal-body {
    flex-grow: 1;
    padding: 16px;
    overflow-y: auto;
}

.modal-nav {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #f4f4f2;
    background-color: #ffffff;
    padding: 8px 0;
}

.modal-nav-item {
    flex-grow: 1;
    text-align: center;
    padding: 12px 0;
    color: #8e8e8e;
    font-weight: 500;
    transition: color 0.2s ease;
}

.modal-nav-item.active {
    color: #698a21;
    border-bottom: 2px solid #698a21;
}

.modal-nav-item span {
    margin-top: 4px;
}

/* --- Packing View Specific Styles --- */

.packing-view-header {
    padding: 0 0 16px 0;
}

.packing-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #5f5f5f; /* --text-secondary */
    margin-bottom: 8px;
}

.progress-bar-container {
    display: flex; /* Neu: Flexbox für nebeneinanderliegende Balken */
    width: 100%;
    background-color: #e6e9e2; /* --pill-background */
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    /* Keine absolute Positionierung mehr, da Flexbox verwendet wird */
    height: 100%;
    transition: width 0.3s ease;
    /* flex-shrink: 0; */ /* Optional, um zu verhindern, dass Balken schrumpfen */
}

.progress-bar.prepared-progress {
    background-color: #66b3ff; /* Ein helleres Blau für "vorbereitet" */
    /* z-index nicht mehr nötig */
}

.progress-bar.packed-progress {
    background-color: #698a21; /* Grün für "eingepackt" (wie --pill-background-active) */
    /* z-index nicht mehr nötig */
}

.packing-view-controls {
    margin-top: 16px;
}

.packing-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: #ffffff;
    border-radius: 12px;
    margin-top: 8px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.packing-category-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.category-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-toggle-arrow {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235f5f5f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.packing-category-header.expanded .category-toggle-arrow {
    transform: rotate(180deg);
}

.category-item-list {
    padding: 0 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease; /* Adjusted transition for consistency */
    background-color: #f9f9f9;
    border-radius: 0 0 12px 12px;
}

.item-row-packing {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid #e6e9e2;
    cursor: pointer;
    border-radius: 8px;
    margin: 4px 0;
    transition: background-color 0.2s ease;
}
.item-row-packing:last-child {
    border-bottom: none;
}

.item-row-packing .item-name {
    flex-grow: 1;
}

.item-row-packing .item-status-text {
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 16px;
}

.item-row-packing.prepared {
    background-color: #e0f0ff; /* Light Blue */
}
.item-row-packing.prepared .item-status-text {
    color: #0066cc;
}

.item-row-packing.packed {
    background-color: #dfffe0; /* Light Green */
}
.item-row-packing.packed .item-status-text {
    color: #2a7f2d;
}

.category-options-btn {
    padding: 8px;
}
.category-options-btn svg {
    width: 20px;
    height: 20px;
    stroke: #5f5f5f;
}

.packing-view-footer {
    margin-top: 24px; /* Erhöht den Abstand nach oben */
    padding-top: 16px; /* Fügt etwas Polsterung hinzu, falls der Footer einen Hintergrund hat */
    border-top: 1px solid #f4f4f2; /* Optional: Eine leichte Trennlinie */
    text-align: center; /* Zentriert den Button */
}

.trip-list-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px; /* Kleiner Abstand zwischen Titel und Stats */
}

.trip-list-stats-text {
    font-size: 0.85rem;
    color: #5f5f5f; /* --text-secondary */
}

.trip-list-progress-bar-container {
    width: 100%;
    background-color: #e6e9e2; /* --pill-background */
    border-radius: 8px;
    height: 6px; /* Etwas kleiner als der Haupt-Fortschrittsbalken */
    overflow: hidden;
    display: flex; /* Für die zweifarbigen Balken */
}

.trip-list-progress-bar-container .prepared-progress {
    background-color: #66b3ff; /* Blau für "vorbereitet" */
}

.trip-list-progress-bar-container .packed-progress {
    background-color: #698a21; /* Grün für "eingepackt" */
}

/* --- Edit Mode Specific Styles --- */
.edit-view-controls {
    margin-bottom: 16px;
}

.edit-category-container {
    margin-bottom: 16px; /* Erhöhter Abstand zwischen Kategorien */
    border-radius: 12px; /* Apply border-radius to the container for a unified look */
    /* overflow: hidden; */ /* Removed to prevent clipping of context menu */
    box-shadow: 0 4px 8px rgba(0,0,0,0.08); /* More pronounced shadow for elevation */
}

.edit-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background-color: #f0f0f0; /* Slightly darker background for header */
    border-radius: 0; /* Remove border-radius from header, now on container */
    cursor: pointer;
    box-shadow: none; /* Remove shadow from header, now on container */
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #e0e0e0; /* Add a subtle border at the bottom of the header */
}

.edit-category-header h4 {
    font-size: 1.2rem; /* Slightly larger font size */
    font-weight: 700; /* Bolder font weight */
    margin: 0;
}

.edit-category-header.category-selected-all {
    background-color: #7bc96b; /* Darker green for fully selected category */
    color: #ffffff; /* Ensure text is readable on darker background */
}

.edit-category-header.category-selected-all h4 {
    color: #ffffff; /* Ensure category title is white */
}

.edit-category-header.category-selected-partial {
    background-color: #e0f0ff; /* Keep light blue for partial selection */
}

.edit-category-item-list {
    padding: 0 8px 8px 8px; /* Add bottom padding to the list */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease; /* Adjusted for consistency */
    background-color: #ffffff; /* Ensure item list has a clean white background */
    border-radius: 0 0 12px 12px; /* Apply border-radius to bottom of list */
}

.edit-item-row {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid #e6e9e2;
    cursor: pointer;
    border-radius: 8px;
    margin: 4px 0;
    transition: background-color 0.2s ease;
}

.edit-item-row:last-child {
    border-bottom: none;
}

.edit-item-row.selected {
    background-color: #dfffe0; /* Light Green, same as category-selected-all */
}

.edit-view-footer {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #f4f4f2;
}

.edit-view-empty-state {
    padding: 24px;
    text-align: center;
    color: #5f5f5f;
}

/* Ensure search input in edit mode uses the same styles */
#edit-item-search {
    width: 100%;
    padding: 16px 48px 16px 48px;
    padding-left: 48px;
    border-radius: 12px;
    border: 1px solid #d9d9d9;
    background-color: #f4f4f2;
    font-size: 1rem;
    outline: none;
}
#edit-item-search:focus {
    border-color: #698a21;
}

#clear-edit-search-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8e8e8e;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

#clear-edit-search-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Drag & Drop Styles */
.item-row.dragging {
    opacity: 0.5;
    border: 2px dashed #698a21; /* --pill-background-active */
    background-color: #e0ffe0; /* Light green background */
}

.item-row.drag-over-before {
    border-top: 2px solid #698a21; /* --pill-background-active */
}

.item-row.drag-over-after {
    border-bottom: 2px solid #698a21; /* --pill-background-active */
}
