/**
 * Tire Search Form Styles
 * 
 * Class-based CSS for the tire search form component
 * 
 * @package Blocksy_Child
 */

/* Main Wrapper */
.autohjul-tire-search-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Form Container */
.autohjul-tire-search-form {
    background-color: #EBF2FA;
    border-radius: 8px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Fields Container */
.autohjul-tire-search-form__fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Individual Field */
.autohjul-tire-search-form__field {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    align-items: flex-start !important;
}

/* Field Labels */
.autohjul-tire-search-form__label {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin-bottom: 8px !important;
    display: block !important;
    line-height: 1.4 !important;
    text-align: left !important;
}

/* Select Dropdowns */
.autohjul-tire-search-form__select {
    width: 100%;
    padding: 6px 10px;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.autohjul-tire-search-form__select:hover {
    border-color: #999;
}

.autohjul-tire-search-form__select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.autohjul-tire-search-form__select:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Specific Field Styles */
.autohjul-tire-search-form__field--bred {
    grid-column: 1;
}

.autohjul-tire-search-form__field--profil {
    grid-column: 2;
}

.autohjul-tire-search-form__field--dimension {
    grid-column: 1;
}

.autohjul-tire-search-form__field--dacktyp {
    grid-column: 2;
}

.autohjul-tire-search-form__field--antal-bultar {
    grid-column: 2;
}

.autohjul-tire-search-form__field--bultcirkel {
    grid-column: 1;
}

.autohjul-tire-search-form__field--falgar-typ {
    grid-column: 2;
}

/* Actions Container */
.autohjul-tire-search-form__actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 8px;
}

/* Submit Button */
.autohjul-tire-search-form__button {
    padding: 10px 26px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    background-color: #000000 !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease, transform 0.2s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    min-width: 80px !important;
}

.autohjul-tire-search-form__button:hover {
    background-color: #000000 !important;
    transform: translateY(-1px) !important;
}

.autohjul-tire-search-form__button:active {
    transform: translateY(0) !important;
    background-color: #000000 !important;
}

.autohjul-tire-search-form__button:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2) !important;
    background-color: #000000 !important;
}

.autohjul-tire-search-form__button:disabled {
    background-color: #999 !important;
    cursor: not-allowed !important;
    transform: none;
}

/* Loading State */
.autohjul-tire-search-form__select--loading {
    position: relative;
    color: transparent;
}

.autohjul-tire-search-form__select--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .autohjul-tire-search-form__fields {
        grid-template-columns: 1fr;
    }
    
    .autohjul-tire-search-form__field--bred,
    .autohjul-tire-search-form__field--profil,
    .autohjul-tire-search-form__field--dimension,
    .autohjul-tire-search-form__field--dacktyp,
    .autohjul-tire-search-form__field--antal-bultar,
    .autohjul-tire-search-form__field--bultcirkel,
    .autohjul-tire-search-form__field--falgar-typ {
        grid-column: 1;
    }
    
    .autohjul-tire-search-form {
        padding: 20px;
    }
    
    .autohjul-tire-search-form__button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .autohjul-tire-search-form {
        padding: 16px;
    }
    
    .autohjul-tire-search-form__select {
        padding: 10px 14px;
        padding-right: 36px;
        font-size: 14px;
    }
    
    .autohjul-tire-search-form__label {
        font-size: 13px !important;
        font-weight: 600 !important;
    }
}

/* Error State */
.autohjul-tire-search-form__field--error .autohjul-tire-search-form__select {
    border-color: #dc3545;
}

.autohjul-tire-search-form__field--error .autohjul-tire-search-form__label {
    color: #dc3545;
}

.autohjul-tire-search-form__error {
    display: block;
    color: #dc3545;
    font-size: 13px;
    margin-top: 4px;
    line-height: 1.4;
}

/* Success State */
.autohjul-tire-search-form__field--success .autohjul-tire-search-form__select {
    border-color: #28a745;
}
