/* Basic Reset/Normalize */
.vitrophanie-modal-content *,
.vitrophanie-modal-content *::before,
.vitrophanie-modal-content *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Modal Overlay */
.vitrophanie-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Modal Content Box */
.vitrophanie-modal-content {
    background-color: #fff;
    padding: 20px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

/* Modal Header */
.vitrophanie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.vitrophanie-modal-header h2 {
    font-size: 1.5em;
    color: #333;
}

/* Modal Close Button */
.vitrophanie-modal-close-btn {
    background: none;
    border: none;
    font-size: 1.8em;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 0.25em 0.5em;
}

.vitrophanie-modal-close-btn:hover {
    color: #333;
}

/* Form Styling */
.vitrophanie-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vitrophanie-form-group {
    display: flex;
    flex-direction: column;
}

/* Honeypot Styles */
.vitrophanie-form-group-honeypot {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    z-index: -1;
    pointer-events: none;
}

.vitrophanie-form-group label {
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
    color: #555;
}

.vitrophanie-form-group input[type="text"],
.vitrophanie-form-group input[type="email"],
.vitrophanie-form-group input[type="tel"],
.vitrophanie-form-group select,
.vitrophanie-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.vitrophanie-form-group input[type="text"]:focus,
.vitrophanie-form-group input[type="email"]:focus,
.vitrophanie-form-group input[type="tel"]:focus,
.vitrophanie-form-group select:focus,
.vitrophanie-form-group textarea:focus {
    border-color: #00bfa5; /* Original Teal */
    box-shadow: 0 0 0 2px rgba(0, 191, 165, 0.2);
    outline: none;
}

.vitrophanie-form-group-checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.vitrophanie-form-group-checkbox input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
}

.vitrophanie-form-group-checkbox label {
    margin-bottom: 0;
    font-weight: normal;
    font-size: 0.85em;
}

/* Submit Button (Form) */
.vitrophanie-form-submit-btn {
    background-color: #00bfa5; /* Hardcoded Teal */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vitrophanie-form-submit-btn:hover {
    background-color: #008c7a; /* Hardcoded Darker Teal */
}

.vitrophanie-form-submit-btn:disabled {
    background-color: #a0a0a0;
    cursor: not-allowed;
}

/* Loader */
.vitrophanie-loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #008c7a; /* Hardcoded Darker Teal */
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: vitrophanie-spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Form Messages */
.vitrophanie-form-message {
    text-align: center;
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9em;
}

.vitrophanie-form-message.success {
    background-color: #e6fff3;
    color: #00994d;
    border: 1px solid #b3ffda;
}

.vitrophanie-form-message.error {
    background-color: #ffe6e6;
    color: #cc0000;
    border: 1px solid #ffb3b3;
}

/* Thank You Message */
.vitrophanie-thank-you-message {
    text-align: center;
    padding: 20px;
}

.vitrophanie-thank-you-message h3 {
    font-size: 1.4em;
    color: #333;
    margin-bottom: 10px;
}

.vitrophanie-thank-you-message p {
    font-size: 1em;
    color: #555;
    margin-bottom: 20px;
}

.vitrophanie-thank-you-close-btn {
    background-color: #f0f0f0;
    color: #333;
    padding: 8px 15px;
    font-size: 0.9em;
    border-radius: 4px;
}

.vitrophanie-thank-you-close-btn:hover {
    background-color: #e0e0e0;
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .vitrophanie-modal-content {
        margin: 10px;
        padding: 15px;
    }
    
    .vitrophanie-modal-header h2 {
        font-size: 1.2em;
    }
    
    .vitrophanie-form-group input[type="text"],
    .vitrophanie-form-group input[type="email"],
    .vitrophanie-form-group input[type="tel"],
    .vitrophanie-form-group select,
    .vitrophanie-form-group textarea,
    .vitrophanie-form-submit-btn {
        font-size: 0.95em;
    }
}

/* Custom Button Block Wrapper Styles */
.wp-block-vitrophanie-contact-button {
    margin: 1em 0; /* Default margin for the block */
}
.wp-block-vitrophanie-contact-button[data-align="left"] { text-align: left; }
.wp-block-vitrophanie-contact-button[data-align="center"] { text-align: center; }
.wp-block-vitrophanie-contact-button[data-align="right"] { text-align: right; }

/* Frontend Button Styles - REMOVED .vitrophanie-custom-button styles.
   The button will now inherit styles from .wp-block-button__link and .wp-element-button
   which are applied in render.php.
*/

/* Editor styles for the button block (applied to the RichText element) */
/* These styles ensure the RichText looks and behaves correctly in the editor */
.block-editor-rich-text__editable.vitrophanie-editor-button {
    /* Mimic core button styles for editor */
    background-color: #00bfa5 !important; /* Hardcoded Teal for editor preview */
    color: #ffffff !important;
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 1.1em !important;
    font-weight: bold !important;
    line-height: 1.5 !important;
    display: inline-block !important; /* Or inline-flex */
    text-decoration: none !important;

    /* Crucial for editability and selection */
    cursor: text !important;
    white-space: pre-wrap !important;
    user-select: text !important;
    pointer-events: auto !important;
}

/* Remove default focus outline in editor and apply custom one */
.block-editor-rich-text__editable.vitrophanie-editor-button:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.3) !important; /* Teal focus */
}

/* Ensure text is visible while editing */
.block-editor-rich-text__editable.vitrophanie-editor-button[contenteditable="true"] {
    color: #ffffff !important;
}

