/* ═══════════════════════════════════════════════════════════════
   Herodotus — Admin Styles
   ═══════════════════════════════════════════════════════════════ */

.herodotus-admin-wrap {
    max-width: 1200px;
    margin: 0 !important;
    padding: 0;
    background: #f0f2f5;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.herodotus-notices-anchor { display: none; }

/* ─── Metabox: Year + Era ────────────────────────────────────── */
.herodotus-year-era-wrap {
    display: flex;
    gap: 6px;
    align-items: center;
}
.herodotus-year-input {
    flex: 1;
    min-width: 0;
}
.herodotus-era-select {
    width: 58px;
    flex-shrink: 0;
}

/* ─── Header ────────────────────────────────────────────────── */
.herodotus-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-bottom: 1px solid #e2e4e8;
    padding: 14px 24px;
}

.herodotus-header__left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.herodotus-header__logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}

.herodotus-header__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.herodotus-header__title {
    font-size: 18px;
    font-weight: 700;
    color: #0552BA;
    padding-bottom: 5px;
}

.herodotus-header__desc {
    font-size: 12.5px;
    color: #646970;
    line-height: 1.4;
}

.herodotus-header__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.herodotus-header__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    line-height: 1;
    flex-shrink: 0;
}

.herodotus-header__icon--blue  { background: #0552BA; color: #fff !important; }
.herodotus-header__icon--blue:hover  { background: #0445A0; }
.herodotus-header__icon--gray  { background: #646970; color: #fff !important; }
.herodotus-header__icon--gray:hover  { background: #3c434a; }

.herodotus-header__version {
    font-size: 18px;
    font-weight: 700;
    color: #0552BA;
    margin-left: 6px;
}

/* ─── Tab Navigation ────────────────────────────────────────── */
.herodotus-nav-tabs {
    display: flex;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #e2e4e8;
    padding: 0 24px;
    gap: 0;
    margin: 0 !important;
    border-top: none !important;
}

.herodotus-nav-tab {
    display: inline-flex !important;
    align-items: center;
    height: 44px;
    padding: 0 16px !important;
    font-size: 13.5px;
    font-weight: 500;
    color: #50575e !important;
    text-decoration: none !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    background: none !important;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    margin: 0 !important;
    border-radius: 0 !important;
}

.herodotus-nav-tab:hover { color: #0552BA !important; }

.herodotus-nav-tab.nav-tab-active {
    color: #0552BA !important;
    border-bottom-color: #0552BA !important;
    font-weight: 600;
}

/* ─── Content ───────────────────────────────────────────────── */
.herodotus-admin-content {
    padding: 28px 24px 48px;
}

.herodotus-page-title {
    font-size: 26px !important;
    font-weight: 700 !important;
    color: #1d2327 !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
    border: none !important;
    letter-spacing: -0.3px;
}

.herodotus-page-subtitle {
    font-size: 14px;
    color: #646970;
    margin: 0 0 24px;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.herodotus-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.herodotus-card--danger { border-color: #f0b8b8; }

.herodotus-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px 14px;
    border-bottom: 1px solid #f0f2f5;
}

.herodotus-card__header .dashicons { color: #0552BA; font-size: 18px; width: 18px; height: 18px; }
.herodotus-card--danger .herodotus-card__header .dashicons { color: #b32d2e; }

.herodotus-card__header h3 {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1d2327 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.herodotus-card--danger .herodotus-card__header h3 { color: #b32d2e !important; }

.herodotus-card__body { padding: 20px; }

/* ─── Grid ──────────────────────────────────────────────────── */
.herodotus-tab-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .herodotus-tab-grid { grid-template-columns: 1fr; }
}

/* ─── Form Table — vertical ─────────────────────────────────── */
.herodotus-form-table {
    border-collapse: collapse !important;
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
}

.herodotus-form-table tbody { display: block !important; }

.herodotus-form-table tr {
    display: flex !important;
    flex-direction: column;
    margin-bottom: 20px;
}

.herodotus-form-table tr:last-child { margin-bottom: 0; }

.herodotus-form-table th {
    display: block !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #646970;
    padding: 0 0 6px !important;
    width: auto !important;
}

.herodotus-form-table td {
    display: block !important;
    padding: 0 !important;
    width: auto !important;
}

/* ─── Form Table — horizontal (Display tab) ─────────────────── */
.herodotus-form-table--horizontal tr {
    flex-direction: row !important;
    align-items: flex-start;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 24px;
}

.herodotus-form-table--horizontal tr:last-child {
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 0;
}

.herodotus-form-table--horizontal th {
    flex: 0 0 200px;
    padding: 10px 0 0 !important;
    width: 200px !important;
}

.herodotus-form-table--horizontal th label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #646970;
}

.herodotus-form-table--horizontal td {
    flex: 0 0 420px;
    width: 420px;
    min-width: 0;
}

.herodotus-form-table--horizontal td select,
.herodotus-form-table--horizontal td input[type="text"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}



/* ─── Visibility Options (Display tab, built by JS) ─────────── */
.herodotus-visibility-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f0f2f5;
}

.herodotus-visibility-heading {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1d2327 !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    border: none !important;
}

.herodotus-visibility-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 700px) {
    .herodotus-visibility-grid { grid-template-columns: 1fr; }
}

.herodotus-visibility-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    background: #fafbfc;
    cursor: pointer;
    transition: border-color 0.15s;
}

.herodotus-visibility-item:hover { border-color: #c0c5d0; }

.herodotus-visibility-item input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    margin-top: 2px;
    accent-color: #0552BA;
    flex-shrink: 0;
    cursor: pointer;
}

.herodotus-visibility-item__label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
}

.herodotus-visibility-item__title {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
}

.herodotus-visibility-item__desc {
    font-size: 12px;
    color: #8c8f94;
    line-height: 1.4;
}

/* ─── Display card footer ───────────────────────────────────── */
.herodotus-card__footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid #f0f2f5;
    background: #fafbfc;
}

.herodotus-card__footer-note {
    font-size: 12px;
    font-style: italic;
    color: #8c8f94;
    margin-right: auto;
}

/* ─── Input Wrapper ─────────────────────────────────────────── */
.herodotus-input-wrap {
    display: flex;
    align-items: center;
    background: #eef0f3;
    border-radius: 7px;
    border: 1px solid transparent;
    overflow: hidden;
    transition: border-color 0.15s;
}

.herodotus-input-wrap:focus-within {
    border-color: #0552BA;
    background: #fff;
}

.herodotus-number-input {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #1d2327 !important;
    padding: 10px 14px !important;
    width: 100% !important;
    height: auto !important;
    outline: none !important;
    min-width: 0;
}

.herodotus-input-suffix {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #8c8f94;
    padding: 0 14px 0 0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ─── Inputs (text, url) ────────────────────────────────────── */
.herodotus-form-table input[type="text"],
.herodotus-form-table input[type="url"] {
    background: #eef0f3 !important;
    border: 1px solid transparent !important;
    border-radius: 7px !important;
    font-size: 14px !important;
    padding: 10px 14px !important;
    color: #1d2327 !important;
    box-shadow: none !important;
    transition: border-color 0.15s;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
}

.herodotus-form-table input[type="text"]:focus,
.herodotus-form-table input[type="url"]:focus {
    border-color: #0552BA !important;
    background: #fff !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ─── Select ────────────────────────────────────────────────── */
.herodotus-form-table select {
    background: #eef0f3 !important;
    border: 1px solid transparent !important;
    border-radius: 7px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #1d2327 !important;
    padding: 10px 36px 10px 14px !important;
    width: 100% !important;
    height: auto !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23646970' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    cursor: pointer;
    transition: border-color 0.15s;
}

.herodotus-form-table select:focus {
    border-color: #0552BA !important;
    background-color: #fff !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ─── Checkbox (General / Advanced) ────────────────────────── */
.herodotus-form-table input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    accent-color: #0552BA;
    cursor: pointer;
    vertical-align: middle;
    margin-right: 6px;
}

.herodotus-form-table label {
    font-size: 14px;
    color: #1d2327;
    cursor: pointer;
    line-height: 1.5;
}

.herodotus-form-table .description {
    font-size: 12px !important;
    color: #8c8f94 !important;
    margin-top: 6px !important;
    line-height: 1.5 !important;
}

.herodotus-warning-text { color: #b32d2e !important; }

/* ─── Default Image Field ───────────────────────────────────── */
.herodotus-image-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.herodotus-image-field-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.herodotus-image-field input[type="text"] {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
}

.herodotus-image-field .button {
    flex-shrink: 0 !important;
    background: #0552BA !important;
    border-color: #0552BA !important;
    color: #fff !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    padding: 0 14px !important;
    height: 36px !important;
    line-height: 36px !important;
    box-shadow: none !important;
}

.herodotus-image-field .button:hover {
    background: #0445A0 !important;
    border-color: #0445A0 !important;
}

.herodotus-image-preview img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e4e8;
    display: block;
    margin-top: 4px;
}

/* ─── Shortcodes ────────────────────────────────────────────── */
.herodotus-shortcodes-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.herodotus-shortcodes-card__header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f2f5;
}

.herodotus-shortcodes-card__header h3 {
    font-size: 16px !important;
    font-weight: 700 !important;
    margin: 0 0 4px !important;
    color: #1d2327 !important;
    border: none !important;
    padding: 0 !important;
}

.herodotus-shortcodes-card__subtitle {
    font-size: 13px;
    color: #646970;
    margin: 0;
}

.herodotus-example-list {
    display: flex;
    flex-direction: column;
}

/* ─── Section label (Basic / Pro) ──────────────────────────── */
.herodotus-sc-section-label {
    padding: 7px 20px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #646970;
    background: #f7f8f9;
    border-bottom: 1px solid #f0f2f5;
}

.herodotus-sc-section-label--pro {
    color: #646970;
    background: #f7f8f9;
}

/* ─── Row: code | copy-btn | description ───────────────────── */
.herodotus-example {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr);
    align-items: center;
    padding: 10px 10px;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.1s;
}

.herodotus-example:last-child { border-bottom: none; }
.herodotus-example:hover { background: #fafbfc; }

.herodotus-example code,
.herodotus-example .herodotus-copy-code {
    background: #eef0f3;
    color: #0552BA;
    padding: 10px 10px;
    border-radius: 6px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    display: block;
}

.herodotus-copy-btn {
    opacity: 1;
    transition: opacity 0.15s;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #8c8f94;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0 2px;
}

.herodotus-example:hover .herodotus-copy-btn { opacity: 1; }
.herodotus-copy-btn:hover { color: #1d2327; background: #e8e8e8; }
.herodotus-copy-btn__done { display: none; }
.herodotus-copy-btn.herodotus-copied { opacity: 1; color: #155724; }
.herodotus-copy-btn.herodotus-copied .herodotus-copy-btn__copy { display: none; }
.herodotus-copy-btn.herodotus-copied .herodotus-copy-btn__done { display: inline-flex; }

.herodotus-example span {
    color: #50575e;
    font-size: 14px;
    line-height: 1.4;
    padding-left: 4px;
}

.herodotus-example.herodotus-copied code,
.herodotus-example.herodotus-copied .herodotus-copy-code {
    background: #d4edda;
    color: #155724;
}
/* ─── Submit button ─────────────────────────────────────────── */
#herodotus-tab-submit { margin-top: 24px; }

#herodotus-tab-submit .button-primary {
    background: #0552BA !important;
    border-color: #0552BA !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 0 20px !important;
    height: 36px !important;
    line-height: 36px !important;
    border-radius: 6px !important;
    box-shadow: none !important;
}

#herodotus-tab-submit .button-primary:hover {
    background: #0445A0 !important;
    border-color: #0445A0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   Data tab — CSS for Pro's Export/Import HTML
   Pro renders inside #herodotus-tab-data via herodotus_admin_export_import.
   These styles target common WP form patterns Pro is likely to use.
   ═══════════════════════════════════════════════════════════════ */

/* Two-column layout for the data tab top section */
#herodotus-tab-data .herodotus-data-grid,
#herodotus-tab-data .herodotus-tab-data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    #herodotus-tab-data .herodotus-data-grid,
    #herodotus-tab-data .herodotus-tab-data-grid { grid-template-columns: 1fr; }
}

/* Data cards (Export / Import) */
.herodotus-data-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.herodotus-data-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px 14px;
    border-bottom: 1px solid #f0f2f5;
}

.herodotus-data-card__header h3 {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1d2327 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.herodotus-data-card__body { padding: 20px; }

/* Export checkboxes */
.herodotus-export-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.herodotus-export-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #e8eaed;
    border-radius: 7px;
    background: #fafbfc;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #1d2327;
    transition: border-color 0.15s;
}

.herodotus-export-item input[type="checkbox"] {
    accent-color: #0552BA;
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0;
    margin: 0 !important;
}

/* Import drop zone */
.herodotus-dropzone {
    border: 2px dashed #d0d4e0;
    border-radius: 8px;
    padding: 32px 20px;
    text-align: center;
    margin-bottom: 14px;
    transition: border-color 0.15s, background 0.15s;
    cursor: pointer;
    background: #fafbfc;
}

.herodotus-dropzone:hover,
.herodotus-dropzone.dragover {
    border-color: #0552BA;
    background: #f0f2ff;
}

.herodotus-dropzone__icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
    color: #8c8f94;
}

.herodotus-dropzone__text { font-size: 13px; color: #50575e; margin-bottom: 4px; }

.herodotus-dropzone__link {
    color: #0552BA;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

/* Import warning notice */
.herodotus-import-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: #f0f2ff;
    border-radius: 6px;
    font-size: 12px;
    color: #3c434a;
    line-height: 1.5;
    margin-top: 12px;
}

.herodotus-import-notice .dashicons {
    color: #0552BA;
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Buttons in Data tab */
.herodotus-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    padding: 0 16px;
    height: 36px;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background 0.15s;
}

.herodotus-btn--primary {
    background: #0552BA;
    color: #fff !important;
    width: 100%;
    justify-content: center;
}

.herodotus-btn--primary:hover { background: #0445A0; color: #fff !important; }

.herodotus-btn--download {
    background: #0552BA;
    color: #fff !important;
}

.herodotus-btn--download:hover { background: #0445A0; }

/* ═══════════════════════════════════════════════════════════════
   Metabox
   ═══════════════════════════════════════════════════════════════ */
.herodotus-datepicker-wrap { padding: 4px 0; }
.herodotus-datepicker-wrap label { font-weight: 600; display: block; margin-bottom: 4px; }

.herodotus-date-input {
    cursor: pointer !important;
    background: #fff !important;
    font-size: 14px !important;
    padding: 6px 10px !important;
    text-align: center;
}

.herodotus-date-input::placeholder { color: #999; font-style: italic; }

.herodotus-date-info {
    margin-top: 10px;
    padding: 8px 12px;
    background: #e8f5e9;
    border-left: 3px solid #4caf50;
    border-radius: 3px;
    font-size: 12px;
    color: #333;
    line-height: 1.5;
}

#ui-datepicker-div { z-index: 100100 !important; }

.herodotus-date-warning {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #fce8e8;
    border-left: 3px solid #b32d2e;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    color: #b32d2e;
    line-height: 1.5;
}

.herodotus-not-set { color: #b32d2e; font-weight: 600; }
.herodotus-year-label { margin-top: 10px; }
.herodotus-tab-panel { padding-top: 0; }
