/**
 * CSS styles for the OneClickContent Image Details plugin admin interface.
 *
 * Provides styling for settings forms, modals, bulk generation status, and UI elements.
 * All selectors are prefixed with .toplevel_page_occidg or .occ- to avoid clashes.
 *
 * @package    One_Click_Images
 * @subpackage One_Click_Images/admin/css
 * @author     OneClickContent
 * @since      1.0.0
 * @copyright  2025 OneClickContent
 * @license    GPL-2.0+
 * @link       https://github.com/jwilson529/oneclickcontent-images
 */

/* ==========================================================================
   1.0 General Container & Page Styling
   ========================================================================== */

.toplevel_page_occidg #occidg_images.wrap {
    max-width: 900px;
    margin: 1rem auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.toplevel_page_occidg #occidg_images form {
    margin-bottom: 20px;
}

/* ==========================================================================
   2.0 Headings & Dividers
   ========================================================================== */

.toplevel_page_occidg #occidg_images h1 {
    color: #fff;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 1rem;
    text-align: center;
}

.toplevel_page_occidg #occidg_images h2 {
    color: #444;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
}

.toplevel_page_occidg #occidg_images .settings-divider {
    border: 1px solid #ddd;
    margin: 30px 0;
}

/* ==========================================================================
   3.0 Usage Information Section
   ========================================================================== */

.toplevel_page_occidg #occidg_images .usage-info-section {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.toplevel_page_occidg #occidg_images .usage-summary strong {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-size: 18px;
}

/* Progress bar container & bar */
.toplevel_page_occidg .progress {
    height: 20px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.toplevel_page_occidg .progress-bar {
    line-height: 20px;
    color: #fff;
    font-size: 14px;
    text-align: center;
    transition: width 0.5s ease;
}

/* Progress bar color states */
.toplevel_page_occidg .bg-success {
    background-color: #28a745 !important;
}

.toplevel_page_occidg .bg-warning {
    background-color: #ffc107 !important;
    color: #333 !important;
}

.toplevel_page_occidg .bg-danger {
    background-color: #dc3545 !important;
}

#usage_status {
    margin: 1rem 0;
}

/* ==========================================================================
   4.0 Jumbotron (Optional Section)
   ========================================================================== */

.toplevel_page_occidg #occidg_images .jumbotron-wrapper {
    position: relative;
    max-height: 225px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.toplevel_page_occidg #occidg_images .jumbotron-wrapper img {
    width: 100%;
    height: auto;
    max-height: 100%;
    border-radius: inherit;
    object-fit: none;
}

.toplevel_page_occidg #occidg_images .jumbotron-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 10px 20px;
    width: 90%;
    color: #fff;
    font-size: 36px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    border-radius: 4px;
}

/* ==========================================================================
   5.0 Bulk Edit Header & Main CTA
   ========================================================================== */

.toplevel_page_occidg .bulk-edit-header {
    margin-bottom: 20px;
}

.toplevel_page_occidg .bulk-edit-header .button-hero {
    font-size: 18px;
    padding: 10px 20px;
    background-color: #007cba;
    border-color: #007cba;
    color: #fff;
}

.toplevel_page_occidg .bulk-edit-header .button-hero:hover {
    background-color: #005ea2;
    border-color: #005ea2;
}

.toplevel_page_occidg .bulk-edit-header .description {
    margin-top: 10px;
    font-style: italic;
    color: #666;
}

/* ==========================================================================
   6.0 Bulk Generate Status
   ========================================================================== */

.toplevel_page_occidg #bulk-generate-status {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    max-height: 330px;
    overflow-y: auto;
    display: none;
    /* Hidden until generation starts */
}

.toplevel_page_occidg #bulk-generate-status p {
    margin: 5px 0;
    font-size: 14px;
}

/* ==========================================================================
   7.0 Notifications
   ========================================================================== */

.toplevel_page_occidg .notice-success {
    padding: 15px;
    background-color: #e8f6ec;
    border-left: 4px solid #28a745;
    border-radius: 4px;
    color: #155724;
    font-size: 14px;
}

.toplevel_page_occidg .notice-error {
    padding: 15px;
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
    color: #721c24;
    font-size: 14px;
}

/* ==========================================================================
   8.0 Table & DataTables Styling
   ========================================================================== */

