/**
 * Woo Hdayakom Frontend Styles
 * Compatible with Woodmart Theme
 */

/* Form Container */
.woo-hdayakom-form-container {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.woo-hdayakom-form-container h3 {
    color: #333;
    font-size: 1.4em;
    margin-bottom: 15px;
    font-weight: 600;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* Form Fields */
.woo-hdayakom-field {
    margin-bottom: 20px;
}

.woo-hdayakom-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 0.95em;
}

.woo-hdayakom-field label.required::after {
    content: ' *';
    color: #e74c3c;
    font-weight: bold;
}

/* Form Controls */
.woo-hdayakom-form .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
    color: #333;
}

.woo-hdayakom-form .form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.woo-hdayakom-form .form-control::placeholder {
    color: #999;
    opacity: 1;
}

/* Textarea */
.woo-hdayakom-form textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

/* File Upload */
.file-upload-container {
    position: relative;
}

.file-input {
    cursor: pointer;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    text-align: center;
    transition: all 0.3s ease;
}

.file-input:hover {
    border-color: #0073aa;
    background: #f8f9fa;
}

.file-upload-preview {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.uploaded-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.file-name {
    flex: 1;
    font-size: 0.9em;
    color: #333;
    word-break: break-all;
}

.remove-file {
    padding: 6px 12px;
    font-size: 0.8em;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

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

/* Progress Bar */
.upload-progress {
    margin-top: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #005a87);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8em;
    color: #666;
    text-align: center;
}

/* Select Dropdown */
.woo-hdayakom-form select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 40px;
    appearance: none;
}

/* Radio and Checkbox */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 0;
}

.form-check-input {
    margin: 0;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #0073aa;
}

.form-check-label {
    cursor: pointer;
    font-size: 0.9em;
    color: #333;
    flex: 1;
}

/* Date Picker */
.woo-hdayakom-form input[type="date"].form-control {
    padding: 11px 15px;
}

/* Buttons */
.woo-hdayakom-form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #0073aa;
    color: white;
}

.woo-hdayakom-form .btn:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.woo-hdayakom-form .btn:active {
    transform: translateY(0);
}

/* Error States */
.form-control.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.error-message {
    color: #e74c3c;
    font-size: 0.8em;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.error-message::before {
    content: "⚠";
    font-size: 1.2em;
}

/* Success States */
.form-control.success {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.success-message {
    color: #27ae60;
    font-size: 0.8em;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.success-message::before {
    content: "✓";
    font-size: 1.2em;
}

/* Loading States */
.form-control.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

/* RTL Support */
[dir="rtl"] .woo-hdayakom-form {
    text-align: right;
}

[dir="rtl"] .woo-hdayakom-form .form-control {
    text-align: right;
}

[dir="rtl"] .form-check {
    flex-direction: row-reverse;
}

[dir="rtl"] .uploaded-file {
    flex-direction: row-reverse;
}

[dir="rtl"] .woo-hdayakom-form select.form-control {
    background-position: left 12px center;
    padding-left: 40px;
    padding-right: 15px;
}

/* Woodmart Theme Compatibility */
.woo-hdayakom-form .form-control {
    font-family: inherit;
    line-height: 1.5;
}

.woo-hdayakom-form .btn {
    font-family: inherit;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
}

/* Responsive Design */
@media (max-width: 768px) {
    .woo-hdayakom-form-container {
        padding: 20px;
        margin: 15px 0;
    }
    
    .woo-hdayakom-form-container h3 {
        font-size: 1.2em;
    }
    
    .woo-hdayakom-form .form-control {
        padding: 14px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .uploaded-file {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .remove-file {
        align-self: flex-end;
    }
    
    .form-check {
        padding: 10px 0;
    }
}

@media (max-width: 480px) {
    .woo-hdayakom-form-container {
        padding: 15px;
    }
    
    .woo-hdayakom-form .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .woo-hdayakom-form-container {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .woo-hdayakom-form-container h3 {
        color: #e2e8f0;
        border-bottom-color: #4a5568;
    }
    
    .woo-hdayakom-field label {
        color: #e2e8f0;
    }
    
    .woo-hdayakom-form .form-control {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .woo-hdayakom-form .form-control:focus {
        border-color: #0073aa;
        box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
    }
    
    .woo-hdayakom-form .form-control::placeholder {
        color: #a0aec0;
    }
    
    .form-check-label {
        color: #e2e8f0;
    }
    
    .file-upload-preview {
        background: #4a5568;
        border-color: #718096;
    }
    
    .file-name {
        color: #e2e8f0;
    }
} 