/* 
 * forms.css - MeinTango
 * Formularelemente, Suche und Filtersysteme
 */

.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: var(--space-m);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 700;
    color: var(--text-color);
}

.form-control, 
input[type="text"], 
input[type="email"], 
input[type="password"], 
input[type="url"],
select, 
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--radius-lg);
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    color: var(--text-color);
    background-color: var(--white);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
input:focus, 
select:focus, 
textarea:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(115, 92, 0, 0.1);
}

.form-control-sm,
select.form-select-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-m);
}

.form-actions {
    display: flex;
    gap: var(--space-s);
    justify-content: flex-end;
    margin-top: var(--space-l);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary-red);
}

.help-text {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.85rem;
    color: #888;
}

/* Search & Filter System (Phase 5.7) */
.search-filter-section {
    background: var(--white);
    padding: var(--space-m);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 15px rgba(81, 96, 107, 0.05);
    margin-bottom: var(--space-l);
    border-left: 4px solid var(--primary-red);
}

.search-container {
    display: flex;
    gap: var(--space-s);
    align-items: center;
}

.search-input-wrapper {
    flex-grow: 1;
    position: relative;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.75rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #f8fafc;
    -webkit-appearance: none;
}

.search-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #94a3b8;
    z-index: 2;
}

.search-clear-btn.visible {
    display: flex;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-red);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(88, 0, 0, 0.1);
}

.search-input-wrapper::before {
    content: '🔍';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    font-size: 0.9rem;
}

.filter-toggle-btn {
    padding: 0.75rem var(--space-m);
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.filter-toggle-btn.active {
    background: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
}

.filter-panel {
    display: none;
    margin-top: var(--space-s);
    padding-top: var(--space-s);
    border-top: 1px dashed #e2e8f0;
}

.filter-panel.active {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-s);
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: bold;
    color: var(--accent-gold);
    margin-bottom: var(--space-xs);
}

/* Tagging System Input */
.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    padding: var(--space-xs);
    border: 1px solid #ddd;
    border-radius: var(--radius-lg);
    background-color: var(--white);
    min-height: 2.8rem;
    align-items: center;
}

.tag-input-container:focus-within {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(115, 92, 0, 0.1);
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.5rem;
    background-color: #f1f5f9;
    color: var(--text-color);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.tag-remove {
    cursor: pointer;
    font-weight: bold;
    color: #94a3b8;
    font-size: 1.1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.tag-remove:hover {
    background-color: #fee2e2;
    color: #ef4444;
}

.tag-input-field {
    flex: 1;
    border: none !important;
    padding: 0.3rem !important;
    min-width: 120px;
    box-shadow: none !important;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }

    .search-container .btn-primary {
        display: none;
    }

    .filter-panel.active {
        grid-template-columns: 1fr;
    }
}

/* Complex Checkbox Lists & Meta Fields (Refactored) */
.checkbox-list-complex {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: #fff;
    padding: var(--space-xs);
    max-height: 300px;
    overflow-y: auto;
}
.checkbox-complex-item {
    border-bottom: 1px solid #eee;
    padding: var(--space-s) var(--space-xs);
}
.checkbox-complex-item:last-child {
    border-bottom: none;
}
.checkbox-main {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: bold;
    cursor: pointer;
    margin-bottom: var(--space-xs);
}
.checkbox-main input {
    margin: 0;
    width: 1.1rem;
    height: 1.1rem;
}
.meta-fields {
    background: #f9f9f9;
    padding: var(--space-m);
    border-radius: var(--radius-md);
    margin-left: var(--space-m);
    border: 1px solid #eee;
}
.form-row.mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-m);
    margin-bottom: var(--space-xs);
}
.form-row.mini .form-group {
    margin-bottom: 0;
}
.form-row.mini label {
    font-size: 0.75rem;
    color: #64748b;
}

/* Star Rating Style */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
}
.star-rating input {
    display: none !important;
}
.star-rating label {
    font-size: 1.5rem;
    color: #ccc;
    cursor: pointer;
    margin-bottom: 0;
}
.star-rating label:before {
    content: '★';
}
.star-rating input:checked ~ label {
    color: #ffc107;
}
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #ffdb70;
}

/* Radio Groups (Phase 4 Cleanup) */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--white);
    padding: 0.4rem var(--space-s);
    border: 1px solid #ddd;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.radio-label:hover {
    border-color: var(--accent-gold);
    background-color: #fffaf0;
}

.radio-label input {
    margin: 0;
}

.radio-label input:checked + span {
    font-weight: bold;
    color: var(--primary-red);
}

/* Radio Cards (Selection Phase 4/5) */
.radio-group-horizontal {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.radio-card {
    flex: 1;
    min-width: 100px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 0.6rem;
    text-align: center;
    background: var(--white);
    transition: all 0.2s ease;
}

.radio-card input {
    display: none;
}

.radio-card span {
    font-weight: bold;
    color: #64748b;
}

.radio-card:has(input:checked) {
    border-color: var(--primary-red);
    background: #fff5f5;
}

.radio-card:has(input:checked) span {
    color: var(--primary-red);
}

/* Inline Switches */
.switch-inline {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    cursor: pointer;
    font-size: 0.85rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.3rem var(--space-s);
    border-radius: 20px;
    transition: all 0.2s;
}

.switch-inline:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.switch-inline input {
    cursor: pointer;
    margin: 0;
}

.switch-label {
    font-weight: 500;
}

/* Selection Grid (Shared for Partners/DJs/POIs) */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-s);
}

.scrollable-selection {
    max-height: 400px;
    overflow-y: auto;
    padding: var(--space-s);
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
}

.selection-grid.mini {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    max-height: 250px;
}

.selection-item {
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: var(--space-s);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.selection-item:hover {
    border-color: var(--primary-red);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.selection-item.active {
    border-color: var(--primary-red);
    background: #fff5f5;
    box-shadow: 0 0 0 2px var(--primary-red);
}

.selection-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-red);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.selection-item.active .selection-indicator {
    opacity: 1;
    transform: scale(1);
}

/* Accordion in Forms */
.accordion {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-m);
    overflow: hidden;
}
.accordion-header {
    background: #f8fafc;
    padding: 1rem 1.25rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid transparent;
}
.accordion.active .accordion-header {
    border-bottom-color: #e2e8f0;
    background: #fff;
}
.accordion-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}
.accordion-icon::after {
    content: '▼';
    font-size: 0.8rem;
    color: #94a3b8;
    transition: transform 0.3s;
    display: inline-block;
}
.accordion.active .accordion-icon::after {
    transform: rotate(180deg);
}
.accordion-content {
    display: none;
    padding: var(--space-m);
}
.accordion.active .accordion-content {
    display: block;
}
