/* Base styles for front-end tables (shortcodes + Elementor widgets) */

.portal-ai-models-table-wrapper{
  width: 100%;
  overflow-x: auto;
}

.portal-ai-front-table{
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 14px;
  background: var(--portal-ai-table-bg, transparent);
}

.portal-ai-front-table th,
.portal-ai-front-table td{
  padding: 10px 12px;
  border: 1px solid var(--portal-ai-table-border, rgba(148,163,184,0.25));
  text-align: right;
  vertical-align: middle;
}

.portal-ai-front-table thead th{
  background: var(--portal-ai-table-head-bg, rgba(148,163,184,0.08));
  font-weight: 700;
}

.portal-ai-front-table tbody tr:nth-child(even){
  background: var(--portal-ai-table-zebra, rgba(148,163,184,0.04));
}

.portal-ai-front-table code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  background: rgba(148,163,184,0.12);
  padding: 2px 6px;
  border-radius: 8px;
}

.portal-ai-notice{
  padding: 10px 12px;
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 12px;
}

.portal-ai-table-controls{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

/* Shared control look (search + sort) */
.portal-ai-control,
.portal-ai-table-sort-select,
.portal-ai-table-provider-select,
.portal-ai-table-company-select{
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  outline: none;
  min-height: 40px;
  line-height: 1.1;
  box-sizing: border-box;
}

.portal-ai-table-sort-select,
.portal-ai-table-provider-select,
.portal-ai-table-company-select{
  cursor: pointer;
}

/* Force dropdown (select + options) dark theme */
.portal-ai-table-sort-select{
  background: #000 !important;
  color: #fff !important;
}
.portal-ai-table-sort-select option{
  background: #000 !important;
  color: #fff !important;
}

/* Provider / company dropdowns must match sort dropdown */
.portal-ai-table-provider-select,
.portal-ai-table-company-select{
  background: #000 !important;
  color: #fff !important;
}
.portal-ai-table-provider-select option,
.portal-ai-table-company-select option{
  background: #000 !important;
  color: #fff !important;
}

.portal-ai-table-note{
  font-size: 12px;
  opacity: 0.85;
  margin: 0 0 10px 0;
  text-align: left;
}

/* Model filters (IO) – match chat look by default */
.portal-ai-model-filters{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.portal-ai-model-filter-pill{
  background: #000 !important;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 10px 14px;
  color: #fff !important;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.1;
  user-select:none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.portal-ai-model-filter-pill:hover{
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06) !important;
}
.portal-ai-model-filter-pill.is-active{
  border-color: rgba(59,130,246,0.65);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.18);
}

/* Different open colors for Input/Output buttons */
.portal-ai-table-filter-btn.is-open[data-portal-ai-table-io-btn="input"]{
  border-color: var(--portal-ai-io-input-accent, rgba(59,130,246,0.75));
  box-shadow: 0 0 0 2px rgba(59,130,246,0.22);
}
.portal-ai-table-filter-btn.is-open[data-portal-ai-table-io-btn="output"]{
  border-color: var(--portal-ai-io-output-accent, rgba(34,197,94,0.75));
  box-shadow: 0 0 0 2px rgba(34,197,94,0.18);
}
.portal-ai-model-filter-dropdown{
  background: rgba(0,0,0,0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 8px;
  margin-bottom: 8px;
  display:flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap:8px;
}

/* Input/Output dropdowns should look different */
.portal-ai-model-filter-dropdown[data-portal-ai-table-io-dd="input"]{
  border-color: var(--portal-ai-io-input-border, rgba(59,130,246,0.35));
  background: var(--portal-ai-io-input-bg, rgba(15,23,42,0.96));
}
.portal-ai-model-filter-dropdown[data-portal-ai-table-io-dd="output"]{
  border-color: var(--portal-ai-io-output-border, rgba(34,197,94,0.35));
  background: var(--portal-ai-io-output-bg, rgba(15,23,42,0.96));
}
.portal-ai-model-filter-dropdown label{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor:pointer;
  color: rgba(255,255,255,0.92);
}
.portal-ai-model-filter-dropdown label:hover{
  background: rgba(255,255,255,0.06);
}
.portal-ai-model-filter-dropdown input[type="checkbox"]{
  accent-color: var(--portal-ai-accent, #6366f1);
}

.portal-ai-table-search{
  flex: 1;
  min-width: 180px;
}

.portal-ai-table-search-input{
  width: 100%;
  max-width: 420px;
  /* keep in sync with .portal-ai-control */
}

.portal-ai-table-search-input:focus{
  border-color: rgba(59,130,246,0.65);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.18);
}

.portal-ai-table-sort-select:focus{
  border-color: rgba(59,130,246,0.65);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.18);
}

.portal-ai-table-search-input::placeholder{
  color: rgba(255,255,255,0.55);
}

.portal-ai-name-wrap{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.portal-ai-model-avatar{
  width: 22px;
  height: 22px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
}
.portal-ai-model-link{
  color: inherit;
  text-decoration: none;
}
.portal-ai-model-link:hover{
  text-decoration: underline;
}

.portal-ai-avatar-cell{
  text-align: center;
}
.portal-ai-avatar-cell .portal-ai-model-avatar{
  width: 26px;
  height: 26px;
  border-radius: 10px;
}

.portal-ai-sublines{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.portal-ai-subline{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.portal-ai-subtag{
  font-size: 11px;
  opacity: 0.8;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
}
.portal-ai-intro-link{
  font-size: 12px;
}

.portal-ai-kb-icon{
  display:inline-block;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  line-height: 1;
  font-weight: 800;
  font-size: 16px;
}
.portal-ai-kb-icon.is-yes{ color: #22c55e; }
.portal-ai-kb-icon.is-no{ color: #ef4444; }

.portal-ai-table-pagination{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}

.portal-ai-page-btn{
  padding: 6px 10px;
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
}

.portal-ai-page-btn.is-active{
  font-weight: 700;
}

.portal-ai-page-btn:disabled{
  opacity: 0.5;
  cursor: default;
}

/* Mobile card view for tables (Elementor widgets can enable via data-mobile-cards="1") */
.portal-ai-mobile-cards{
  display: none;
}

.portal-ai-mobile-loadmore{
  display: inline-block;
  width: auto;
  max-width: 100%;
  margin: 12px auto 0;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  cursor: pointer;
}

.portal-ai-mobile-loadmore-wrap{
  text-align: center;
}

@media (min-width: 768px){
  /* never show on desktop */
  .portal-ai-mobile-loadmore-wrap{ display:none !important; }
}

.portal-ai-mobile-loadmore:disabled{
  opacity: 0.6;
  cursor: default;
}

.portal-ai-model-card{
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 16px;
  padding: 12px;
  background: rgba(148,163,184,0.04);
}

.portal-ai-model-card-head{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.portal-ai-model-card-index{
  font-size: 12px;
  opacity: 0.7;
}

.portal-ai-model-avatar--card{
  width: 32px;
  height: 32px;
  border-radius: 12px;
}

.portal-ai-model-card-title{
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}

.portal-ai-model-card-row{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px dashed rgba(148,163,184,0.18);
}

.portal-ai-model-card-row:first-of-type{
  border-top: none;
}

.portal-ai-model-card-label{
  font-size: 12px;
  opacity: 0.75;
  flex: 0 0 auto;
}

.portal-ai-model-card-value{
  font-size: 14px;
  text-align: left;
  flex: 1 1 auto;
}

.portal-ai-card-empty{
  padding: 10px 12px;
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 12px;
}

@media (max-width: 767px){
  .portal-ai-model-filter-dropdown{
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 6px;
  }
  .portal-ai-model-filter-dropdown label{
    display:flex;
    width: 100%;
  }

  .portal-ai-models-table-wrapper[data-mobile-cards="1"]{
    overflow-x: visible;
  }
  .portal-ai-models-table-wrapper[data-mobile-cards="1"] .portal-ai-front-table{
    display: none;
  }
  .portal-ai-models-table-wrapper[data-mobile-cards="1"] .portal-ai-mobile-cards{
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
}


/* Pricing sections and upgraded filters */
.portal-ai-pricing-sections{
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.portal-ai-pricing-section{
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 22px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(15,23,42,.92), rgba(15,23,42,.82));
  box-shadow: 0 18px 45px rgba(15,23,42,.18);
}
.portal-ai-pricing-section-title{
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
  letter-spacing: -.02em;
}
.portal-ai-models-table-wrapper .portal-ai-table-controls{
  gap: 10px;
}
.portal-ai-models-table-wrapper .portal-ai-table-provider,
.portal-ai-models-table-wrapper .portal-ai-table-company,
.portal-ai-models-table-wrapper .portal-ai-table-sort{
  min-width: 170px;
}
.portal-ai-models-table-wrapper .portal-ai-table-provider-select,
.portal-ai-models-table-wrapper .portal-ai-table-company-select,
.portal-ai-models-table-wrapper .portal-ai-table-sort-select,
.portal-ai-models-table-wrapper .portal-ai-table-search-input{
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.25);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.94);
  outline: 0;
  box-shadow: none;
}
.portal-ai-models-table-wrapper .portal-ai-table-provider-select:focus,
.portal-ai-models-table-wrapper .portal-ai-table-company-select:focus,
.portal-ai-models-table-wrapper .portal-ai-table-sort-select:focus,
.portal-ai-models-table-wrapper .portal-ai-table-search-input:focus{
  border-color: rgba(99,102,241,.75);
  box-shadow: 0 0 0 4px rgba(99,102,241,.18);
}
.portal-ai-models-table-wrapper .portal-ai-table-provider-select option,
.portal-ai-models-table-wrapper .portal-ai-table-company-select option,
.portal-ai-models-table-wrapper .portal-ai-table-sort-select option{
  color: #111827;
}
.portal-ai-models-table-wrapper td:nth-child(4),
.portal-ai-models-table-wrapper .portal-ai-model-card-value{
  line-height: 1.75;
}
@media (max-width: 767px){
  .portal-ai-pricing-section{ padding: 12px; border-radius: 18px; }
  .portal-ai-models-table-wrapper .portal-ai-table-provider,
  .portal-ai-models-table-wrapper .portal-ai-table-company,
  .portal-ai-models-table-wrapper .portal-ai-table-sort{
    width: 100%;
    min-width: 0;
  }
}

/* Portal-AI Tables v1.3.71 – unified filters + Main API provider semantics */
.portal-ai-models-table-wrapper .portal-ai-table-provider-select,
.portal-ai-models-table-wrapper .portal-ai-table-company-select,
.portal-ai-models-table-wrapper .portal-ai-table-sort-select,
.portal-ai-models-table-wrapper .portal-ai-table-search-input{
  width:100%;
  min-height:44px;
  padding:0 14px;
  border-radius:999px;
  border:1px solid rgba(148,163,184,.28);
  background:rgba(15,23,42,.88);
  color:#f8fafc;
  outline:0;
  appearance:auto;
  scrollbar-width:thin;
  scrollbar-color:rgba(148,163,184,.65) rgba(15,23,42,.95);
}
.portal-ai-models-table-wrapper .portal-ai-table-provider-select option,
.portal-ai-models-table-wrapper .portal-ai-table-company-select option,
.portal-ai-models-table-wrapper .portal-ai-table-sort-select option{
  background:#0f172a;
  color:#f8fafc;
}
.portal-ai-models-table-wrapper .portal-ai-table-provider-select::-webkit-scrollbar,
.portal-ai-models-table-wrapper .portal-ai-table-company-select::-webkit-scrollbar,
.portal-ai-models-table-wrapper .portal-ai-table-sort-select::-webkit-scrollbar,
.portal-ai-models-table-wrapper .portal-ai-table-filter-dropdown::-webkit-scrollbar{width:8px;height:8px;}
.portal-ai-models-table-wrapper .portal-ai-table-provider-select::-webkit-scrollbar-thumb,
.portal-ai-models-table-wrapper .portal-ai-table-company-select::-webkit-scrollbar-thumb,
.portal-ai-models-table-wrapper .portal-ai-table-sort-select::-webkit-scrollbar-thumb,
.portal-ai-models-table-wrapper .portal-ai-table-filter-dropdown::-webkit-scrollbar-thumb{background:rgba(148,163,184,.62);border-radius:999px;}
.portal-ai-models-table-wrapper .portal-ai-table-filter-dropdown{
  max-height:280px;
  overflow:auto;
  scrollbar-width:thin;
  scrollbar-color:rgba(148,163,184,.65) transparent;
}
.portal-ai-models-table-wrapper .portal-ai-model-filter-pill-input{
  background:rgba(14,165,233,.14);
  border-color:rgba(14,165,233,.36);
  color:#0369a1;
}
.portal-ai-models-table-wrapper .portal-ai-model-filter-pill-output{
  background:rgba(168,85,247,.14);
  border-color:rgba(168,85,247,.36);
  color:#6b21a8;
}
.portal-ai-models-table-wrapper .portal-ai-model-filter-dropdown-input{background:linear-gradient(180deg, rgba(224,242,254,.98), rgba(255,255,255,.98));}
.portal-ai-models-table-wrapper .portal-ai-model-filter-dropdown-output{background:linear-gradient(180deg, rgba(243,232,255,.98), rgba(255,255,255,.98));}
.portal-ai-models-table-wrapper .portal-ai-model-filter-title{
  font-weight:900;
  font-size:12px;
  margin:0 0 8px;
  padding:8px 10px;
  border-radius:12px;
  background:rgba(15,23,42,.08);
  color:#0f172a;
}
