/**
 * GriffinForms Theme Editor Styles
 * Custom styling for theme editor UI and preview modal
 */

.gf-formtheme-editor__surface {
    background: var(--gf-color-surface);
    border: 1px solid #dcdcde;
    border-radius: 10px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.gf-formtheme-editor .container.w-75 {
    width: 100% !important;
    max-width: none !important;
}

.gf-formtheme-editor .container.w-75.border-bottom {
    background: var(--gf-color-surface);
    border: 1px solid #dcdcde !important;
    border-radius: 10px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    padding: 20px 24px !important;
    margin: 0 0 16px !important;
}

.gf-formtheme-editor .container.w-75.border-bottom > h5 {
    margin-top: 0;
}

.gf-formtheme-editor .griffinforms-accordion-wrapper {
    margin-top: 0 !important;
}

/* Theme Style Sections */
.griffinforms-theme-style-section {
    margin: 1rem 0;
}

.griffinforms-field-style-group {
    margin-bottom: 2rem;
}

/* FormControls Styling */
.griffinforms-color-picker {
    height: 38px;
    padding: 2px 8px;
    cursor: pointer;
}

.griffinforms-color-value {
    font-family: monospace;
    font-size: 0.875rem;
}

.griffinforms-dimension-input,
.griffinforms-side-dimension,
.griffinforms-shadow-dimension {
    font-family: monospace;
}

/* 4-Sided Dimensions */
.griffinforms-sides-dimensions .row {
    gap: 0.75rem;
}

.griffinforms-side-dimension {
    text-align: center;
}

.griffinforms-side-dimension::placeholder {
    text-align: center;
}

/* Box Shadow Controls */
.griffinforms-box-shadow-controls {
}

.griffinforms-shadow-dimension {
    font-family: monospace;
}

/* State Tabs - WordPress Admin Style */
.nav-tabs {
    border-bottom: 1px solid #ccc;
    margin: 0 0 1.5rem 0;
    padding: 0;
    background-color: transparent;
}

.nav-tabs .nav-item {
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    color: #666;
    background-color: transparent;
    border: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    border-radius: 3px 3px 0 0;
    padding: 0.5rem 1rem;
    font-weight: normal;
    font-size: 13px;
    transition: all 0.2s ease;
    margin-right: 0.25rem;
    text-decoration: none;
}

.nav-tabs .nav-link:hover {
    color: #0073aa;
    background-color: #f5f5f5;
    border-color: #aaa;
}

.nav-tabs .nav-link.active {
    color: #0073aa;
    background-color: #fff;
    border: 1px solid #ccc;
    border-bottom: 1px solid #fff;
    font-weight: 600;
}

.tab-content {
    padding-top: 1rem;
}

/* Form Groups */
.mb-3 {
    margin-bottom: 1rem !important;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-label-sm {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
}

.form-label-lg {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-label-lg:first-child {
    margin-top: 0;
}

/* Input Validation */
.is-invalid {
    border-color: #dc3545 !important;
}

.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Preview Modal */
#griffinforms-theme-preview-modal .modal-lg {
    max-width: 900px;
}

.griffinforms-preview-mock-form {
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    min-height: 400px;
}

.griffinforms-theme-preview-form {
    padding: 1.5rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.griffinforms-theme-preview-page {
    padding: 1rem;
}

.griffinforms-preview-section {
    padding: 1.5rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.griffinforms-section-heading {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.griffinforms-form-field {
    margin-bottom: 1rem;
}

.griffinforms-form-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.griffinforms-form-field input,
.griffinforms-form-field textarea,
.griffinforms-form-field select {
    display: block;
    width: 100%;
}

/* Preview Field Elements */
.griffinforms-text-input,
.griffinforms-email-input,
.griffinforms-textarea,
.griffinforms-select-input,
.griffinforms-file-upload {
    margin-bottom: 0;
}

.griffinforms-checkbox-group,
.griffinforms-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.griffinforms-checkbox-group .form-check,
.griffinforms-radio-group .form-check {
    margin-bottom: 0;
}

/* Buttons */
.griffinforms-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.griffinforms-preview-btn {
    white-space: nowrap;
}

.griffinforms-preview-btn i {
    font-size: 0.875rem;
}

/* Card Styling */
.card {
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.card-body {
    padding: 1.5rem;
}

/* Alert Messages */
.alert {
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Help Text */
.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Layout */
.row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.row > * {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.g-2 > * {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 0;
}

.g-3 > * {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .griffinforms-item-options {
        width: 100% !important;
        margin-left: 0;
        margin-right: 0;
    }

    .gf-formtheme-editor__surface,
    .gf-formtheme-editor .container.w-75.border-bottom {
        padding: 16px !important;
    }

    .griffinforms-preview-btn {
        margin-top: 0.5rem;
    }

    .griffinforms-preview-mock-form {
        padding: 1rem;
    }

    .griffinforms-theme-preview-form {
        padding: 1rem;
    }
}

/* Utility Classes */
.text-muted {
    color: #6c757d !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

.fw-normal {
    font-weight: 400 !important;
}

.text-secondary {
    color: #6c757d !important;
}

.me-1 {
    margin-right: 0.25rem !important;
}

.me-2 {
    margin-right: 0.5rem !important;
}

.me-4 {
    margin-right: 1.5rem !important;
}

.mt-1 {
    margin-top: 0.25rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.pt-3 {
    padding-top: 1rem !important;
}

.pb-3 {
    padding-bottom: 1rem !important;
}

.d-flex {
    display: flex !important;
}

.justify-content-between {
    justify-content: space-between !important;
}

.align-items-center {
    align-items: center !important;
}

.w-100 {
    width: 100% !important;
}

.border-bottom {
    border-bottom: 1px solid #dee2e6 !important;
}

.rounded-2 {
    border-radius: 0.375rem !important;
}

.border-0 {
    border: 0 !important;
}
