/* Contact Form API Plugin - Frontend Styles */

.cfapi-form-container {
    max-width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
}

.cfapi-form {
    background: #ffffff;
}

.cfapi-form-row {
    margin-bottom: 1.5rem;
}

.cfapi-form-row:last-child {
    margin-bottom: 0;
}

.cfapi-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.cfapi-form .required {
    color: #e74c3c;
}

.cfapi-input,
.cfapi-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.cfapi-input:focus,
.cfapi-textarea:focus {
    outline: none;
    border-color: #F38D0C;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.cfapi-input:read-only {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

.cfapi-textarea {
    resize: vertical;
    min-height: 100px;
}

.cfapi-form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.cfapi-form-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #2c3e50;
}

.cfapi-row-inline {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.cfapi-col {
    flex: 1;
}

.cfapi-col-auto {
    flex: 0 0 auto;
}

.cfapi-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.cfapi-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cfapi-btn-primary {
    background: #F38D0C;
    color: #ffffff;
}

.cfapi-btn-primary:hover:not(:disabled) {
    background: #F9B861;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.cfapi-btn-secondary {
    background: #95a5a6;
    color: #ffffff;
    white-space: nowrap;
}

.cfapi-btn-secondary:hover:not(:disabled) {
    background: #7f8c8d;
}

.cfapi-btn.loading {
    position: relative;
    color: transparent;
}

.cfapi-btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: cfapi-spin 0.6s linear infinite;
}

@keyframes cfapi-spin {
    to { transform: rotate(360deg); }
}

.cfapi-address-fields {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.cfapi-messages {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 4px;
    display: none;
}

.cfapi-messages.show {
    display: block;
}

.cfapi-messages.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.cfapi-messages.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.cfapi-messages.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Responsive design */
@media (max-width: 640px) {
    .cfapi-form {
        padding: 1.5rem;
    }
    
    .cfapi-row-inline {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cfapi-col-auto {
        width: 100%;
    }
    
    .cfapi-btn-secondary {
        width: 100%;
    }
}

/* File Upload Styling */
.cfapi-input-file {
    padding: 0.5rem;
    border: 2px dashed #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.3s;
}

.cfapi-input-file:hover {
    border-color: #F38D0C;
    background: #f0f8ff;
}

.cfapi-file-info {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.cfapi-file-list {
    margin-top: 1rem;
}

.cfapi-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.cfapi-file-name {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
    word-break: break-word;
}

.cfapi-file-size {
    font-size: 0.85rem;
    color: #666;
    margin: 0 1rem;
}

.cfapi-file-remove {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.cfapi-file-remove:hover {
    background: #c0392b;
}

.cfapi-file-error {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.cfapi-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.cfapi-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.cfapi-checkbox-label:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.cfapi-checkbox {
    width: 20px;
    height: 20px;
    margin: 0;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: #3498db;
}

.cfapi-checkbox-text {
    font-size: 1rem;
    color: #333;
    user-select: none;
}

.cfapi-checkbox:checked + .cfapi-checkbox-text {
    font-weight: 600;
    color: #3498db;
}

.cfapi-error-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}

/* Responsive checkbox styling */
@media (max-width: 640px) {
    .cfapi-checkbox-label {
        padding: 0.6rem;
    }
    
    .cfapi-checkbox-text {
        font-size: 0.95rem;
    }
}