/**
 * Inter-Sprint Frontend Styles
 */

/* ===== General Styles ===== */
.inter-sprint-search-container,
.inter-sprint-size-search,
.inter-sprint-article-search {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Search Form Styles ===== */
.inter-sprint-search-form {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.search-field {
    flex: 1;
    min-width: 150px;
}

.search-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.search-field select,
.search-field input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.search-field.size-field {
    flex: 2;
    min-width: 300px;
}

.size-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.size-inputs select {
    flex: 1;
}

.size-inputs span {
    font-weight: bold;
    color: #666;
}

.search-field.search-button {
    flex: 0 0 auto;
}

.search-field.search-button .button {
    padding: 10px 25px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.search-field.search-button .button:hover {
    background: #005a87;
}

/* ===== Size Search Specific ===== */
.inter-sprint-size-search {
    text-align: center;
}

.size-search-form {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

.tire-diagram {
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
    border: 8px solid #333;
    border-radius: 50%;
    position: relative;
    background: #fff;
}

.size-label {
    position: absolute;
    background: #0073aa;
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
}

.size-label.width {
    top: 50%;
    left: -60px;
    transform: translateY(-50%);
}

.size-label.profile {
    top: 20%;
    right: 20%;
}

.size-label.diameter {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #333;
}

.size-selectors {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.selector-group {
    text-align: left;
}

.selector-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.selector-group select {
    min-width: 120px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* ===== Article Search ===== */
.article-search-form {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
}

.search-input-group {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.article-code-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

.article-code-input:focus {
    border-color: #0073aa;
    outline: none;
}

.hint {
    text-align: center;
    color: #666;
    margin-top: 15px;
    font-size: 14px;
}

/* ===== Results Styles ===== */
.inter-sprint-results {
    position: relative;
}

.loading-indicator {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* ===== Product Grid ===== */
.tire-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.tire-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease;
}

.tire-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Tire Product Image */
.tire-image {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tire-image img {
    max-width: 100%;
    max-height: 150px;
    height: auto;
    width: auto;
    object-fit: contain;
}

.tire-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.tire-brand {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 1px;
}

.tire-stock {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.tire-stock.in-stock {
    background: #d4edda;
    color: #155724;
}

.tire-stock.low-stock {
    background: #fff3cd;
    color: #856404;
}

.tire-stock.out-stock {
    background: #f8d7da;
    color: #721c24;
}

.tire-model {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.tire-size {
    font-size: 16px;
    color: #0073aa;
    font-weight: 600;
    margin-bottom: 15px;
}

.tire-specs {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #666;
}

.spec-label {
    font-weight: 600;
}

.spec-label.fuel-a,
.spec-label.wet-a {
    color: #28a745;
}

.spec-label.fuel-b,
.spec-label.wet-b {
    color: #ffc107;
}

.spec-label.fuel-c,
.spec-label.wet-c {
    color: #dc3545;
}

.tire-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.tire-price {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.tire-price .currency {
    font-size: 14px;
    color: #666;
}

.add-to-cart-btn {
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.add-to-cart-btn:hover {
    background: #005a87;
}

.add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ===== No Results ===== */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 20px 0;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.no-results h3 {
    margin: 0 0 10px;
    color: #333;
}

.no-results p {
    margin: 0;
    color: #666;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .search-row {
        flex-direction: column;
    }
    
    .search-field,
    .search-field.size-field {
        min-width: 100%;
    }
    
    .size-inputs {
        flex-wrap: wrap;
    }
    
    .size-selectors {
        flex-direction: column;
        align-items: center;
    }
    
    .tire-results-grid {
        grid-template-columns: 1fr;
    }
}
