/**
 * Ajax Contact Forms - Form template UI styles
 * Version: 1.1.0 (with plugin 6.6.0)
 *   - [v6.6.0] Public edition: PRO mode toggle/form removed. Legacy
 *     .wcf-mode / .wcf-toggle / .wcf-label-pro rules retained but unused.
 */

/* === LOADER STYLES (FIXED) === */
.wcf-loader-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px; /* Ensure it has height while form loads */
}

.wcf-loader-spinner {
    border: 5px solid #f3f3f3; /* Light grey */
    border-top: 5px solid #007cba; /* Blue */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: wcf-spin 1s linear infinite;
}

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

/* === BASE STYLES === */
.wcf-form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wcf-form-container * {
    box-sizing: border-box;
}

.wcf-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.wcf-form-title {
    font-size: 32px;
    color: #2c3e50;
    margin: 0 0 10px;
}

.wcf-form-subtitle {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0;
}

.wcf-form-section {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

.wcf-form-section:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.wcf-section-title {
    font-size: 18px;
    color: #34495e;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wcf-section-title i {
    color: #007cba;
}

.wcf-section-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: normal;
    margin-left: auto;
}

/* === FORM LAYOUT === */
.wcf-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.wcf-form-row:last-child {
    margin-bottom: 0;
}

.wcf-form-group {
    flex: 1;
}

.wcf-col-half {
    flex: 0 0 calc(50% - 10px);
}

.wcf-col-full {
    flex: 1;
}

@media (max-width: 600px) {
    .wcf-form-row {
        flex-direction: column;
    }
    
    .wcf-col-half {
        flex: 1;
    }
}

/* === FORM INPUTS === */
.wcf-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.wcf-required {
    color: #e74c3c;
}

.wcf-input-wrapper {
    position: relative;
}

.wcf-input,
.wcf-textarea,
.wcf-chosen-select,
.wcf-subject-select {
    width: 100%;
    min-height: 48px;
    line-height: 1.4;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    color: #222;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Dropdown arrow + appearance reset apply ONLY to the select fields, not the textarea */
.wcf-chosen-select,
.wcf-subject-select {
    padding-right: 40px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2020%2020%22%3E%3Cpath%20fill%3D%22%23666%22%20d%3D%22M5.5%207.5L10%2012l4.5-4.5z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    cursor: pointer;
}

/* Textarea should be vertically resizable and taller by default */
.wcf-textarea {
    min-height: 120px;
    resize: vertical;
}

.wcf-chosen-select:focus,
.wcf-subject-select:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 186, 0.1);
}

.wcf-chosen-select option,
.wcf-subject-select option {
    color: #222;
    padding: 8px;
}

.wcf-input-with-icon {
    padding-left: 40px;
}

.wcf-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    pointer-events: none;
}

.wcf-input:focus,
.wcf-textarea:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 186, 0.1);
}

.wcf-input.error,
.wcf-textarea.error {
    border-color: #e74c3c;
}

.wcf-textarea {
    resize: vertical;
    min-height: 120px;
}

.wcf-character-count {
    text-align: right;
    font-size: 12px;
    color: #95a5a6;
    margin-top: 5px;
}

.wcf-character-count.warning {
    color: #f39c12;
}

.wcf-field-error {
    display: block;
    color: #e74c3c;
    font-size: 13px;
    margin-top: 5px;
}

/* === PHONE FIELD STYLES (FIXED) === */
.wcf-phone-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.wcf-phone-wrapper:focus-within {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 123, 186, 0.1);
}

.wcf-phone-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background-color: #f8f9fa;
    height: 100%;
    border-right: 1px solid #ddd;
    flex-shrink: 0; /* Prevent the icon from shrinking */
}

.wcf-flag-icon {
    width: 20px;
    height: auto;
    display: block;
}

.wcf-phone-prefix {
    font-weight: 600;
    color: #495057;
    font-size: 15px;
}

.wcf-input.phone {
    border: none; /* Remove border from the input itself */
    padding-left: 12px; /* Adjust padding */
    flex-grow: 1; /* Allow input to fill remaining space */
}

.wcf-input.phone:focus {
    box-shadow: none; /* Remove focus shadow from input, it's on the wrapper now */
}


/* === FILE UPLOAD === */
.wcf-file-upload-wrapper {
    position: relative;
}

.wcf-file-input {
    display: none;
}

