/**
 * Public Forms Styles
 *
 * Styles for CRUD forms in public views
 * @since 0.0.30
 */

/* Form Container */
.form-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Form Layout */
.public-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-field label .required {
    color: #d63638;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="url"],
.form-field input[type="number"],
.form-field input[type="date"],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

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

.form-field .description {
    font-size: 0.875rem;
    color: #666;
    font-style: italic;
}

/* Checkboxes and Radios */
.form-field fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
}

.form-field fieldset legend {
    font-weight: 600;
    padding: 0 0.5rem;
}

.checkbox-group, .radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
}

.checkbox-group label, .radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
    width: auto;
    margin: 0;
}

/* Buttons */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    margin-top: 1rem;
}

.button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s;
}

.button-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: #fff;
}

.button-secondary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    color: #667eea;
    border: 2px solid #667eea;
}

.button-secondary:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.button-danger {
    background: #d63638;
    color: #fff;
}

.button-danger:hover {
    background: #a82829;
}

/* Entity Actions (for detail pages) */
.entity-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.entity-title-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    gap: 2rem;
}

.entity-title-wrapper h2 {
    flex: 1;
}

/* Notices */
.notice {
    padding: 1rem;
    border-left: 4px solid;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

.notice-error {
    background: #fef7f7;
    border-color: #d63638;
    color: #411;
}

.notice-success {
    background: #f7fef7;
    border-color: #00a32a;
    color: #141;
}

.notice p {
    margin: 0;
}

/* AJAX Loading */
.form-field select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .form-container {
        padding: 1rem;
        margin: 1rem;
    }
    
    .entity-title-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    
    .entity-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .button {
        width: 100%;
    }
}

/* Editor Compatibility (wp_editor) */
.wp-editor-wrap {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.wp-editor-container textarea {
    border: none;
}
