/**
 * Public CSS for Demande de Devis plugin
 * Modern Design Version
 */

/* Variables */
:root {
    --primary-color: #4a6cf7;
    --primary-hover: #3a5ce4;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #e9ecef;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --input-height: 50px;
}

/* Form Container */
.demande-devis-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.demande-devis-form-title {
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--dark-color);
    text-align: center;
    font-weight: 600;
}

/* Form Messages */
.demande-devis-form-message {
    padding: 15px;
    margin-bottom: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.demande-devis-form-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.demande-devis-form-error {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

/* Form Layout */
.demande-devis-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.demande-devis-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 0;
}

.demande-devis-form-field {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Form Elements */
.demande-devis-form label {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
}

.demande-devis-form label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.demande-devis-form input[type="text"],
.demande-devis-form input[type="email"],
.demande-devis-form input[type="tel"],
.demande-devis-form select,
.demande-devis-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
    background-color: #ffffff;
    height: var(--input-height);
    box-shadow: var(--shadow-sm);
}

.demande-devis-form input[type="text"]:focus,
.demande-devis-form input[type="email"]:focus,
.demande-devis-form input[type="tel"]:focus,
.demande-devis-form select:focus,
.demande-devis-form textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.demande-devis-form select {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6" viewBox="0 0 12 6"><path fill="%234a6cf7" d="M0 0l6 6 6-6z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 35px;
}

.demande-devis-form textarea {
    resize: vertical;
    min-height: 120px;
    height: auto;
}

/* Custom Select Dropdown */
.demande-devis-custom-select {
    position: relative;
}

.demande-devis-custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 16px;
    background-color: #ffffff;
    cursor: pointer;
    height: var(--input-height);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.demande-devis-custom-select-trigger:after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--primary-color);
    transition: var(--transition);
}

.demande-devis-custom-select.open .demande-devis-custom-select-trigger:after {
    transform: translateY(-50%) rotate(180deg);
}

.demande-devis-custom-select-trigger:hover {
    border-color: var(--primary-color);
}

.demande-devis-custom-select.open .demande-devis-custom-select-trigger {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

.demande-devis-custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-top: 0;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow-md);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: var(--transition);
    max-height: 300px;
    overflow-y: auto;
}

.demande-devis-custom-select.open .demande-devis-custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}

.demande-devis-custom-options-search {
    padding: 10px;
    position: sticky;
    top: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    z-index: 1;
}

.demande-devis-custom-options-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.demande-devis-custom-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: var(--transition);
}

.demande-devis-custom-option:hover,
.demande-devis-custom-option.selected {
    background-color: rgba(74, 108, 247, 0.1);
}

.demande-devis-custom-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.demande-devis-custom-option-empty {
    padding: 12px 15px;
    color: var(--secondary-color);
    font-style: italic;
}

/* Required Fields */
.demande-devis-form .required {
    color: var(--danger-color);
    margin-left: 4px;
}

.demande-devis-form .optional {
    font-size: 14px;
    color: var(--secondary-color);
    font-weight: normal;
    margin-left: 4px;
}

/* Error Messages */
.demande-devis-form-error-message {
    color: var(--danger-color);
    font-size: 14px;
    margin-top: 6px;
    min-height: 20px;
    animation: fadeIn 0.3s ease;
}

.demande-devis-form-error-field {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15) !important;
}

/* File Upload */
.demande-devis-file-upload {
    position: relative;
    margin-bottom: 10px;
}

.demande-devis-file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.demande-devis-file-upload-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    height: 100px;
}

.demande-devis-file-upload input[type="file"]:hover + .demande-devis-file-upload-button,
.demande-devis-file-upload input[type="file"]:focus + .demande-devis-file-upload-button {
    background-color: rgba(74, 108, 247, 0.05);
    border-color: var(--primary-color);
}

.demande-devis-file-upload-icon {
    font-size: 24px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(74, 108, 247, 0.1);
    border-radius: 50%;
}

.demande-devis-file-upload-text {
    font-weight: 500;
    color: var(--dark-color);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.demande-devis-file-upload-info {
    font-size: 12px;
    color: var(--secondary-color);
    margin-top: 8px;
    text-align: center;
}

.demande-devis-file-list {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.demande-devis-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: rgba(74, 108, 247, 0.05);
    border-radius: var(--border-radius);
    border: 1px solid rgba(74, 108, 247, 0.2);
    width: 100%;
}

.demande-devis-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 10px;
    font-size: 14px;
}

.demande-devis-file-remove {
    color: var(--danger-color);
    cursor: pointer;
    font-weight: bold;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(220, 53, 69, 0.1);
    transition: var(--transition);
}

.demande-devis-file-remove:hover {
    background-color: rgba(220, 53, 69, 0.2);
}

/* Submit Button */
.demande-devis-submit-button {
    display: inline-block;
    padding: 14px 28px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    min-width: 180px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.demande-devis-submit-button:hover,
.demande-devis-submit-button:focus {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.demande-devis-submit-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.demande-devis-submit-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.demande-devis-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Honeypot */
.demande-devis-honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    z-index: -1;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* reCAPTCHA */
.g-recaptcha {
    margin-bottom: 10px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .demande-devis-form-container {
        padding: 20px;
    }
    
    .demande-devis-form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .demande-devis-form-field {
        flex: 1 1 100%;
    }
    
    .demande-devis-submit-button {
        width: 100%;
    }
    
    .demande-devis-custom-options {
        max-height: 250px;
    }
}
