/* Modern K-Food AI Interface - Wide Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f8f9fa;
    color: #212529;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    font-size: 14px;
}

.container {
    width: 95%;
    max-width: 2000px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    min-height: calc(100vh - 40px);
}

.column {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    overflow: hidden;
}

h1 {
    color: #212529;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    border-bottom: 2px solid #495057;
    padding-bottom: 10px;
}

h2 {
    color: #343a40;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

h3 {
    color: #495057;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

h4 {
    color: #6c757d;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

p {
    margin: 10px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

button {
    background-color: #495057;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin: 5px;
}

button:hover {
    background-color: #343a40;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
}

.parameter-group {
    margin-bottom: 20px;
}

.parameter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.parameter-group input,
.parameter-group textarea,
.parameter-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    background-color: #fff;
}

.parameter-group input:focus,
.parameter-group textarea:focus,
.parameter-group select:focus {
    outline: none;
    border-color: #495057;
    box-shadow: 0 0 0 3px rgba(73, 80, 87, 0.1);
}

.parameter-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
    font-family: inherit;
}

/* Tab System */
.tab-container {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    margin-bottom: 0;
    border-bottom: 2px solid #e9ecef;
}

.tab-button {
    padding: 12px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    margin: 0 2px -2px 0;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.2s ease;
}

.tab-button.active {
    background: #495057;
    color: white;
    border-bottom: 2px solid #495057;
}

.tab-button:hover:not(.active) {
    background: #f8f9fa;
    color: #495057;
}

.tab-content {
    display: none;
    padding: 30px 0;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* Stats Section */
.stats-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.stats-subsection {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
}

.stats-item {
    display: inline-block;
    margin: 5px 15px 5px 0;
    padding: 8px 16px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #495057;
    font-size: 13px;
    font-weight: 500;
}

/* Search Results */
.search-results {
    max-height: 500px;
    overflow-y: auto;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.result-item {
    margin-bottom: 20px;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #6c757d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-item strong {
    color: #212529;
    font-weight: 600;
}

.result-item p {
    margin: 8px 0;
    color: #495057;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.result-item small {
    color: #6c757d;
    font-size: 12px;
}

/* Pre and Code Blocks */
pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #495057;
    max-width: 100%;
    overflow-x: auto;
}

/* Range Inputs */
input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #495057;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #343a40;
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #495057;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Spinner Overlay */
#spinner-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#spinner-overlay .spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #495057;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom Scrollbar */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #6c757d;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #495057;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .container {
        width: 96%;
        gap: 30px;
    }
}

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
        gap: 30px;
        width: 95%;
    }
    
    .column {
        padding: 25px;
    }
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        gap: 20px;
        margin: 10px auto;
    }
    
    .column {
        padding: 20px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .tab-button {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .stats-item {
        display: block;
        margin: 8px 0;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        margin: 5px auto;
    }
    
    .column {
        padding: 15px;
    }
    
    h1 {
        font-size: 18px;
    }
    
    button {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .parameter-group input,
    .parameter-group textarea,
    .parameter-group select {
        padding: 10px;
    }
}