.toplevel_page_occidg #image-metadata-table {
    border-collapse: collapse;
}

.toplevel_page_occidg #image-metadata-table th,
.toplevel_page_occidg #image-metadata-table td {
    padding: 10px;
    border: 1px solid #ddd;
    vertical-align: top;
    text-align: center;
}

.toplevel_page_occidg #image-metadata-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* Thumbnail preview within table */
.toplevel_page_occidg #image-metadata-table .thumbnail-preview {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 3px;
    display: block;
    margin: 0 auto;
}

/* Force WordPress's thumbnail to respect sizing */
.toplevel_page_occidg #image-metadata-table img.attachment-thumbnail.size-thumbnail {
    max-width: 100% !important;
}

/* Form elements in table cells */
.toplevel_page_occidg #image-metadata-table input,
.toplevel_page_occidg #image-metadata-table textarea {
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 4px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
}

.toplevel_page_occidg #image-metadata-table textarea {
    height: 60px;
    resize: vertical;
}

/* Generate button in table rows */
.toplevel_page_occidg #image-metadata-table .generate-metadata {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
    padding: 4px 8px;
    font-size: 12px;
    margin: 0 auto;
    display: block;
    transition: background-color 0.3s ease;
}

.toplevel_page_occidg #image-metadata-table .generate-metadata:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.toplevel_page_occidg #image-metadata-table .generate-metadata:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
}

/* ==========================================================================
   9.0 Saving & Action Status Messages
   ========================================================================== */

/* Inputs: add extra padding for the status icon on the right */
.toplevel_page_occidg #image-metadata-table input,
.toplevel_page_occidg #image-metadata-table textarea {
    padding-right: 60px;
}

/* Wrapper for inputs with save status */
.toplevel_page_occidg .input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* Save status element */
.toplevel_page_occidg .save-status {
    display: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 10;
}

/* Different states */
.toplevel_page_occidg .save-status-saving {
    background-color: #007cba;
    color: #fff;
}

.toplevel_page_occidg .save-status-saved {
    background-color: #28a745;
    color: #fff;
}

.toplevel_page_occidg .save-status-error {
    background-color: #d94f4f;
    color: #fff;
}

.toplevel_page_occidg .save-status-nochange {
    background-color: #6c757d;
    color: #fff;
}

/* Action wrapper & status for "Generate" buttons */
.toplevel_page_occidg .action-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    text-align: center;
}

.toplevel_page_occidg .action-status {
    display: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 10;
}

/* Different states for action status */
.toplevel_page_occidg .action-status-working {
    background-color: #007cba;
    color: #fff;
}

.toplevel_page_occidg .action-status-success {
    background-color: #28a745;
    color: #fff;
}

.toplevel_page_occidg .action-status-error {
    background-color: #d94f4f;
    color: #fff;
}

.toplevel_page_occidg .generate-metadata {
    position: relative;
    padding-right: 60px;
}

/* ==========================================================================
   10.0 Bulk Generation Progress (Alternate Implementation)
   ========================================================================== */

/* ==========================================================================
      10.0 Bulk Generation Progress (Alternate Implementation)
      ========================================================================== */

.bulk-generate-status {
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px;
    display: none;
    /* Hidden until generation starts */
    max-height: 400px;
    /* Set a reasonable maximum height */
    overflow-y: auto;
    /* Enable vertical scrolling when content exceeds max-height */
}

.bulk-generate-status h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #333;
}

.bulk-generate-progress-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    height: 20px;
    margin: 20px 0;
}

.bulk-generate-progress-bar {
    height: 100%;
    width: 0%;
    background-color: #28a745;
    transition: width 0.5s ease;
    line-height: 20px;
    color: #fff;
    text-align: center;
    font-size: 12px;
}

.bulk-generate-message {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    color: #333;
}

.status-item {
    display: flex;
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #ddd;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.thumbnail-container {
    margin-right: 15px;
    margin-bottom: 10px;
}

.thumbnail-preview {
    max-width: 100px;
    max-height: 100px;
    display: block;
}

.attachment-thumbnail.size-thumbnail {
    border: 1px solid #ccc;
    padding: 3px;
    background: #fff;
    box-sizing: border-box;
}

.metadata-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
}

.metadata-table th,
.metadata-table td {
    padding: 5px;
    border: 1px solid #ddd;
}

