/* Frontend Styles for OSWP Contact Plugin */

/* Form Wrapper */
.oswp-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Form Container */
.oswp-contact-form {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

/* Form Groups */
.oswp-form-group {
    margin-bottom: 20px;
}

/* Labels */
.oswp-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.oswp-required {
    color: #dc3545;
    margin-left: 2px;
}

/* Input Fields */
.oswp-input,
.oswp-textarea,
.oswp-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.oswp-input:focus,
.oswp-textarea:focus,
.oswp-select:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.oswp-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Radio and Checkbox Groups */
.oswp-radio-group,
.oswp-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.oswp-radio-label,
.oswp-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin: 0;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.oswp-radio-label:hover,
.oswp-checkbox-label:hover {
    background-color: #f5f5f5;
}

.oswp-radio-label input[type="radio"],
.oswp-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: auto;
}

/* Submit Button */
.oswp-submit-group {
    margin-top: 30px;
    text-align: center;
}

.oswp-submit-btn {
    background-color: #25D366;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.oswp-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    opacity: 0.9;
}

.oswp-submit-btn:active {
    transform: translateY(0);
}

/* Form Messages */
.oswp-form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
}

.oswp-form-message.oswp-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.oswp-form-message.oswp-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Error State */
.oswp-error-field {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* Custom Layouts - Grid Support */
.oswp-form-wrapper .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.oswp-form-wrapper .col-md-6,
.oswp-form-wrapper .col-md-12 {
    padding: 0 10px;
}

.oswp-form-wrapper .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.oswp-form-wrapper .col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .oswp-form-wrapper {
        padding: 10px;
    }
    
    .oswp-contact-form {
        padding: 20px;
    }
    
    .oswp-form-wrapper .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .oswp-submit-btn {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .oswp-input,
    .oswp-textarea,
    .oswp-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Accessibility */
.oswp-input:focus-visible,
.oswp-textarea:focus-visible,
.oswp-select:focus-visible {
    outline: 2px solid #25D366;
    outline-offset: 2px;
}

/* Loading State */
.oswp-contact-form.oswp-loading {
    opacity: 0.6;
    pointer-events: none;
}

.oswp-contact-form.oswp-loading .oswp-submit-btn::after {
    content: "...";
    animation: oswp-loading 1s infinite;
}

@keyframes oswp-loading {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

/* No Fields Message */
.oswp-no-fields {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}
