/* ====================================================================
   WYSZUKIWANIE KRZYŻOWE - STYLES
   ==================================================================== */

.cross-search-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* Controls Legend - KOMPAKTOWA WERSJA Z KARTAMI */
.controls-legend-compact {
    margin-bottom: 24px;
}

.legend-toggle {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.legend-toggle:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.legend-toggle span {
    flex: 1;
    text-align: left;
}

.legend-arrow {
    transition: transform 0.3s;
}

.legend-content {
    margin-top: 12px;
    animation: slideDown 0.3s ease-out;
}

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

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.legend-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 14px;
    transition: all 0.3s;
    cursor: pointer;
}

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

.legend-card-icon {
    min-width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-direction: column;
    gap: 4px;
}

.legend-icon-star {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
}

.legend-icon-remove {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.legend-symbol {
    font-size: 24px;
    font-weight: bold;
}

.mini-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.3);
}

.mini-badge-green {
    background: rgba(76, 175, 80, 0.9);
}

.mini-badge-orange {
    background: rgba(255, 152, 0, 0.9);
}

.legend-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legend-card-body strong {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: block;
}

.legend-card-body p {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.legend-link {
    font-size: 12px;
    color: #667eea;
    font-weight: 500;
    margin-top: 4px;
}

/* Input Panel */
.cross-search-input-panel {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.input-group-main {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.symptom-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

.symptom-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.input-hint {
    margin: 0;
    padding-left: 4px;
    font-size: 13px;
    color: #666;
}

.input-hint i {
    margin-right: 6px;
    color: #4CAF50;
}

/* Criteria Chips Container */
.criteria-chips-container {
    min-height: 80px;
    background: #f8f9fa;
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.criteria-chips-container:empty::before {
    content: 'Dodane objawy pojawią się tutaj...';
    color: #999;
    font-style: italic;
    width: 100%;
    text-align: center;
    padding: 20px 0;
}

/* Chip (objaw) */
.criterion-chip {
    background: white;
    border: 2px solid #4CAF50;
    border-radius: 24px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.criterion-chip:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.chip-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.chip-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 8px;
    border-left: 1px solid #e0e0e0;
}

/* Chip buttons */
.chip-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chip-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.chip-btn.active {
    background: #4CAF50;
    color: white;
}

.chip-btn.remove {
    color: #f44336;
}

.chip-btn.remove:hover {
    background: #ffebee;
}

/* Weight control */
.weight-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.weight-display {
    min-width: 32px;
    text-align: center;
    font-weight: 600;
    color: #4CAF50;
    font-size: 13px;
}

/* Advanced Filters */
.advanced-filters {
    margin-bottom: 24px;
}

#toggleFiltersBtn {
    background: none;
    border: none;
    color: #4CAF50;
    font-weight: 500;
    padding: 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

#toggleFiltersBtn:hover {
    color: #45a049;
}

#toggleFiltersBtn i.fa-chevron-down {
    transition: transform 0.3s;
}

#toggleFiltersBtn.active i.fa-chevron-down {
    transform: rotate(180deg);
}

.filters-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: slideDown 0.3s ease-out;
}

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

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item.full-width {
    grid-column: 1 / -1;
}

.filter-item label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.filter-select {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.filter-select:focus {
    outline: none;
    border-color: #4CAF50;
}

#minMatchesSlider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
}

#minMatchesSlider::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
}

#minMatchesValue {
    font-weight: 600;
    color: #4CAF50;
    font-size: 16px;
}

