/* =============================================================================
   EINKAUF-IO STYLESHEET
   ============================================================================= */

/* Base Styles */
body {
    background: #0f0f23;
    color: #cccccc;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

/* Card Container */
.card {
    max-width: 800px;
    margin: 0 auto;
    background: #1a1a2e;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Typography */
h1, h2 {
    color: #e6eef6;
    margin-bottom: 20px;
}

h3 {
    color: #f7fafc;
    margin: 0 0 15px 0;
    font-size: 1.2em;
    font-weight: 600;
}

/* Form Elements */
input, select, button {
    background: #2d3748;
    border: 2px solid #4a5568;
    color: #e6eef6;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* Buttons */
button {
    background: #7c3aed;
    color: white;
    cursor: pointer;
    font-weight: 600;
    border: 2px solid #7c3aed;
}

button:hover {
    background: #8b5cf6;
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

button.ghost {
    background: #374151;
    color: #d1d5db;
    border: 1px solid #4b5563;
}

button.ghost:hover {
    background: #4b5563;
    color: #f3f4f6;
}

/* Text Styling */
.muted {
    color: #98a0aa;
    font-size: 0.9rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
    padding: 20px;
    background: #1a202c;
    border-radius: 10px;
    border: 1px solid #2d3748;
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.form-row input,
.form-row select {
    flex: 1;
    min-width: 150px;
}

/* Section Headers */
.section-header {
    border-bottom: 2px solid #7c3aed;
    padding-bottom: 8px;
    margin-bottom: 20px;
}

/* Item Cards */
.item-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border: 1px solid #444;
    margin: 12px 0;
    padding: 16px;
    border-radius: 10px;
    background: #2a2a3e;
    transition: all 0.2s ease;
}

.item-card:hover {
    background: #3a3a4e;
    border-color: #555;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.item-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.item-checkbox {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.item-completed {
    opacity: 0.6;
    text-decoration: line-through;
}

/* Items Container */
#items {
    margin-bottom: 30px;
}

/* Total Sum Display */
.total-sum {
    font-weight: 600;
    font-size: 1.3em;
    margin-top: 20px;
    padding: 15px;
    background: #7c3aed;
    color: #fff;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #8b5cf6;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Editable Elements */
.editable {
    font-weight: bold;
    cursor: pointer;
    padding: 4px 8px;
    margin: 2px 4px;
    border-radius: 4px;
    transition: background 0.2s;
    border: 1px solid rgba(124, 58, 237, 0.3);
    background: rgba(124, 58, 237, 0.1);
    display: inline-block;
}

.editable:hover {
    background: #374151;
    border-color: #7c3aed;
}

.editing {
    background: #1f2937 !important;
    border: 2px solid #7c3aed !important;
    padding: 4px 8px !important;
}

.edit-input {
    background: #1f2937;
    border: 2px solid #7c3aed;
    color: #e6eef6;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: inherit;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

/* Delete Button */
.delete-btn {
    background: #dc3545 !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 6px !important;
    cursor: pointer;
    font-size: 14px;
    margin-left: auto;
    transition: all 0.2s;
    flex-shrink: 0;
    font-weight: bold;
}

.delete-btn:hover {
    background: #c82333 !important;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

/* Category Styles */
.category-section {
    margin: 20px 0 10px 0;
    padding: 10px;
    background: #2d3748;
    border-radius: 8px;
    border-left: 4px solid #7c3aed;
}

.category-header {
    margin: 0;
    color: #e6eef6;
    font-size: 1.1em;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.category-header.collapsible {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.category-header.collapsible:hover {
    background-color: rgba(124, 58, 237, 0.2);
}

.category-content {
    transition: all 0.3s ease;
}

.category-section.collapsed .category-content {
    display: none;
}

.category-text {
    font-size: 0.9em;
    opacity: 0.8;
}

.category-total {
    margin-top: 10px;
    padding: 8px;
    background: #374151;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
}

.list-name-input {
    font-size: inherit;
    font-weight: inherit;
}

/* Text Styling Classes */
.text-bold {
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card {
        margin: 10px;
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row input,
    .form-row select {
        min-width: unset;
        width: 100%;
    }
    
    .item-card {
        flex-direction: column;
        gap: 10px;
    }
    
    .item-content {
        width: 100%;
    }
}

/* Additional Form Classes */
.form-row .input-name {
    flex: 2 !important;
    min-width: 200px;
}

.form-row .input-people {
    flex: 1 !important;
    min-width: 120px;
}

.btn-add {
    width: 100%;
    margin-top: 10px;
}

.form-row .btn-update {
    flex: 0 0 auto !important;
    min-width: auto;
    white-space: nowrap;
}

.btn-clear {
    width: 100%;
}