/* CF7 Drag & Drop Wrapper - Frontend Styles */

/* Form Container */
.cf7-dd-form {
    position: relative;
    transition: all 0.3s ease;
}

.cf7-dd-form.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Enhanced Form Layout */
.cf7-dd-form p {
    margin-bottom: 1.5em;
    position: relative;
}

.cf7-dd-form label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #333;
}

.cf7-dd-form label .required {
    color: #d63638;
    margin-left: 0.25em;
}

/* Input Fields */
.cf7-dd-form input[type="text"],
.cf7-dd-form input[type="email"],
.cf7-dd-form input[type="tel"],
.cf7-dd-form input[type="url"],
.cf7-dd-form input[type="number"],
.cf7-dd-form input[type="date"],
.cf7-dd-form input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.cf7-dd-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 120px;
    box-sizing: border-box;
}

.cf7-dd-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.5;
    background-color: white;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 12px auto;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.cf7-dd-form select[multiple] {
    background-image: none;
    min-height: 150px;
    padding: 10px;
}

/* Focus States */
.cf7-dd-form input:focus,
.cf7-dd-form textarea:focus,
.cf7-dd-form select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

/* Checkboxes and Radio Buttons */
.cf7-dd-form .checkbox-group,
.cf7-dd-form .radio-group {
    margin: 10px 0;
}

.cf7-dd-form input[type="checkbox"],
.cf7-dd-form input[type="radio"] {
    margin-right: 8px;
    vertical-align: middle;
}

.cf7-dd-form input[type="checkbox"] + span,
.cf7-dd-form input[type="radio"] + span {
    vertical-align: middle;
}

.cf7-dd-form .wpcf7-list-item {
    display: block;
    margin-bottom: 8px;
}

.cf7-dd-form .wpcf7-list-item-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

/* Submit Button */
.cf7-dd-form input[type="submit"],
.cf7-dd-form .wpcf7-submit {
    background-color: #2271b1;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    line-height: 1.5;
    text-decoration: none;
}

.cf7-dd-form input[type="submit"]:hover,
.cf7-dd-form .wpcf7-submit:hover {
    background-color: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cf7-dd-form input[type="submit"]:active,
.cf7-dd-form .wpcf7-submit:active {
    transform: translateY(0);
}

.cf7-dd-form input[type="submit"]:disabled,
.cf7-dd-form .wpcf7-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Validation */
.cf7-dd-form .wpcf7-not-valid-tip {
    color: #d63638;
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

.cf7-dd-form .wpcf7-validation-errors,
.cf7-dd-form .wpcf7-mail-sent-ok,
.cf7-dd-form .wpcf7-spam-blocked,
.cf7-dd-form .wpcf7-mail-sent-ng,
.cf7-dd-form .wpcf7-aborted {
    border: none;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

.cf7-dd-form .wpcf7-validation-errors {
    background-color: #f8d7da;
    color: #721c24;
}

.cf7-dd-form .wpcf7-mail-sent-ok {
    background-color: #d1e7dd;
    color: #0f5132;
}

.cf7-dd-form .wpcf7-spam-blocked,
.cf7-dd-form .wpcf7-mail-sent-ng,
.cf7-dd-form .wpcf7-aborted {
    background-color: #fff3cd;
    color: #856404;
}

/* Custom Validation Container */
.cf7-dd-validation-errors {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid #dc3545;
}

.cf7-dd-validation-errors ul {
    margin: 0;
    padding-left: 20px;
}

.cf7-dd-validation-errors li {
    margin-bottom: 5px;
}

/* Field Groups */
.cf7-dd-form .field-group {
    margin-bottom: 25px;
}

.cf7-dd-form .field-group-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    color: #2271b1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cf7-dd-form input[type="text"],
    .cf7-dd-form input[type="email"],
    .cf7-dd-form textarea,
    .cf7-dd-form select {
        padding: 10px 12px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .cf7-dd-form input[type="submit"],
    .cf7-dd-form .wpcf7-submit {
        width: 100%;
        padding: 14px 20px;
    }
}

/* Loading Animation */
.cf7-dd-form .loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    display: none;
}

.cf7-dd-form.loading .loading-overlay {
    display: flex;
}

.cf7-dd-form .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success Animation */
.cf7-dd-form .success-animation {
    text-align: center;
    padding: 30px;
}

.cf7-dd-form .success-animation .checkmark {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #4CAF50;
    stroke-miterlimit: 10;
    margin: 0 auto 20px;
    box-shadow: inset 0px 0px 0px #4CAF50;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.cf7-dd-form .success-animation .checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #4CAF50;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.cf7-dd-form .success-animation .checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #4CAF50;
    }
}

/* Placeholder Styling */
.cf7-dd-form ::placeholder {
    color: #999;
    opacity: 1;
}

.cf7-dd-form :-ms-input-placeholder {
    color: #999;
}

.cf7-dd-form ::-ms-input-placeholder {
    color: #999;
}

/* Helper Text */
.cf7-dd-form .helper-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Custom Field Styling */
.cf7-dd-form .custom-field {
    position: relative;
}

.cf7-dd-form .field-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.cf7-dd-form .field-icon + input,
.cf7-dd-form .field-icon + textarea {
    padding-left: 40px;
}