.metadata-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.metadata-container a {
    color: #0073aa;
    text-decoration: none;
}

.metadata-container a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   11.0 Loading Indicator for Table
   ========================================================================== */

.toplevel_page_occidg #image-metadata-table.loading {
    opacity: 0.7;
    position: relative;
}

.toplevel_page_occidg #image-metadata-table.loading::after {
    content: 'Generating...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
}

/* ==========================================================================
   12.0 Spinner for Generate Button
   ========================================================================== */

.generate-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

/* Spinner Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.bulk-edit-provider-help.compact {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    background: radial-gradient(circle at top left, #a1c4fd, #c2e9fb, #c2e9fb 70%);
    color: #1e2a38;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    animation: fadeIn 0.6s ease;
    position: relative;
    overflow: hidden;
}

.bulk-edit-provider-help.compact .cta-left {
    flex: 1 1 60%;
    min-width: 250px;
}

.bulk-edit-provider-help.compact .cta-left h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #102a43;
}

.bulk-edit-provider-help.compact .cta-left p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    color: #1f2937;
}

.bulk-edit-provider-help.compact .benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bulk-edit-provider-help.compact .benefits-list li {
    position: relative;
    padding-left: 22px;
    margin: 8px 0;
    font-size: 14px;
    color: #1f2937;
}

.bulk-edit-provider-help.compact .benefits-list li::before {
    content: "✔";
    position: absolute;
    left: 0;
    color: #0077cc;
    font-weight: bold;
}

.toplevel_page_occidg .modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.toplevel_page_occidg .modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.toplevel_page_occidg .modal-buttons {
    margin-top: 20px;
    text-align: right;
}

.toplevel_page_occidg .modal-buttons .button {
    margin-left: 10px;
}

#bulk-generate-warning.warning {
    color: #d63638;
    margin: 10px 0;
}

#bulk-generate-warning .generate-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.dataTables_wrapper .dataTables_length select {
    width: 65px;
}


/* Modal Container */
#occidg-first-time-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toplevel_page_occidg select#dt-length-0 {
    width: 100%;
}

#occidg-first-time-modal .modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

#occidg-first-time-modal .modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#occidg-first-time-modal .modal-content h2 {
    margin-top: 0;
}

#occidg-first-time-modal .modal-buttons .button+.button {
    margin-left: 10px;
}

/* -------------------------------
   Responsive Nav Tabs
------------------------------- */
.nav-tab-wrapper {
    overflow-x: auto;          /* Enable horizontal scroll */
    white-space: nowrap;       /* Keep tabs on one line */
    padding-bottom: 5px;       /* Allow space for scrollbar if needed */
}

.nav-tab-wrapper .nav-tab {
    display: inline-block;     /* Size based on content */
    width: auto !important;    /* Override WP default full width */
    margin-right: 10px;        /* Space between tabs */
    box-sizing: border-box;
}

/* Reduce padding/font on smaller screens */
@media (max-width: 768px) {
    .nav-tab-wrapper .nav-tab {
        padding: 8px 10px;
        font-size: 14px;
    }
}

/* -------------------------------
   Responsive DataTable Container
------------------------------- */
.dt-container {
    display: block;
    width: 100%;
    overflow-x: auto;          /* Allow horizontal scrolling if table is wider than viewport */
    -webkit-overflow-scrolling: touch;  /* Smooth scrolling on mobile */
}

/* Let the table size itself based on content instead of forced 100% width */
.dt-container table {
    width: auto !important;
    min-width: 800px;          /* Adjust this value as needed based on your columns */
    border-collapse: collapse;
}

/* Prevent table cells from wrapping so that columns maintain their width */
.dt-container table th,
.dt-container table td {
    white-space: nowrap;
}

/* Optional: Adjust cell padding and font sizes on smaller screens */
@media (max-width: 768px) {
    .dt-container table th,
    .dt-container table td {
        padding: 8px 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .dt-container table th,
    .dt-container table td {
        padding: 6px 8px;
        font-size: 12px;
    }
}

@media (min-width: 1024px) {
	#image-metadata-table_wrapper,
	#image-metadata-table {
        width: 100% !important;
    }
}

/* ==========================================================================
   13.0 UI Once-Over Overrides
   ========================================================================== */

