/**
 * CSS for Octo Form Builder frontend forms
 * 
 * This provides basic styling that can be customized with form settings
 */

/* Form Container */
.octo-form-container {
    max-width: 100%;
    margin: 20px auto;
    font-family: inherit;
    --octo-spacing: 1rem;
}

/* Form Elements */
.octo-form {
    width: 100%;
}

.octo-element {
    margin-bottom: var(--octo-spacing, 1rem);
}

/* Labels */
.octo-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.octo-label-left {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 0;
}

.octo-label-right {
    display: inline-block;
    margin-left: 10px;
    margin-bottom: 0;
}

/* Required field indicator */
.octo-required {
    color: #dd3333;
    margin-left: 3px;
}

/* Input fields - including new types email, phone, url, number, date */
.octo-input,
.octo-textarea,
.octo-select,
.octo-form-date-input,
.octo-form-time-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: inherit;
}

.octo-input:focus,
.octo-textarea:focus,
.octo-select:focus,
.octo-form-date-input:focus,
.octo-form-time-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

/* Disabled state for inputs */
.octo-input:disabled,
.octo-textarea:disabled,
.octo-select:disabled,
.octo-form-date-input:disabled,
.octo-form-time-input:disabled,
.octo-checkbox-input:disabled,
.octo-form-file-input:disabled {
    background-color: #f7f7f7;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Help text */
.octo-help-text {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
}

/* Radio and Checkbox styles */
.octo-radio-option,
.octo-checkbox-option {
    margin-bottom: 8px;
}

/* Custom checkbox styling */
.octo-form-checkbox-container {
    margin-bottom: var(--octo-spacing, 1rem);
}

.octo-form-checkbox-group-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.octo-form-checkbox-description {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
}

.octo-form-checkbox-options {
    display: flex;
    flex-direction: column;
}

.octo-form-checkbox-option {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.octo-checkbox-input {
    margin-right: 8px;
    cursor: pointer;
}

.octo-form-checkbox-label {
    cursor: pointer;
}

/* Horizontal layout for checkboxes */
.octo-form-checkbox-container.layout-horizontal .octo-form-checkbox-options {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
}

/* Label position styles for checkboxes */
.octo-form-checkbox-container.label-position-left .octo-form-checkbox-group-label {
    float: left;
    margin-right: 15px;
    margin-bottom: 0;
}

.octo-form-checkbox-container.label-position-right .octo-form-checkbox-group-label {
    float: right;
    margin-left: 15px;
    margin-bottom: 0;
}

.octo-form-checkbox-selection-message {
    font-size: 0.85em;
    color: #666;
    margin-top: 8px;
}

/* Radio Image styles */
.octo-radio-image-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.octo-radio-image-option {
    text-align: center;
}

.octo-radio-image-option input[type="radio"] {
    display: none;
}

.octo-radio-image-option label {
    display: block;
    cursor: pointer;
}

.octo-radio-image-option img {
    max-width: 100px;
    max-height: 100px;
    border: 3px solid transparent;
    border-radius: 4px;
    transition: border-color 0.2s ease;
    object-fit: contain;
}
.octo-radio-image-option input[type="radio"]:checked + label img {
    border-color: #0073aa;
}

.octo-radio-image-label {
    display: block;
    margin-top: 5px;
    font-size: 0.9em;
}

/* Container element */
.octo-container {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
}

.octo-container-label {
    font-weight: 600;
    margin-bottom: 10px;
}

/* Separator element */
.octo-separator {
    border: 0;
    height: 1px;
    background-color: #ddd;
    margin: var(--octo-spacing, 1rem) 0;
}

/* File Upload Styles */
.octo-form-file-container {
    margin-bottom: var(--octo-spacing, 1rem);
}

.octo-form-file-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.octo-form-file-description {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
}

.octo-form-file-restrictions {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 10px;
    background-color: #f8f8f8;
    padding: 8px;
    border-radius: 4px;
}

.octo-form-file-dropzone {
    border: 2px dashed #ddd;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    background-color: #f9f9f9;
    margin-bottom: 15px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.octo-form-file-dropzone:hover,
.octo-form-file-dropzone.drag-over {
    border-color: #0073aa;
    background-color: #f0f7fb;
}

.octo-form-file-dropzone-text {
    margin-bottom: 10px;
    color: #666;
}

.octo-form-file-input-wrapper {
    position: relative;
    display: inline-block;
}

.octo-form-file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.octo-form-file-browse-button {
    display: inline-block;
    background-color: #0073aa;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

.octo-form-file-browse-button:hover {
    background-color: #005f8b;
}

.octo-form-file-preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.octo-form-file-preview-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    background-color: #f9f9f9;
    position: relative;
}

.octo-form-file-preview-area.preview-type-thumbnail .octo-form-file-preview-item {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.octo-form-file-preview-area.preview-type-list .octo-form-file-preview-item {
    width: 100%;
    display: flex;
    align-items: center;
}

.octo-form-file-preview-item img {
    max-width: 100%;
    max-height: 100%;
}

.octo-form-file-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background-color: #dd3333;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.octo-form-file-upload-button {
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.9em;
    margin-top: 10px;
    transition: background-color 0.2s ease;
}

.octo-form-file-upload-button:hover {
    background-color: #005f8b;
}

/* Date and Time input styles */
.octo-form-date-wrapper {
    margin-bottom: var(--octo-spacing, 1rem);
}

.octo-form-date-description {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 8px;
}

.octo-form-date-input,
.octo-form-time-input {
    margin-bottom: 10px;
}

/* When both date and time inputs are present */
.octo-form-date-input + .octo-form-time-input {
    margin-left: 10px;
    width: calc(30% - 10px);
}

.octo-form-date-input:has(+ .octo-form-time-input) {
    width: 70%;
    display: inline-block;
}

.octo-form-date-note {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

/* Number input specific styles */
.octo-number {
    appearance: textfield; /* Remove up/down arrows in Firefox */
}

.octo-number::-webkit-inner-spin-button, 
.octo-number::-webkit-outer-spin-button { 
    -webkit-appearance: none;
    margin: 0;
}

/* Hidden fields */
.octo-hidden,
.octo-hidden-input {
    display: none !important;
}

/* Buttons */
.octo-form-submit,
.octo-next-step,
.octo-prev-step {
    background-color: #0073aa;
    color: white;
    border: 1px solid #0073aa;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.octo-form-submit:hover,
.octo-next-step:hover,
.octo-prev-step:hover {
    background-color: #005177;
    border-color: #005177;
}

.octo-prev-step {
    background-color: #f7f7f7;
    color: #333;
    border-color: #ccc;
}

.octo-prev-step:hover {
    background-color: #e7e7e7;
    border-color: #aaa;
}

/* Step Navigation */
.octo-step-navigation {
    margin-bottom: 20px;
}

.octo-step-navigation ul {
    display: flex;
    list-style-type: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.octo-step-navigation ul:after {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #ddd;
    z-index: 1;
}

.octo-step-indicator {
    flex: 1;
    text-align: center;
    padding: 0 10px;
    position: relative;
    z-index: 2;
}

.octo-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0 auto 5px;
    border-radius: 50%;
    background-color: #f0f0f0;
    border: 2px solid #ddd;
    color: #666;
    transition: all 0.3s ease;
}

.octo-step-name {
    display: block;
    font-size: 0.85em;
    color: #666;
}

.octo-step-active .octo-step-number {
    background-color: #0073aa;
    border-color: #0073aa;
    color: white;
}

.octo-step-active .octo-step-name {
    color: #0073aa;
    font-weight: bold;
}

.octo-step-completed .octo-step-number {
    background-color: #46b450;
    border-color: #46b450;
    color: white;
}

.octo-step-completed .octo-step-number:after {
    content: '✓';
}

.octo-step-completed .octo-step-name {
    color: #46b450;
}

/* Step Buttons Container */
.octo-step-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: var(--octo-spacing, 1rem);
}

/* Form Messages */
.octo-form-message {
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    transition: opacity 0.5s ease;
}

.octo-form-success {
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}

.octo-form-error {
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
}

/* Validation Errors */
.octo-input-error,
.octo-form-date-input.octo-input-error,
.octo-form-time-input.octo-input-error {
    border-color: #a94442;
    background-color: #fdf7f7;
}

/* Email, URL, Phone specific styling */
.octo-email:invalid,
.octo-url:invalid,
.octo-phone:invalid,
.octo-number:invalid {
    border-color: #a94442;
    background-color: #fdf7f7;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .octo-step-name {
        display: none;
    }
    
    .octo-step-indicator {
        padding: 0 5px;
    }
    
    .octo-step-navigation ul:after {
        content: unset;
    }
    
    .octo-radio-image-options {
        flex-direction: column;
    }
    
    .octo-form-submit-container,
    .octo-step-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    /* Make date + time inputs stack on mobile */
    .octo-form-date-input:has(+ .octo-form-time-input),
    .octo-form-date-input + .octo-form-time-input {
        width: 100%;
        margin-left: 0;
        display: block;
    }
    
    /* Adjust checkbox layout for mobile */
    .octo-form-checkbox-container.layout-horizontal .octo-form-checkbox-options {
        flex-direction: column;
        gap: 5px;
    }

    .octo-step-navigation ul{
        flex-wrap: wrap;
    }
}



/**
 * Submission Feedback Styles for Octo Form Builder
 *
 * @package    Octo_Form_Builder
 * @subpackage Octo_Form_Builder/public/css
 */

/* General submission feedback container */
.octo-form-submission-feedback {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1.5rem;
}

/* Message content */
.octo-feedback-message {
    margin-bottom: 0.5rem;
}

/* Success feedback - Default styling (overridden by custom settings) */
.octo-success-feedback {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

/* Error feedback - Default styling (overridden by custom settings) */
.octo-error-feedback {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

/* Button styling - Default (overridden by custom settings) */
.octo-feedback-button {
    display: inline-block;
    padding: 8px 16px;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
}

/* Success button - Default styling */
.octo-success-button {
    background-color: #2e7d32;
    color: #ffffff;
    border: none;
}

.octo-success-button:hover {
    background-color: #256a29;
}

/* Error button - Default styling */
.octo-error-button {
    background-color: #c62828;
    color: #ffffff;
    border: none;
}

.octo-error-button:hover {
    background-color: #af2323;
}

/* Toast container */
.octo-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 300px;
    z-index: 9999;
}

/* Toast notification */
.octo-toast {
    position: relative;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* Toast close button */
.octo-toast-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.octo-toast-close:hover {
    opacity: 1;
}

/* Toast progress bar */
.octo-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    opacity: 0.7;
}

/* Modal overlay */
.octo-feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Modal content */
.octo-feedback-modal {
    position: relative;
    max-width: 500px;
    width: 90%;
    padding: 20px;
    box-sizing: border-box;
}

/* Modal close button */
.octo-feedback-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.octo-feedback-close:hover {
    opacity: 1;
}

/* Field validation error styles */
.octo-field-error {
    border-color: #dd3333 !important;
    background-color: rgba(221, 51, 51, 0.05);
}

.octo-field-error-message {
    color: #dd3333;
    font-size: 0.8em;
    margin-top: 4px;
    margin-bottom: 8px;
}

/* Loading state for submit button */
.octo-form-submit.octo-loading {
    opacity: 0.7;
    cursor: wait;
}

/* Animation keyframes */
@keyframes octoFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes octoFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes octoSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes octoSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Responsive styles */
@media screen and (max-width: 600px) {
    .octo-toast-container {
        width: 100%;
        max-width: 100%;
        top: auto;
        bottom: 0;
        right: 0;
        padding: 10px;
        box-sizing: border-box;
    }
    
    .octo-toast {
        width: 100%;
        max-width: 100%;
    }
    
    .octo-feedback-modal {
        width: 95%;
        padding: 15px;
    }
}

/* Base step number styles (already exist) */
.octo-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0 auto 5px;
    border-radius: 50%; /* Default circle */
    background-color: #f0f0f0;
    border: 2px solid #ddd;
    color: #666;
    transition: all 0.3s ease;
}

/* Shape-specific styles */
.octo-step-indicator.shape-circle .octo-step-number {
    border-radius: 50%;
}

.octo-step-indicator.shape-square .octo-step-number {
    border-radius: 15%;
}

.octo-step-indicator.shape-triangle .octo-step-number {
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    border-radius: 0;
}

.octo-step-indicator.shape-hexagon .octo-step-number {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    border-radius: 0;
}

.octo-step-indicator.shape-star .octo-step-number {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    border-radius: 0;
}

/* Adjust content centering for complex shapes */
.octo-step-indicator.shape-triangle .octo-step-number,
.octo-step-indicator.shape-star .octo-step-number,
.octo-step-indicator.shape-hexagon .octo-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
}