/* Fashion Search Engine Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 2.5em;
}

.language-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.lang-btn {
    padding: 8px 16px;
    border: 2px solid #3498db;
    background: white;
    color: #3498db;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn:hover, .lang-btn.active {
    background: #3498db;
    color: white;
}

/* Search Section */
.search-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 15px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: #ecf0f1;
    color: #7f8c8d;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.tab-btn:hover, .tab-btn.active {
    background: #3498db;
    color: white;
}

.tab-content {
    display: none;
}

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

/* Text Search */
.text-search {
    display: flex;
    gap: 15px;
    align-items: center;
}

#text-query {
    flex: 1;
    padding: 15px;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#text-query:focus {
    outline: none;
    border-color: #3498db;
}

/* Image Upload */
.image-upload-area {
    border: 2px dashed #bdc3c7;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s;
    position: relative;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-upload-area.dragover {
    border-color: #3498db;
    background-color: #ebf3fd;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    font-size: 48px;
    opacity: 0.6;
}

.upload-btn {
    padding: 12px 24px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.upload-btn:hover {
    background: #2980b9;
}

.image-preview {
    position: relative;
    display: inline-block;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.remove-btn:hover {
    background: #c0392b;
}

/* Combined Search */
.combined-search {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#combined-text-query {
    padding: 15px;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#combined-text-query:focus {
    outline: none;
    border-color: #3498db;
}

/* Search Button */
.search-btn {
    padding: 15px 30px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    align-self: center;
}

.search-btn:hover:not(:disabled) {
    background: #219a52;
    transform: translateY(-2px);
}

.search-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.spinner {
    border: 4px solid #ecf0f1;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Results Section */
.results-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.results-header h2 {
    color: #2c3e50;
}

.results-info {
    display: flex;
    flex-direction: column;
    text-align: right;
    font-size: 14px;
    color: #7f8c8d;
}

.top-results, .extended-results {
    margin-bottom: 30px;
}

.top-results h3, .extended-results h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.extended-results h3 {
    color: #7f8c8d;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.result-item {
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
    background: white;
}

.result-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.result-item.top-result {
    border-color: #3498db;
    background: #fbfcfd;
}

.result-item.top-result::after {
    content: "TOP";
    position: absolute;
    top: 5px;
    right: 5px;
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}

.result-item {
    position: relative;
}

.result-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.result-info h4 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 16px;
}

.result-info p {
    margin: 4px 0;
    font-size: 14px;
    color: #7f8c8d;
}

.result-info .score {
    color: #27ae60;
    font-weight: 500;
}

.result-info .color-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #ecf0f1;
    border-radius: 3px;
    font-size: 12px;
    margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .search-tabs {
        flex-direction: column;
    }
    
    .text-search {
        flex-direction: column;
    }
    
    .results-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
}