.toplevel_page_occidg #occidg_images.wrap {
    max-width: 1280px;
    margin: 1rem 0 0;
    padding: 24px;
    background:
        linear-gradient(180deg, #f8fbff 0%, #f5f7fa 100%);
    border: 1px solid #d9e2ec;
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    font-family: inherit;
}

.toplevel_page_occidg #occidg_images h2 {
    color: #102a43;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.toplevel_page_occidg #occidg_images .bulk-edit-provider-help.compact {
    gap: 18px;
    align-items: flex-start;
    margin: 0 0 24px;
    padding: 24px;
    border: 1px solid rgba(29, 78, 216, 0.14);
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.9), rgba(239, 246, 255, 0.95) 48%, rgba(255, 255, 255, 0.98) 100%);
    box-shadow: none;
}

.toplevel_page_occidg #occidg_images .bulk-edit-provider-help.compact .cta-left h2 {
    margin-bottom: 8px;
    font-size: 1.35rem;
}

.toplevel_page_occidg .occidg-settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.toplevel_page_occidg .occidg-settings-main {
    min-width: 0;
}

.toplevel_page_occidg .occidg-settings-sidebar {
    display: grid;
    gap: 16px;
    position: sticky;
    top: 32px;
}

.toplevel_page_occidg .occidg-sidebar-card {
    padding: 18px;
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.toplevel_page_occidg .occidg-sidebar-card h3 {
    margin: 0 0 12px;
    color: #102a43;
    font-size: 1rem;
}

.toplevel_page_occidg .occidg-sidebar-card-primary {
    background: linear-gradient(180deg, #102a43 0%, #16324f 100%);
    border-color: #102a43;
    color: #f0f4f8;
}

.toplevel_page_occidg .occidg-sidebar-card-primary h3,
.toplevel_page_occidg .occidg-sidebar-card-primary strong,
.toplevel_page_occidg .occidg-sidebar-card-primary span,
.toplevel_page_occidg .occidg-sidebar-card-primary p {
    color: inherit;
}

.toplevel_page_occidg .occidg-sidebar-eyebrow {
    margin: 0 0 12px;
    color: #9fb3c8;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.toplevel_page_occidg .occidg-sidebar-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.toplevel_page_occidg .occidg-sidebar-note {
    margin: 0;
    color: #52606d;
    font-size: 13px;
    line-height: 1.5;
}

.toplevel_page_occidg .occidg-sidebar-card-primary .occidg-sidebar-note {
    color: #d9e2ec;
}

.toplevel_page_occidg .occidg-sidebar-note.is-ready {
    color: #2f855a;
}

.toplevel_page_occidg .occidg-sidebar-card-primary .occidg-sidebar-note.is-ready {
    color: #b8f5cf;
}

.toplevel_page_occidg .occidg-sidebar-note.is-missing {
    color: #b42318;
}

.toplevel_page_occidg .occidg-sidebar-card-primary .occidg-sidebar-note.is-missing {
    color: #fecaca;
}

.toplevel_page_occidg .occidg-sidebar-metrics {
    display: grid;
    gap: 10px;
}

.toplevel_page_occidg .occidg-sidebar-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.09);
}

.toplevel_page_occidg .occidg-sidebar-list {
    margin: 0;
    padding-left: 18px;
    color: #334e68;
}

.toplevel_page_occidg .occidg-sidebar-list li + li {
    margin-top: 8px;
}

.toplevel_page_occidg .occidg-sidebar-list-ordered {
    padding-left: 20px;
}

.toplevel_page_occidg .occidg-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #e0e7ff;
    color: #1d4ed8;
}

.toplevel_page_occidg .occidg-status-pill.is-openai {
    background: #dbeafe;
    color: #1d4ed8;
}

.toplevel_page_occidg .occidg-status-pill.is-gemini {
    background: #ede9fe;
    color: #6d28d9;
}

.toplevel_page_occidg .occidg-status-pill.is-success {
    background: #dcfce7;
    color: #166534;
}

.toplevel_page_occidg .occidg-status-pill.is-error {
    background: #fee2e2;
    color: #b42318;
}

.toplevel_page_occidg .occidg-status-pill.is-paused {
    background: #fef3c7;
    color: #92400e;
}

