/**
 * Contact Form 7 Custom Styling for WeDev365 Theme
 * 
 * This file contains custom styles to make Contact Form 7 
 * match the WeDev365 theme design
 */

/* Contact Form 7 Form Container */
.wpcf7-form {
    max-width: 100%;
    margin: 0;
}

/* Form Field Wrapper */
.wpcf7-form-control-wrap {
    margin-bottom: 1.5rem;
    display: block;
}

/* Form Labels */
.wpcf7-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Text Input Fields */
.wpcf7-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
    color: #111827;
    background-color: #f9fafb;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.wpcf7-form-control:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wpcf7-form-control::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Textarea Fields */
.wpcf7-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

/* Submit Button */
.wpcf7-submit {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #ffffff;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: none;
    letter-spacing: normal;
}

.wpcf7-submit:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.wpcf7-submit:active {
    transform: translateY(0);
}

.wpcf7-submit:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Response Messages */
.wpcf7-response-output {
    margin-top: 1rem;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid;
}

/* Success Message */
.wpcf7-mail-sent-ok {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

/* Error Message */
.wpcf7-validation-errors {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

/* Spam Message */
.wpcf7-spam-blocked {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

/* Field Validation Error */
.wpcf7-not-valid-tip {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    display: block;
    font-weight: 500;
}

.wpcf7-not-valid {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.wpcf7-not-valid:focus {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* Loading State */
.wpcf7-form.sending .wpcf7-submit {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wpcf7-form.sending .wpcf7-submit::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Grid Layout for Contact Form */
.contact-form-fields {
    display: block;
}

.contact-form-fields .grid {
    display: grid;
    gap: 1rem;
}

.contact-form-fields .grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.contact-form-fields .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-form-fields .gap-4 {
    gap: 1rem;
}

.contact-form-fields .mb-4 {
    margin-bottom: 1rem;
}

.contact-form-fields .mb-6 {
    margin-bottom: 1.5rem;
}

.contact-form-fields .text-center {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .contact-form-fields .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .wpcf7-form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .wpcf7-submit {
        padding: 16px 24px;
        font-size: 16px;
    }
}

/* Accessibility Improvements */
.wpcf7-form-control:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.wpcf7-submit:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Screen Reader Text */
.wpcf7-form .screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Remove default Contact Form 7 styles */
.wpcf7-form-control-wrap input[type="text"],
.wpcf7-form-control-wrap input[type="email"],
.wpcf7-form-control-wrap input[type="tel"],
.wpcf7-form-control-wrap input[type="url"],
.wpcf7-form-control-wrap input[type="password"],
.wpcf7-form-control-wrap input[type="search"],
.wpcf7-form-control-wrap input[type="number"],
.wpcf7-form-control-wrap input[type="range"],
.wpcf7-form-control-wrap input[type="date"],
.wpcf7-form-control-wrap input[type="month"],
.wpcf7-form-control-wrap input[type="week"],
.wpcf7-form-control-wrap input[type="time"],
.wpcf7-form-control-wrap input[type="datetime"],
.wpcf7-form-control-wrap input[type="datetime-local"],
.wpcf7-form-control-wrap input[type="color"],
.wpcf7-form-control-wrap textarea,
.wpcf7-form-control-wrap select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
}

/* Custom checkbox and radio styles */
.wpcf7-form-control-wrap input[type="checkbox"],
.wpcf7-form-control-wrap input[type="radio"] {
    width: auto;
    height: auto;
    margin-right: 8px;
    vertical-align: middle;
}

/* File upload styles */
.wpcf7-form-control-wrap input[type="file"] {
    padding: 8px;
    border: 2px dashed #d1d5db;
    background-color: #f9fafb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wpcf7-form-control-wrap input[type="file"]:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* Select dropdown styles */
.wpcf7-form-control-wrap select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}
