/* HersFilo Forms Styling */

.hersfilo-form {
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.hersfilo-field-wrapper {
    margin-bottom: 20px;
}

.hersfilo-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.hersfilo-required {
    color: #e74c3c;
    margin-left: 3px;
}

.hersfilo-input,
.hersfilo-textarea,
.hersfilo-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.hersfilo-input:focus,
.hersfilo-textarea:focus,
.hersfilo-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.hersfilo-input:invalid,
.hersfilo-textarea:invalid,
.hersfilo-select:invalid {
    border-color: #e74c3c;
}

.hersfilo-textarea {
    resize: vertical;
    min-height: 100px;
}

.hersfilo-select {
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23666" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    appearance: none;
    cursor: pointer;
}

/* Checkbox and Radio Styling */
.hersfilo-checkbox-wrapper,
.hersfilo-radio-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.hersfilo-checkbox,
.hersfilo-radio {
    margin-right: 10px;
    transform: scale(1.2);
}

.hersfilo-checkbox-label,
.hersfilo-radio-label {
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
    user-select: none;
}

.hersfilo-checkbox-group,
.hersfilo-radio-group {
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    padding: 15px;
    background: #f8f9fa;
}

.hersfilo-checkbox-group legend,
.hersfilo-radio-group legend {
    padding: 0 10px;
    font-weight: 600;
    color: #2c3e50;
    background: #fff;
}

/* Submit Button */
.hersfilo-submit-wrapper {
    margin-top: 30px;
    text-align: center;
}

.hersfilo-submit-btn {
    background: #3498db;
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    min-width: 200px;
}

.hersfilo-submit-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.hersfilo-submit-btn:active {
    transform: translateY(0);
}

/* Success and Error Messages */
.hersfilo-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-weight: 500;
}

.hersfilo-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.hersfilo-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.hersfilo-error ul {
    margin: 0;
    padding-left: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hersfilo-form {
        margin: 10px;
        padding: 20px;
    }
    
    .hersfilo-input,
    .hersfilo-textarea,
    .hersfilo-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .hersfilo-submit-btn {
        width: 100%;
        padding: 15px 20px;
    }
}

/* Field Type Specific Styles */
.hersfilo-field-text input[type="date"],
.hersfilo-field-text input[type="time"],
.hersfilo-field-text input[type="datetime-local"] {
    cursor: pointer;
}

/* Date fields side by side */
.hersfilo-form .date-fields-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.hersfilo-form .date-fields-row .hersfilo-field-wrapper {
    flex: 1;
    margin-bottom: 0;
}

.hersfilo-form .date-fields-row .hersfilo-field-date {
    flex: 1;
    margin-bottom: 0;
}

/* Responsive: Stack date fields on mobile */
@media (max-width: 480px) {
    .hersfilo-form .date-fields-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .hersfilo-form .date-fields-row .hersfilo-field-wrapper {
        margin-bottom: 15px;
    }
    
    .hersfilo-form .date-fields-row .hersfilo-field-wrapper:last-child {
        margin-bottom: 0;
    }
}

/* Two-column layout for teklif form with car preview */
.hersfilo-teklif-container {
    display: flex;
    gap: 20px;
    margin: 20px auto;
    padding: 0 20px;
}

.hersfilo-form-column {
    flex: 2;
    min-width: 0; /* Prevent overflow */
}

.hersfilo-preview-column {
    flex: 0 0 350px; /* Fixed width sidebar */
}

/* Car preview styling */
.hersfilo-car-preview {
    position: sticky;
    top: 20px;
}

.car-preview-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e7e6e6;
    padding: 24px;
    transition: all 0.3s ease;
}

.car-preview-image {
    margin-bottom: 16px;
    border-radius: 15px;
    overflow: hidden;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.car-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
}

.car-icon {
    font-size: 48px;
    opacity: 0.5;
}

.car-preview-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px 0;
    text-align: center;
    color: #2c3e50;
}

.car-preview-description {
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
}

.car-details {
    margin: 16px 0;
}

.car-detail {
    margin: 8px 0;
    font-size: 14px;
    color: #555;
}

.car-detail strong {
    color: #2c3e50;
    font-weight: 600;
}

.car-price-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.car-price {
    display: flex;
    flex-direction: column;
}

.price {
    font-size: 24px;
    font-weight: 700;
    color: #3498db;
    line-height: 1;
}

.period {
    font-size: 11px;
    color: #7f8c8d;
    margin-top: 2px;
}

.car-status .status {
    font-size: 13px;
    font-weight: 600;
}

.car-status .status.available {
    color: #27ae60;
}

.car-status .status.unavailable {
    color: #e74c3c;
}

/* Loading and error states */
.car-preview-loading {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-style: italic;
}

.car-preview-error {
    text-align: center;
    padding: 40px 20px;
    color: #e74c3c;
}

.error-icon {
    font-size: 32px;
    margin-bottom: 16px;
}

/* Animation for preview updates */
.hersfilo-car-preview.preview-updated {
    animation: previewUpdate 0.3s ease;
}

@keyframes previewUpdate {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive design for teklif container */
@media (max-width: 1024px) {
    .hersfilo-preview-column {
        flex: 0 0 350px;
    }
}

@media (max-width: 768px) {
    .hersfilo-teklif-container {
        flex-direction: column;
        gap: 20px;
        padding: 0 10px;
    }
    
    .hersfilo-form-column,
    .hersfilo-preview-column {
        flex: none;
        width: 100%;
    }
    
    .hersfilo-car-preview {
        position: static;
        order: -1; /* Show preview above form on mobile */
    }
    
    .car-preview-image {
        height: 180px;
    }
}

/* Loading State */
.hersfilo-form.loading .hersfilo-submit-btn {
    background: #bdc3c7;
    cursor: not-allowed;
    pointer-events: none;
}

.hersfilo-form.loading .hersfilo-submit-btn:after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Custom checkbox styling */
.hersfilo-checkbox {
    position: relative;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #3498db;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    transform: none;
}

.hersfilo-checkbox:checked {
    background: #3498db;
}

.hersfilo-checkbox:checked:after {
    content: '✓';
    position: absolute;
    left: 2px;
    top: -2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Custom radio styling */
.hersfilo-radio {
    position: relative;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #3498db;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    transform: none;
}

.hersfilo-radio:checked {
    background: #3498db;
}

.hersfilo-radio:checked:after {
    content: '';
    position: absolute;
    left: 4px;
    top: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}