.wcf-file-label {
    display: block;
    padding: 40px 20px;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.wcf-file-label:hover {
    border-color: #007cba;
    background: #f0f7ff;
}

.wcf-file-label.is-dragover {
    border-color: #28a745;
    background: #f0fff4;
}

.wcf-file-label-required {
    border-color: #dc3545;
    background: #fff5f5;
}

.wcf-upload-icon {
    font-size: 48px;
    color: #cbd5e0;
    margin-bottom: 15px;
}

.wcf-file-text strong {
    display: block;
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.wcf-file-text span {
    display: block;
    font-size: 14px;
    color: #7f8c8d;
}

.wcf-file-info {
    margin-top: 10px;
    font-size: 12px;
    color: #95a5a6;
}

.wcf-file-preview {
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.wcf-file-preview-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.wcf-file-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: #6c757d;
}

.wcf-file-details {
    flex: 1;
}

.wcf-file-name {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    word-break: break-word;
}

.wcf-file-size {
    display: block;
    font-size: 13px;
    color: #6c757d;
}

.wcf-file-remove {
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s;
    padding: 4px;
    font-size: 18px;
}

.wcf-file-remove:hover {
    color: #dc3545;
}

/* File upload progress bar */
.wcf-file-progress {
    margin-top: 15px;
}

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

.wcf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007cba 0%, #28a745 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.wcf-progress-text {
    font-size: 13px;
    color: #6c757d;
    display: block;
    text-align: center;
}

.wcf-file-progress.error .wcf-progress-bar {
    background: #f8d7da;
}

.wcf-file-progress.error .wcf-progress-fill {
    background: #dc3545;
}

/* === SUBMIT BUTTON === */
.wcf-submit-section {
    margin-top: 30px;
}

.wcf-submit-group {
    display: flex;
    justify-content: center;
}

.wcf-submit-btn {
    background: linear-gradient(135deg, #4186a9 0%, #005a87 100%) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wcf-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #3a7899 0%, #004d73 100%) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.wcf-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.wcf-btn-pro {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.wcf-btn-spinner {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #ffffff !important;
}

.wcf-btn-spinner-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: wcf-spin 0.8s linear infinite;
    flex-shrink: 0;
}

.wcf-submit-btn.is-loading {
    position: relative;
    pointer-events: none;
}

.wcf-submit-btn.is-loading .wcf-btn-text {
    display: none !important;
}

.wcf-submit-btn.is-loading .wcf-btn-spinner {
    display: inline-flex !important;
}

/* === PRO FORM HEADER === */
.wcf-pro-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
}

.wcf-pro-title {
    font-size: 24px;
    color: #2c3e50;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.wcf-pro-subtitle {
    color: #6c757d;
    margin: 0;
}

.wcf-pro-subtitle a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
	font-size: 17px;
}
.wcf-pro-subtitle a i {
    font-size: 0.8em;
    margin-left: 4px;
}
.wcf-pro-subtitle a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* === FORM MESSAGES === */
.wcf-form-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 16px;
    animation: slideIn 0.3s ease-in-out;
}

.wcf-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wcf-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wcf-form-message i {
    margin-right: 10px;
    font-size: 18px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === MODE TOGGLE === */
.wcf-mode-toggle-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.wcf-mode-toggle {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 500px;
    height: 65px;
    cursor: pointer;
    background-color: #e9ecef;
    border-radius: 32.5px;
    transition: background-color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.wcf-mode-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
}

.wcf-toggle-slider {
    position: absolute;
    top: 5px;
    left: 5px;
    height: 55px;
    width: calc(50% - 5px);
    background-color: #ffffff;
    border-radius: 27.5px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

.wcf-toggle-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 2;
    user-select: none;
}

.wcf-label-normal,
.wcf-label-pro {
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    gap: 12px;
}

.wcf-label-normal i,
.wcf-label-pro i {
    font-size: 20px;
    line-height: 1;
}

.wcf-label-text-wrapper {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.3;
}

.wcf-label-text-wrapper span {
    font-size: 15px;
    font-weight: 600;
}

.wcf-label-text-wrapper small {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.8;
    transition: color 0.3s ease;
}

/* Toggle State: Default (Normal) */
.wcf-label-normal {
    color: #007bff;
}

.wcf-label-pro {
    color: #495057;
}

.wcf-file-remove:hover {
    background: #fff5f5;
    border-color: #dc3545;
    color: #dc3545;
}

.wcf-label-pro small {
    color: #6c757d;
}

/* Toggle State: Checked (Pro) */
.wcf-mode-checkbox:checked + .wcf-toggle-slider {
    transform: translateX(100%);
}

.wcf-mode-checkbox:checked ~ .wcf-toggle-labels .wcf-label-normal {
    color: #FF9900;
}

.wcf-mode-checkbox:checked ~ .wcf-toggle-labels .wcf-label-pro {
    color: #FF9900;
}

.wcf-mode-checkbox:checked ~ .wcf-toggle-labels .wcf-label-pro small {
    color: #28a745;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .wcf-form-container {
        padding: 10px;
    }
    
    .wcf-form-section {
        padding: 15px;
    }
    
    .wcf-label-text-wrapper span {
        font-size: 13px;
    }
    
    .wcf-label-text-wrapper small {
        font-size: 11px;
    }
    
    .wcf-mode-toggle {
        height: 60px;
    }
    
    .wcf-toggle-slider {
        height: 50px;
    }
}

/* Override theme / WooCommerce / cache — normal form submit only */
.wcf-form-container .wcf-submit-group button.wcf-submit-btn.wcf-btn-primary:not(.wcf-btn-pro),
.wcf-form-container .wcf-normal-form-wrapper button.wcf-submit-btn {
    background: linear-gradient(135deg, #4186a9 0%, #005a87 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.wcf-form-container .wcf-submit-group button.wcf-submit-btn.wcf-btn-primary:not(.wcf-btn-pro):hover:not(:disabled),
.wcf-form-container .wcf-normal-form-wrapper button.wcf-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #3a7899 0%, #004d73 100%) !important;
    color: #ffffff !important;
}
