/**
 * Grocery List Generator Styles
 * Modern, sleek design with smooth animations
 */

.grocery-list-generator-tool {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
}

.tool-header h3 {
    margin: 0 0 0.75rem 0;
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

.tool-header p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.95;
}

/* List Container */
.list-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
}

/* Quick Lists Section */
.quick-lists-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.quick-lists-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
}

.quick-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.quick-list-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.quick-list-btn:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    color: #667eea;
}

.quick-list-btn:active {
    transform: translateY(0);
}

.quick-icon {
    font-size: 1.5rem;
}

.quick-label {
    font-size: 0.875rem;
}

/* Main Content Grid */
.main-content-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Section Cards */
.section-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.section-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.section-card.sticky-card {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

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

.section-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
}

.items-count,
.selected-count {
    padding: 0.25rem 0.75rem;
    background: #f0f4ff;
    color: #667eea;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9375rem;
    color: #374151;
    background: #ffffff;
    transition: all 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Category Buttons */
.category-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.category-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.category-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.category-icon {
    font-size: 1.5rem;
}

.category-label {
    font-size: 0.8125rem;
    text-align: center;
    line-height: 1.2;
}

/* Items Container */
.items-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem;
    margin: -0.5rem;
}

.item-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.item-checkbox:hover {
    background: #f0f4ff;
    border-color: #cbd5e1;
}

.item-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.item-checkbox input[type="checkbox"]:checked + label {
    color: #667eea;
    font-weight: 600;
}

.item-checkbox label {
    flex: 1;
    font-size: 0.9375rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

/* Custom Item Input */
.custom-item-input-group {
    display: flex;
    gap: 0.75rem;
}

.custom-item-input-group .form-control {
    flex: 1;
}

/* List Controls */
.list-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn svg {
    flex-shrink: 0;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

.btn-outline {
    background: #ffffff;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

/* Selected Items List */
.selected-items-list {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: #9ca3af;
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin: 0.25rem 0;
    font-size: 0.9375rem;
}

.empty-hint {
    font-size: 0.875rem;
    color: #d1d5db;
}

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

.category-title {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.category-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.selected-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.selected-item:hover {
    background: #f0f4ff;
    border-color: #cbd5e1;
    transform: translateX(4px);
}

.item-name {
    flex: 1;
    font-size: 0.9375rem;
    color: #374151;
    font-weight: 500;
}

.remove-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.remove-item:hover {
    background: #fecaca;
    transform: scale(1.1);
}

/* List Actions */
.list-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 2px solid #f0f0f0;
}

.list-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Saved Lists */
.saved-lists-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
}

.clear-saved-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-saved-btn:hover {
    background: #fecaca;
    transform: scale(1.05);
}

.saved-lists-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.saved-list-item {
    padding: 1rem;
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.saved-list-item:hover {
    background: #f0f4ff;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.list-info {
    margin-bottom: 0.75rem;
}

.list-name {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.list-count {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.list-date {
    font-size: 0.75rem;
    color: #9ca3af;
}

.list-actions-buttons {
    display: flex;
    gap: 0.5rem;
}

.load-list-btn,
.delete-list-btn {
    flex: 1;
    padding: 0.625rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-list-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.load-list-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.delete-list-btn {
    background: #fee2e2;
    color: #dc2626;
}

.delete-list-btn:hover {
    background: #fecaca;
    transform: translateY(-2px);
}

/* Status Messages */
.status-message {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease-out;
}

.status-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button States */
.quick-list-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: scale(0.95);
}

.btn.copied {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content-grid {
        grid-template-columns: 1fr;
    }
    
    .section-card.sticky-card {
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .grocery-list-generator-tool {
        padding: 1rem;
    }
    
    .list-container {
        padding: 1.5rem;
    }
    
    .tool-header {
        padding: 1.5rem;
    }
    
    .tool-header h3 {
        font-size: 1.5rem;
    }
    
    .category-buttons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .items-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .quick-list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .list-actions {
        grid-template-columns: 1fr;
    }
    
    .saved-lists-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .category-buttons-grid {
        grid-template-columns: 1fr;
    }
    
    .items-container {
        grid-template-columns: 1fr;
    }
    
    .quick-list-grid {
        grid-template-columns: 1fr;
    }
}

