* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    touch-action: manipulation;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
.header {
    padding: 16px;
    background: #4CAF50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header h1 {
    font-size: 20px;
    font-weight: 500;
}

/* Mode Toggle */
.mode-toggle {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 4px;
    display: flex;
    gap: 4px;
}

.mode-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: white;
    border-radius: 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.mode-btn.active {
    background: white;
    color: #4CAF50;
}

.share-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
}

/* List */
.list {
    flex: 1;
    padding: 8px;
}

/* Items */
.item {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    gap: 12px;
    border-bottom: 1px solid #eee;
    background: white;
    position: relative;
    transition: background 0.2s;
}

.item.dragging {
    opacity: 0.5;
}

.item.drag-over-top {
    border-top: 3px solid #4CAF50;
}

.item.drag-over-bottom {
    border-bottom: 3px solid #4CAF50;
}

.item.delete-zone {
    background: #ffebee;
}

.item.bought {
    opacity: 0.5;
    text-decoration: line-through;
    color: #999;
}

.item.new-item {
    color: #999;
}

/* Checkbox */
.checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox.checked {
    background: #4CAF50;
    border-color: #4CAF50;
}

.checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 14px;
}

/* Item Content */
.item-content {
    flex: 1;
    display: flex;
    align-items: center;
    cursor: pointer;
    min-height: 24px;
}

.item-quantity {
    font-weight: 500;
    min-width: 24px;
    text-align: right;
    margin-right: 12px;
}

.item-name {
    flex: 1;
    margin-left: 12px;
}

.item-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 4px;
    border-bottom: 2px solid #4CAF50;
}

/* Drag Handle */
.drag-handle {
    font-size: 20px;
    color: #999;
    cursor: grab;
    padding: 4px;
    user-select: none;
    line-height: 1;
    display: flex;
    align-items: center;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Section Buttons */
.new-section-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    color: #4CAF50;
    cursor: pointer;
    border-top: 1px solid #eee;
    margin-top: 8px;
}

.new-section-btn:hover {
    background: #f5f5f5;
}

/* Section Dividers (for future implementation) */
.section-divider {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    gap: 12px;
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
    font-weight: 500;
    margin-top: 8px;
}

.section-divider.fixed {
    margin-top: 0;
}

.section-title {
    flex: 1;
    font-size: 16px;
    color: #666;
    cursor: pointer;
}

.collapse-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    font-size: 12px;
}

.section-divider.collapsed + .item {
    display: none;
}

/* Import Panel */
.import-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid #4CAF50;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.import-content {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.import-content p {
    margin-bottom: 16px;
    font-size: 16px;
    color: #333;
}

.import-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.import-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.keep-btn {
    background: #4CAF50;
    color: white;
}

.keep-btn:hover {
    background: #45a049;
}

.revert-btn {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #ddd;
}

.revert-btn:hover {
    background: #e0e0e0;
}