/* Search Action Panel */
.search-action-panel {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 32px;
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-success {
    background: #4CAF50;
    color: white;
    border: none;
}

.btn-success:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-success:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-outline {
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-outline:hover {
    border-color: #4CAF50;
    color: #4CAF50;
}

/* Results Container */
.cross-search-results {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.results-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

/* Results Table */
.results-table-container {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table thead {
    background: #f8f9fa;
}

.results-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    border-bottom: 2px solid #e0e0e0;
}

.results-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.results-table tbody tr {
    transition: background 0.2s;
}

.results-table tbody tr:hover {
    background: #f8f9fa;
}

.remedy-name {
    font-weight: 600;
    color: #4CAF50;
    cursor: pointer;
    transition: color 0.2s;
}

.remedy-name:hover {
    color: #45a049;
    text-decoration: underline;
}

.score-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
}

.confidence-high {
    background: #4CAF50;
    color: white;
}

.confidence-medium {
    background: #FFA726;
    color: white;
}

.confidence-low {
    background: #e0e0e0;
    color: #666;
}

.matches-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: #666;
}

.matches-list li {
    padding: 2px 0;
}

/* Placeholder */
.cross-search-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.cross-search-placeholder i {
    color: #e0e0e0;
    margin-bottom: 16px;
}

.cross-search-placeholder p {
    font-size: 16px;
    margin: 0;
}

/* Modal z przykładami */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10001;
}

.modal-header {
    padding: 24px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.example-section {
    margin-bottom: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.example-section h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.example-section p {
    margin: 0 0 16px 0;
    color: #666;
    line-height: 1.6;
}

.example-box {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
    line-height: 1.8;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.badge-green {
    background: #4CAF50;
    color: white;
}

.badge-orange {
    background: #FF9800;
    color: white;
}

.badge-purple {
    background: #9C27B0;
    color: white;
}

.result-ok {
    color: #4CAF50;
    font-weight: 600;
}

.result-fail {
    color: #f44336;
    font-weight: 600;
}

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

.example-section.tip h3 {
    color: white;
}

.example-section.tip p {
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
}

.filter-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #999;
}

/* Toggle Switch */
.filter-item-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-switch-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #667eea;
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 1px #667eea;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-label-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toggle-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    user-select: none;
}

/* Slider group */
.slider-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-group input[type="range"] {
    flex: 1;
}

.slider-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    color: #667eea;
}

/* Modal szczegółów leku */
.modal-large {
    max-width: 900px;
}

.remedy-summary {
    display: flex;
    gap: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 24px;
}

.remedy-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.remedy-stat label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
}

.remedy-section {
    margin-bottom: 24px;
}

.remedy-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.remedy-matches-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.match-item {
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    margin-bottom: 8px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.match-item strong {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.match-rank {
    font-size: 13px;
    color: #667eea;
    font-weight: 600;
    margin-left: 12px;
}

.match-weight {
    font-size: 13px;
    color: #999;
    margin-left: 8px;
}

.remedy-arguments {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.argument-item {
    padding: 10px 14px;
    background: #e8f5e9;
    border-left: 3px solid #4CAF50;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.argument-item i {
    color: #4CAF50;
    margin-top: 2px;
}

.remedy-quotes {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mm-quote {
    border-left: 4px solid #FF9800;
    padding: 16px;
    background: #fff3e0;
    border-radius: 4px;
    margin: 0;
}

.mm-quote p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #333;
    font-style: italic;
    line-height: 1.6;
}

.mm-quote cite {
    font-size: 12px;
    color: #FF9800;
    font-style: normal;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .legend-row {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 16px;
        gap: 8px;
    }
    
    .legend-cell-icon {
        min-width: auto;
    }
    
    .legend-cell-title {
        width: 100%;
    }
    
    .legend-cell-action {
        width: 100%;
        align-items: flex-start;
    }
    
    .legend-info-btn {
        width: 100%;
        border-radius: 8px;
        height: 36px;
    }
    
    .input-group-main {
        flex-direction: column;
    }
    
    .search-action-panel {
        flex-direction: column;
    }
    
    .btn-large {
        width: 100%;
    }
    
    .results-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .criterion-chip {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }
    
    .chip-controls {
        border-left: none;
        border-top: 1px solid #e0e0e0;
        padding-left: 0;
        padding-top: 8px;
        width: 100%;
        justify-content: space-between;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
}
