/**
 * Dokan Rwanda Registration - CSS Styling
 * Custom styles for location fields in registration form
 */

/* Location Fields Container */
.dokan-rwanda-location-fields,
.dokan-rwanda-producer-fields {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
}

.dokan-rwanda-location-fields h3,
.dokan-rwanda-producer-fields h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #f05025;
    padding-bottom: 10px;
}

/* Form Row Styling */
.dokan-rwanda-location-fields .form-row,
.dokan-rwanda-producer-fields .form-row {
    margin-bottom: 15px;
}

.dokan-rwanda-location-fields .form-row:last-child,
.dokan-rwanda-producer-fields .form-row:last-child {
    margin-bottom: 0;
}

/* Label Styling */
.dokan-rwanda-location-fields label,
.dokan-rwanda-producer-fields label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
}

.dokan-rwanda-location-fields label .required,
.dokan-rwanda-producer-fields label .required {
    color: #f05025;
    font-weight: bold;
    margin-left: 3px;
}

/* Select Field Styling */
.dokan-rwanda-location-fields select,
.dokan-rwanda-producer-fields select,
.dokan-rwanda-producer-fields input[type="text"],
.dokan-rwanda-producer-fields input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dokan-rwanda-location-fields select,
.dokan-rwanda-producer-fields select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" 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;
}

.dokan-rwanda-producer-fields input[type="text"],
.dokan-rwanda-producer-fields input[type="number"] {
    cursor: text;
}

.dokan-rwanda-location-fields select:focus,
.dokan-rwanda-producer-fields select:focus,
.dokan-rwanda-producer-fields input:focus {
    outline: none;
    border-color: #f05025;
    box-shadow: 0 0 5px rgba(240, 80, 37, 0.2);
}

.dokan-rwanda-location-fields select:disabled,
.dokan-rwanda-producer-fields select:disabled,
.dokan-rwanda-producer-fields input:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.dokan-rwanda-location-fields select:hover:not(:disabled),
.dokan-rwanda-producer-fields select:hover:not(:disabled),
.dokan-rwanda-producer-fields input:hover:not(:disabled) {
    border-color: #bbb;
}

/* Loading State */
.dokan-rwanda-location-fields select option:first-child {
    color: #999;
}

/* Responsive Design */
@media (min-width: 768px) {
    .dokan-rwanda-location-fields {
        padding: 25px 30px;
    }
    
    .dokan-rwanda-location-fields .form-row {
        margin-bottom: 20px;
    }
}

/* Two Column Layout for Larger Screens */
@media (min-width: 992px) {
    .dokan-rwanda-location-fields {
        display: flex;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .dokan-rwanda-location-fields h3 {
        width: 100%;
    }
    
    .dokan-rwanda-location-fields .form-row {
        width: calc(50% - 7.5px);
        margin-bottom: 0;
    }
}

/* Error State */
.dokan-rwanda-location-fields select.error,
.dokan-rwanda-location-fields select:invalid:not(:focus):not(:disabled) {
    border-color: #dc3545;
}

.dokan-rwanda-location-fields .error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Success State */
.dokan-rwanda-location-fields select.success {
    border-color: #28a745;
}

/* Custom Dokan Form Integration */
.dokan-form-group .dokan-rwanda-location-fields,
.woocommerce-form-row .dokan-rwanda-location-fields {
    background: transparent;
    border: none;
    padding: 0;
}

/* Registration Page Specific Styles */
.woocommerce-account .dokan-rwanda-location-fields {
    margin: 30px 0;
}

.dokan-vendor-registration-form .dokan-rwanda-location-fields {
    margin-bottom: 30px;
}

/* Accessibility Improvements */
.dokan-rwanda-location-fields select:focus-visible {
    outline: 2px solid #f05025;
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .dokan-rwanda-location-fields {
        background: #f5f5f5;
        border-color: #ddd;
    }
    
    .dokan-rwanda-location-fields h3 {
        color: #333;
    }
    
    .dokan-rwanda-location-fields label {
        color: #555;
    }
    
    .dokan-rwanda-location-fields select {
        background-color: #fff;
        border-color: #ddd;
        color: #333;
        background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    }
    
    .dokan-rwanda-location-fields select:disabled {
        background-color: #f5f5f5;
        color: #999;
    }
}

/* Animation for Field Population */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dokan-rwanda-location-fields select:not(:disabled) {
    animation: fadeIn 0.3s ease;
}

/* Trading Report Form Styles */
.dokan-trading-report-area {
    background: #fff;
    padding: 30px;
    border-radius: 5px;
}

.dokan-trading-report-form,
.dokan-trading-report-list {
    margin: 30px 0;
}

.dokan-trading-report-form h2,
.dokan-trading-report-list h2 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #f05025;
    padding-bottom: 10px;
}

.form-section {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #555;
    font-size: 16px;
}

.form-section .form-row {
    margin-bottom: 15px;
}

.form-section .form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
    font-size: 14px;
}

.form-section .form-row label .required {
    color: #f05025;
    margin-left: 3px;
}

.form-section input[type="text"],
.form-section input[type="number"],
.form-section input[type="date"],
.form-section select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.form-section input:focus,
.form-section select:focus {
    outline: none;
    border-color: #f05025;
    box-shadow: 0 0 5px rgba(240, 80, 37, 0.2);
}

.form-actions {
    text-align: right;
    margin-top: 20px;
}

.dokan-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dokan-btn-success {
    background: #f05025;
    color: #fff;
}

.dokan-btn-success:hover {
    background: #d9441f;
}

.dokan-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.dokan-table thead {
    background: #f8f9fa;
}

.dokan-table th,
.dokan-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.dokan-table th {
    font-weight: 600;
    color: #555;
}

.dokan-alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

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

.dokan-alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Print Styles */
@media print {
    .dokan-rwanda-location-fields,
    .dokan-rwanda-producer-fields {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}