.toplevel_page_occidg .bulk-edit-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.toplevel_page_occidg .bulk-edit-header .description {
    flex: 1 0 100%;
    margin: 0;
    color: #52606d;
    font-style: normal;
}

.toplevel_page_occidg .bulk-edit-header .button-hero {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
}

.toplevel_page_occidg .occidg-settings-form .submit {
    margin: 8px 0 0;
    padding: 0;
}

.toplevel_page_occidg .occidg-settings-form .submit .button {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
}

.toplevel_page_occidg #occidg_images .form-table {
    margin: 0 0 28px;
    border-collapse: separate;
    border-spacing: 0 12px;
}

.toplevel_page_occidg #occidg_images .form-table th {
    width: 240px;
    padding: 10px 16px 0 0;
    color: #102a43;
    font-weight: 700;
    vertical-align: top;
}

.toplevel_page_occidg #occidg_images .form-table td {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 14px;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.toplevel_page_occidg #occidg_images .form-table input[type="text"],
.toplevel_page_occidg #occidg_images .form-table input[type="password"],
.toplevel_page_occidg #occidg_images .form-table select,
.toplevel_page_occidg #occidg_images .form-table textarea {
    width: 100%;
    max-width: 440px;
    min-height: 40px;
    border: 1px solid #bcccdc;
    border-radius: 10px;
    box-shadow: none;
}

.toplevel_page_occidg #occidg_images .form-table input[type="text"]:focus,
.toplevel_page_occidg #occidg_images .form-table input[type="password"]:focus,
.toplevel_page_occidg #occidg_images .form-table select:focus,
.toplevel_page_occidg #occidg_images .form-table textarea:focus,
.toplevel_page_occidg #image-metadata-table input:focus,
.toplevel_page_occidg #image-metadata-table textarea:focus,
.toplevel_page_occidg .button:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
    outline: none;
}

.toplevel_page_occidg #occidg_images .form-table p.description {
    margin-top: 8px;
    color: #52606d;
    font-size: 13px;
    line-height: 1.5;
}

.toplevel_page_occidg .occidg-provider-setting-field {
    display: grid;
    gap: 8px;
    max-width: 440px;
}

.toplevel_page_occidg .occidg-provider-field-status {
    min-height: 20px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.toplevel_page_occidg .occidg-provider-field-status.is-working {
    color: #1d4ed8;
}

.toplevel_page_occidg .occidg-provider-field-status.is-success {
    color: #166534;
}

.toplevel_page_occidg .occidg-provider-field-status.is-error {
    color: #b42318;
}

.toplevel_page_occidg .occidg-provider-field-status.is-idle {
    color: #52606d;
}

.toplevel_page_occidg .occidg-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.toplevel_page_occidg .occidg-metadata-fields-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    max-width: 900px;
}

.toplevel_page_occidg .occidg-choice-card,
.toplevel_page_occidg .occidg-toggle-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid #d9e2ec;
    border-radius: 14px;
    background: #f8fbff;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.toplevel_page_occidg .occidg-choice-card:hover,
.toplevel_page_occidg .occidg-toggle-card:hover {
    border-color: #9fb3c8;
    transform: translateY(-1px);
}

