/* Custom Schema Admin Styles */

.schematiq-admin {
    max-width: 1200px;
}

.schematiq-page-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.schematiq-page-title__icon {
    font-size: 24px;
}

.schematiq-tabs {
    margin-top: 20px;
}

.schematiq-tabs .nav-tab-wrapper {
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    background: #f3f4f6;
    border-radius: 6px;
    padding: 4px;
    border: none;
}

.schematiq-tabs .nav-tab {
    margin-right: 4px;
    margin-bottom: 0;
    padding: 8px 14px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: #4b5563;
}

.schematiq-tabs .nav-tab:hover {
    background: #e5e7eb;
    color: #111827;
}

.schematiq-tabs .nav-tab-active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
}

.tab-content {
    display: none;
    padding: 20px;
    background: #fff;
    border-radius: 0 0 8px 8px;
    border: 1px solid #e5e7eb;
    border-top: none;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    margin-top: 0;
    padding-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.tab-content h3 {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.tab-content .form-table {
    margin-top: 0;
}

.tab-content .form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
    vertical-align: top;
}

.tab-content .form-table td {
    padding: 15px 10px;
}

.tab-content input[type="text"],
.tab-content input[type="url"],
.tab-content input[type="email"],
.tab-content input[type="tel"],
.tab-content input[type="number"],
.tab-content input[type="date"],
.tab-content input[type="datetime-local"] {
    width: 100%;
    max-width: 500px;
}

.tab-content input.small-text {
    width: 100px;
    max-width: 100px;
}

.tab-content textarea {
    width: 100%;
    max-width: 600px;
}

.tab-content textarea.code {
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.tab-content pre {
    margin: 10px 0;
    padding: 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow-x: auto;
}

.tab-content .description {
    color: #646970;
    font-style: italic;
    margin-top: 5px;
}

/* Overview Tab - Schema Toggles */
.schematiq-overview-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.schematiq-overview-intro__hint {
    max-width: 320px;
    margin: 0;
    padding: 10px 12px;
    background: #eef2ff;
    border-radius: 6px;
    font-size: 13px;
    color: #3730a3;
}

.schematiq-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.schematiq-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.schematiq-card.is-enabled {
    border-color: #2563eb;
}

.schematiq-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.schematiq-card-heading {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.schematiq-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #eff6ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
}

.schematiq-card-title {
    margin: 0;
    font-size: 15px;
}

.schematiq-card-subtitle {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: #6b7280;
}

.schematiq-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schematiq-card-footnote {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #6b7280;
}

.schematiq-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    text-transform: uppercase;
}

.schematiq-status-pill--on {
    background: #dcfce7;
    color: #166534;
}

.schematiq-status-pill--off {
    background: #e5e7eb;
    color: #374151;
}

.schematiq-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.schematiq-toggle input[type="checkbox"] {
    display: none;
}

.schematiq-toggle__control {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: #e5e7eb;
    transition: background 0.18s ease;
}

.schematiq-toggle__control::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
    transition: transform 0.18s ease;
}

.schematiq-toggle input[type="checkbox"]:checked + .schematiq-toggle__control {
    background: #2563eb;
}

.schematiq-toggle input[type="checkbox"]:checked + .schematiq-toggle__control::after {
    transform: translateX(16px);
}

.schematiq-toggle__label {
    font-size: 13px;
    color: #111827;
}

.schematiq-sub-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #4b5563;
}

.schematiq-sub-option input[type="checkbox"] {
    margin: 0;
}

.schematiq-card--seo {
    background: #f9fafb;
}

/* Compound Fields */
.schema-compound-field {
    background: #f9f9f9;
    padding: 15px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.schema-compound-field p {
    margin: 0 0 15px 0;
}

.schema-compound-field p:last-child {
    margin-bottom: 0;
}

.schema-compound-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.schema-inline-fields {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.schema-inline-fields label {
    display: inline;
    font-weight: normal;
}

/* Per-schema settings layout */
.schematiq-tab-header {
    margin-bottom: 16px;
}

.schematiq-tab-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: #6b7280;
}

.schematiq-settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 2fr);
    gap: 20px;
    margin-top: 8px;
}

.schematiq-settings-grid--single {
    grid-template-columns: minmax(0, 1fr);
}

.schematiq-settings-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.schematiq-settings-card__title {
    margin: 0;
    font-size: 15px;
}

.schematiq-settings-card__hint {
    margin: 4px 0 12px;
    font-size: 12px;
    color: #6b7280;
}

.schematiq-settings-card--callout {
    margin-bottom: 12px;
    background: #ecfdf3;
    border-color: #bbf7d0;
}

.schematiq-settings-card__callout p {
    margin: 4px 0 8px;
    font-size: 12px;
}

.schematiq-form-table--compact th,
.schematiq-form-table--compact td {
    padding-top: 8px;
    padding-bottom: 8px;
}

/* FAQ Repeater */
.schema-faq-repeater {
    max-width: 700px;
}

.faq-items {
    margin-bottom: 15px;
}

.faq-item {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 10px;
}

.faq-item:hover {
    border-color: #2271b1;
}

.faq-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
    cursor: move;
}

.faq-number {
    font-weight: 600;
    color: #2271b1;
    font-size: 14px;
}

.remove-faq-item {
    color: #b32d2e !important;
    text-decoration: none;
}

.remove-faq-item:hover {
    color: #a00 !important;
}

.faq-item p {
    margin: 0 0 10px 0;
}

.faq-item p:last-child {
    margin-bottom: 0;
}

.faq-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.faq-item input[type="text"],
.faq-item textarea {
    width: 100%;
    max-width: 100%;
}

.add-faq-item {
    margin-top: 10px;
}

/* Image Preview */
.schema-image-preview {
    margin-top: 10px;
}

.schema-image-preview img {
    max-width: 150px;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.schema-media-upload {
    margin-left: 10px !important;
}

/* Upgrade Notice */
.schematiq-upgrade-notice {
    margin-top: 20px;
}

.schematiq-upgrade-notice .button {
    margin-left: 10px;
}

/* Sticky footer bar */
.schematiq-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 12px 16px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.schematiq-footer-bar__hint {
    font-size: 12px;
    color: #6b7280;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .schematiq-tabs .nav-tab-wrapper {
        flex-direction: column;
    }
    
    .schematiq-tabs .nav-tab {
        margin-right: 0;
        margin-bottom: 2px;
    }
    
    .tab-content .form-table th,
    .tab-content .form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .tab-content input[type="text"],
    .tab-content input[type="url"],
    .tab-content input[type="email"],
    .tab-content input[type="tel"],
    .tab-content input[type="number"],
    .tab-content textarea {
        max-width: 100%;
    }
    
    .schema-inline-fields {
        flex-direction: column;
        align-items: flex-start;
    }

    .schematiq-overview-intro {
        flex-direction: column;
        gap: 10px;
    }
}