.toplevel_page_occidg .occidg-choice-card.is-checked,
.toplevel_page_occidg .occidg-toggle-card.is-checked {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.toplevel_page_occidg .occidg-choice-card input,
.toplevel_page_occidg .occidg-toggle-card input {
    width: auto;
    min-height: 18px;
    margin: 2px 0 0;
}

.toplevel_page_occidg .occidg-choice-copy {
    display: grid;
    gap: 4px;
}

.toplevel_page_occidg .occidg-choice-title,
.toplevel_page_occidg .occidg-toggle-title {
    display: block;
    color: #102a43;
    font-weight: 700;
}

.toplevel_page_occidg .occidg-choice-description,
.toplevel_page_occidg .occidg-toggle-description {
    display: block;
    margin-top: 4px;
    color: #52606d;
    font-size: 13px;
    line-height: 1.5;
}

.toplevel_page_occidg .occidg-metadata-field-card {
    min-height: 68px;
}

.toplevel_page_occidg .occidg-toggle-copy {
    display: grid;
    gap: 2px;
}

.toplevel_page_occidg .occidg-provider-row.is-inactive {
    display: none;
}

.toplevel_page_occidg .occidg-provider-row.is-active td {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.toplevel_page_occidg .bulk-generate-status {
    padding: 18px;
    border: 1px solid #d9e2ec;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.toplevel_page_occidg .bulk-generate-message {
    font-weight: 600;
    text-align: left;
    color: #243b53;
}

.toplevel_page_occidg .occidg-job-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.toplevel_page_occidg .occidg-job-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.toplevel_page_occidg .occidg-job-summary {
    margin-top: 14px;
}

.toplevel_page_occidg .occidg-job-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.toplevel_page_occidg .occidg-job-summary-card {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid #d9e2ec;
    border-radius: 14px;
    background: #f8fbff;
}

.toplevel_page_occidg .occidg-job-summary-card strong {
    color: #102a43;
}

.toplevel_page_occidg .occidg-job-summary-card span {
    color: #52606d;
}

.toplevel_page_occidg .occidg-job-failures {
    margin-top: 14px;
}

.toplevel_page_occidg .occidg-job-failure-card {
    margin-top: 0;
}

.toplevel_page_occidg .occidg-job-empty-state {
    background: #f8fbff;
}

.toplevel_page_occidg .occidg-job-empty-state p {
    margin: 0;
    color: #52606d;
}

.toplevel_page_occidg .occidg-job-failure-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.toplevel_page_occidg .occidg-job-failure-item {
    display: grid;
    gap: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid #d9e2ec;
}

.toplevel_page_occidg .occidg-job-failure-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.toplevel_page_occidg .occidg-job-failure-link {
    color: #1d4ed8;
    font-weight: 600;
    text-decoration: none;
}

.toplevel_page_occidg .occidg-job-failure-link:hover {
    text-decoration: underline;
}

.toplevel_page_occidg .status-item {
    display: grid;
    gap: 12px;
    margin: 12px 0 0;
    padding: 14px;
    border: 1px solid #d9e2ec;
    border-radius: 14px;
    background: #f8fbff;
    box-shadow: none;
}

.toplevel_page_occidg .status-item__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.toplevel_page_occidg .status-item__header a {
    color: #1d4ed8;
    font-weight: 600;
    text-decoration: none;
}

.toplevel_page_occidg .status-item__header a:hover {
    text-decoration: underline;
}

.toplevel_page_occidg .status-item__body {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.toplevel_page_occidg .metadata-table {
    border-radius: 12px;
    overflow: hidden;
}

.toplevel_page_occidg #image-metadata-table_wrapper,
.toplevel_page_occidg #image-metadata-table {
    background: transparent;
}

.toplevel_page_occidg #image-metadata-table th,
.toplevel_page_occidg #image-metadata-table td {
    padding: 12px 10px;
    border-color: #d9e2ec;
}

.toplevel_page_occidg #image-metadata-table td {
    background: #fff;
}

.toplevel_page_occidg #image-metadata-table .generate-metadata {
    min-width: 88px;
    border-radius: 999px;
    padding: 5px 12px;
    font-weight: 600;
}

.toplevel_page_occidg .occidg-generation-gate-message {
    margin: 6px 0 0;
    color: #b42318;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.toplevel_page_occidg .occidg-generation-gate-message-modal {
    margin: 12px 0 0;
}

.toplevel_page_occidg .save-status,
.toplevel_page_occidg .action-status {
    align-items: center;
    max-width: 180px;
    line-height: 1.3;
}

.toplevel_page_occidg .action-wrapper {
    min-height: 32px;
}

@media (max-width: 1080px) {
    .toplevel_page_occidg .occidg-settings-layout {
        grid-template-columns: 1fr;
    }

    .toplevel_page_occidg .occidg-settings-sidebar {
        position: static;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 782px) {
    .toplevel_page_occidg #occidg_images.wrap {
        padding: 18px;
    }

    .toplevel_page_occidg #occidg_images .form-table th,
    .toplevel_page_occidg #occidg_images .form-table td {
        display: block;
        width: 100%;
    }

    .toplevel_page_occidg #occidg_images .form-table th {
        padding: 10px 0 6px;
    }

    .toplevel_page_occidg .status-item__body {
        flex-direction: column;
    }

    .toplevel_page_occidg .occidg-job-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toplevel_page_occidg .occidg-job-actions {
        width: 100%;
    }
}
