/* =====================================================
   GENERAL APPLICATION STYLES — PSLanding Design System
   ===================================================== */

/* DESIGN TOKENS */
:root {
  --ink-975: #050705;
  --ink-950: #080c0b;
  --ink-900: #0c120e;
  --ink-800: #141e18;
  --frost-50:  #ecfff4;
  --frost-100: #d0fce3;
  --frost-200: #a0f0c4;
  --frost-300: #6de6a0;
  --frost-400: #3dcc80;
  --mist-200: #d0d8d4;
  --mist-300: #a8b5ae;
  --mist-400: #7f8f86;
  --gold: #f9c846;
  --glass-bg: rgba(255,255,255,.045);
  --glass-border: rgba(130,230,170,.14);
  --glass-blur: blur(18px) saturate(1.5);
  --btn-primary-bg: rgba(61,204,128,.14);
  --btn-primary-border: rgba(130,230,170,.32);
  --btn-secondary-bg: rgba(255,255,255,.06);
  --btn-secondary-border: rgba(255,255,255,.1);
  --shadow-glow: 0 0 32px rgba(61,204,128,.22);
  --shadow-panel: 0 18px 60px rgba(0,0,0,.55);
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-2xl: 24px;
}

/* FONT DEFINITIONS */
.ps-font-light    { font-family: "Figtree", sans-serif; font-weight: 300; }
.ps-font-regular  { font-family: "Figtree", sans-serif; font-weight: 400; }
.ps-font-medium   { font-family: "Figtree", sans-serif; font-weight: 500; }
.ps-font-semibold { font-family: "Figtree", sans-serif; font-weight: 600; }
.ps-font-bold     { font-family: "Figtree", sans-serif; font-weight: 700; }

/* BASE STYLES */
body {
  font-family: "Figtree", sans-serif;
  background-color: var(--ink-950) !important;
  color: var(--mist-200);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden !important;
}

/* GLOBAL TRANSITIONS */
a, button, .btn, .platform-btn, .mode-btn, .nav-link,
#sidebar ul li > a, .credits-info, .dt-button, .pagination li a {
  transition: background .15s, transform .1s, color .15s,
              border-color .15s, box-shadow .15s;
}

/* NAVBAR STYLES */
.navbar {
  font-family: "Figtree", sans-serif !important;
}

.nav-link {
  color: var(--frost-400) !important;
  text-shadow: 1px 1px 1px rgb(0 0 0 / 70%) !important;
  font-family: "Figtree", sans-serif !important;
}

.nav-link:hover {
  text-decoration: underline;
}

/* JUMBOTRON STYLES */
.jumbotron {
  background: var(--glass-bg);
  color: var(--mist-200);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-panel);
}

/* CARD STYLES */
.card-body {
  background: var(--glass-bg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-panel);
}

/* SEARCH BAR STYLES */
.search-bar {
  background: var(--glass-bg);
  color: var(--mist-200);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  width: 450px;
  margin-bottom: 24px;
  margin-top: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  transition: border-color .15s, box-shadow .15s;
  font-family: "Figtree", sans-serif;
  font-size: 15px;
}

.search-bar::placeholder {
  color: var(--mist-400);
}

.search-bar:hover {
  border-color: rgba(130,230,170,.28);
}

.search-bar:focus {
  outline: none;
  border-color: var(--frost-400);
  box-shadow: var(--shadow-glow);
}

.exact-search {
  margin-bottom: 0;
}

.search-button {
  margin-top: 20px !important;
}

/* SELECT2 STYLES */
.select2-container--default .select2-selection--single {
  border: 0 !important;
  box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.5) !important;
}

/* MAIN SEARCH BUTTON STYLES */
.cssbuttons-io-button {
  background: var(--btn-primary-bg);
  color: var(--frost-50);
  font-family: inherit;
  padding: 0.35em;
  padding-left: 1.2em;
  font-size: 17px;
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: 1px solid var(--btn-primary-border);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  overflow: hidden;
  position: relative;
  height: 2.8em;
  padding-right: 3.3em;
  cursor: pointer;
  margin: 0 auto;
  box-shadow: var(--shadow-glow);
  transition: background .15s, transform .1s, box-shadow .15s;
}

.cssbuttons-io-button .icon {
  background: white;
  margin-left: 1em;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.2em;
  width: 2.2em;
  border-radius: 0.7em;
  right: 0.3em;
  transition: all 0.3s;
}

.cssbuttons-io-button:hover .icon {
  width: calc(100% - 0.6em);
}

.cssbuttons-io-button .icon svg {
  transition: transform 0.3s;
  color: var(--frost-400);
}

.cssbuttons-io-button:hover .icon svg {
  transform: translateX(0.1em);
}

.cssbuttons-io-button:active .icon {
  transform: scale(0.95);
}

/* CLEAR BUTTON STYLES */
#clear {
  width: 200px;
  overflow: hidden;
  border: none;
  color: #ee4b2b;
  background: none;
  position: relative;
  padding-bottom: 2em;
  cursor: pointer;
}

#clear > div,
#clear > svg {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
}

#clear:before {
  content: "";
  position: absolute;
  height: 2px;
  bottom: 0;
  left: 0;
  width: 100%;
  transform: scaleX(0);
  transform-origin: bottom right;
  background: currentColor;
  transition: transform 0.25s ease-out;
}

#clear:hover:before {
  transform: scaleX(1);
  transform-origin: bottom left;
}

#clear .clone > *,
#clear .text > * {
  opacity: 1;
  font-size: 1.3rem;
  transition: 0.2s;
  margin-left: 4px;
}

#clear .clone > * {
  transform: translateY(60px);
}

#clear:hover .clone > * {
  opacity: 1;
  transform: translateY(0px);
  transition: all 0.2s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
}

#clear:hover .text > * {
  opacity: 1;
  transform: translateY(-60px);
  transition: all 0.2s cubic-bezier(0.215, 0.61, 0.355, 1) 0s;
}

#clear:hover .clone > :nth-child(1) {
  transition-delay: 0.15s;
}

#clear:hover .clone > :nth-child(2) {
  transition-delay: 0.2s;
}

#clear:hover .clone > :nth-child(3) {
  transition-delay: 0.25s;
}

#clear:hover .clone > :nth-child(4) {
  transition-delay: 0.3s;
}

#clear svg {
  width: 20px;
  right: 0;
  top: 50%;
  transform: translateY(-50%) rotate(-50deg);
  transition: 0.2s ease-out;
}

#clear:hover svg {
  transform: translateY(-50%) rotate(-90deg);
}

.organic-search {
  color: #ffffff;
}

.organic-search:hover {
  color: #ffffff;
}

/* TABLE STYLES */
thead {
  background-color: var(--ink-800);
  color: var(--mist-200);
  border-radius: 20px;
}

tbody {
  color: var(--mist-200);
}

#playlists_table_info {
  color: var(--mist-300);
}

#playlists_table_filter label {
  color: var(--mist-300);
}

/* FOOTER STYLES */
#footer {
  padding: 0 3%;
  height: 450px;
}

.checkk {
  margin-top: 20px;
}

/* GENERAL RESPONSIVE IMPROVEMENTS */
@media only screen and (max-width: 768px) {
    .search-bar {
        width: 100% !important;
        max-width: 300px;
        margin: 10px auto;
    }
    
    .search-bar:hover {
        width: 100% !important;
        max-width: 300px;
    }
    
    .jumbotron {
        padding: 15px;
        margin: 10px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    /* Make icon selector responsive */
    .icon-selector {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        margin: 10px 0;
    }
    
    .icon-selector .icon {
        width: 60px !important;
        height: 60px !important;
    }
    
    .icon-container {
        margin: 5px;
    }
    
    /* Responsive button */
    .cssbuttons-io-button {
        font-size: 14px;
        padding: 0.3em;
        padding-left: 1em;
        padding-right: 2.8em;
        height: 2.5em;
    }
    
    /* Credits display */
    .credits-container {
        font-size: 14px;
    }
    
    /* Table responsive */
    .card-body {
        padding: 0.5rem;
        overflow-x: auto;
    }
    
    /* Hide certain table columns on mobile */
    table.dataTable.responsive.collapsed > tbody > tr > td:nth-child(n+6),
    table.dataTable.responsive.collapsed > thead > tr > th:nth-child(n+6) {
        display: none;
    }
}

/* Even smaller screens */
@media only screen and (max-width: 480px) {
    .search-bar {
        max-width: 250px;
        font-size: 14px;
    }
    
    .icon-selector .icon {
        width: 50px !important;
        height: 50px !important;
    }
    
    .jumbotron {
        padding: 10px;
        margin: 5px;
    }
    
    .cssbuttons-io-button {
        font-size: 12px;
        padding: 0.25em;
        padding-left: 0.8em;
        padding-right: 2.5em;
        height: 2.2em;
    }
}

/* Ensure proper spacing on larger tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 100% !important;
        padding: 0 15px;
    }
    
    .jumbotron {
        margin: 15px 0;
        padding: 20px;
    }
    
    .search-bar {
        width: 100% !important;
        max-width: 400px;
    }
    
    .icon-selector {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .icon-selector .icon {
        width: 70px !important;
        height: 70px !important;
        margin: 5px;
    }
}

/* Fix table responsiveness */
@media (max-width: 1024px) {
    #table_area {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table.dataTable {
        width: 100% !important;
        margin: 0 !important;
    }
}
/* CREDITS ALIGNMENT FIX - Add this to your styles.css */

/* Container for search area to control alignment */
.search-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Credits link positioning - aligned with search bar */
.credits-link {
    position: absolute !important;
    top: -10px !important; /* Position above the search bar */
    right: 0 !important; /* Align to the right edge of search bar */
    color: var(--frost-400) !important;
    font-weight: 600 !important;
    text-shadow: 1px 1px 1px rgb(0 0 0 / 70%) !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    z-index: 100 !important;
    transition: right 0.3s ease !important; /* Smooth transition when search bar expands */
}

/* Adjust credits position when search bar is hovered/expanded */
.search-container:hover .credits-link {
    right: -27px !important; /* Accommodate the extra 55px width on hover */
}

/* Alternative approach - position relative to search bar center */
.credits-link-centered {
    position: absolute !important;
    top: -10px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    color: var(--frost-400) !important;
    font-weight: 600 !important;
    text-shadow: 1px 1px 1px rgb(0 0 0 / 70%) !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    z-index: 100 !important;
}

/* Mobile responsiveness for credits */
@media only screen and (max-width: 768px) {
    .credits-link,
    .credits-link-centered {
        position: static !important;
        margin-bottom: 10px !important;
        text-align: center !important;
        transform: none !important;
        right: auto !important;
        left: auto !important;
        top: auto !important;
    }
    
    .search-container {
        gap: 10px;
    }
}

/* Ensure help icon doesn't interfere with alignment */
.help-icon.credits-help {
    position: relative !important;
    display: inline-block !important;
    margin-left: 5px !important;
    width: 18px !important;
    height: 18px !important;
    background-color: var(--frost-400) !important;
    color: #000 !important;
    border-radius: 50% !important;
    font-size: 12px !important;
    font-weight: normal !important;
    text-align: center !important;
    line-height: 18px !important;
    cursor: help !important;
    vertical-align: middle !important;
}

/* Tooltip positioning for help icon */
.help-icon.credits-help .tooltip-text {
    visibility: hidden !important;
    width: 280px !important;
    background-color: #000 !important;
    color: #fff !important;
    text-align: left !important;
    border-radius: 8px !important;
    padding: 12px !important;
    position: absolute !important;
    z-index: 999999 !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    box-shadow: 0 8px 16px #000 !important;
    top: 50% !important;
    left: 125% !important;
    transform: translateY(-50%) !important;
    opacity: 1 !important;
}

.help-icon.credits-help:hover .tooltip-text {
    visibility: visible !important;
    opacity: 1 !important;
}

.help-icon.credits-help .tooltip-text::before {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: -6px !important;
    transform: translateY(-50%) !important;
    border-top: 6px solid transparent !important;
    border-bottom: 6px solid transparent !important;
    border-right: 6px solid #000 !important;
}

/* =====================================================
   PLATFORM & MODE TOGGLE STYLES
   ===================================================== */

/* Platform Toggle */
.platform-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.platform-btn {
    padding: 10px 24px;
    border: 1px solid var(--btn-secondary-border);
    border-radius: var(--radius-lg);
    background: var(--btn-secondary-bg);
    color: var(--mist-400);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
    display: flex;
    align-items: center;
}

.platform-btn.active {
    border-color: var(--btn-primary-border);
    color: var(--frost-400);
    background: var(--btn-primary-bg);
    box-shadow: var(--shadow-glow);
}

.platform-btn:hover:not(.active) {
    border-color: rgba(255,255,255,.18);
    color: var(--mist-200);
    background: rgba(255,255,255,.08);
}

.platform-btn:focus {
    outline: none;
}

.platform-btn svg {
    fill: currentColor;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.mode-btn {
    padding: 15px 30px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    background: var(--glass-bg);
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
    text-align: center;
    min-width: 200px;
    backdrop-filter: var(--glass-blur);
}

.mode-btn.active {
    border-color: var(--btn-primary-border);
    background: var(--btn-primary-bg);
    box-shadow: var(--shadow-glow);
}

.mode-btn:hover:not(.active) {
    border-color: rgba(130,230,170,.28);
    transform: translateY(-2px);
}

.mode-title {
    color: var(--mist-200);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    letter-spacing: -.02em;
}

.mode-subtitle {
    color: var(--mist-400);
    font-size: 12px;
}

.premium-badge {
    background: var(--gold);
    color: #000;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 8px;
    font-family: "Figtree", sans-serif;
}

/* Disabled state during search */
.platform-toggle.disabled .platform-btn,
.mode-toggle.disabled .mode-btn {
    pointer-events: none;
    opacity: 0.5;
}

/* Responsive styles for toggles */
@media only screen and (max-width: 768px) {
    .platform-toggle {
        flex-wrap: wrap;
        gap: 8px;
    }

    .platform-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .mode-toggle {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .mode-btn {
        min-width: 280px;
        max-width: 100%;
        padding: 12px 20px;
    }

    .mode-title {
        font-size: 14px;
    }

    .mode-subtitle {
        font-size: 11px;
    }

    .premium-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}

@media only screen and (max-width: 480px) {
    .platform-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .platform-btn svg {
        width: 16px;
        height: 16px;
    }

    .mode-btn {
        min-width: 250px;
        padding: 10px 15px;
    }
}

/* =====================================================
   SLIM PROGRESS + PLAYLIST VET UI (Apr 2026)
   Replaces chunky jQuery UI "black-tie" progressbar and
   the SVG-glow .btn-101 health-check button with a
   unified slim design aligned to the PSLanding tokens.
   ===================================================== */

/* ---------- Search progress bar (overrides jQuery UI) ---------- */
#progressbar,
#progressbar.ui-progressbar {
    position: relative;
    display: block;
    width: 100% !important;
    max-width: 480px;
    height: 3px !important;
    margin: 16px auto 8px;
    background: rgba(255,255,255,.055) !important;
    border: none !important;
    border-radius: 999px !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
    overflow: hidden;
}

#progressbar .ui-progressbar-value {
    height: 100% !important;
    margin: 0 !important;
    background: linear-gradient(90deg, var(--frost-300), var(--frost-400)) !important;
    border: none !important;
    border-radius: 999px !important;
    box-shadow: 0 0 12px rgba(61,204,128,.55);
    transition: width .35s ease;
}

/* Subtle shimmer while the bar is visible, independent of fill width. */
@keyframes ps-progress-shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
#progressbar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,.09) 50%,
        transparent 100%);
    animation: ps-progress-shimmer 1.9s linear infinite;
    pointer-events: none;
}

#statusMessage {
    display: inline-block;
    font-family: "Figtree", sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--mist-300);
    margin-top: 2px;
}

/* ---------- Playlist Vet: slim pill button ---------- */
.ps-vet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 96px;
    height: 30px;
    padding: 0 14px;
    font-family: "Figtree", sans-serif;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--frost-300);
    background: var(--btn-primary-bg);
    border: 1px solid var(--btn-primary-border);
    border-radius: 999px;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
}

.ps-vet-btn:hover {
    background: rgba(61,204,128,.22);
    border-color: rgba(130,230,170,.5);
    color: var(--frost-200);
    box-shadow: 0 0 0 3px rgba(61,204,128,.08);
}

.ps-vet-btn:active {
    transform: scale(.97);
}

.ps-vet-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.ps-vet-icon {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    stroke: currentColor;
    stroke-width: 2;
}

/* ---------- Playlist Vet: in-cell processing state ---------- */
.ps-vet-progress {
    display: block;
    text-align: center;
    min-width: 96px;
    padding: 4px 2px;
}

.ps-vet-progress__label {
    font-family: "Figtree", sans-serif;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--frost-400);
    margin-bottom: 5px;
}

.ps-vet-progress__track {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,.07);
    border-radius: 999px;
    overflow: hidden;
}

/* Indeterminate shimmer so the cell always feels alive while analyzing,
   even before the first progress update sets a width. Same effect as
   the search progress bar. */
.ps-vet-progress__track::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(130,230,170,.28) 50%,
        transparent 100%);
    animation: ps-progress-shimmer 1.6s linear infinite;
    pointer-events: none;
}

.ps-vet-progress__fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--frost-300), var(--frost-400));
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(61,204,128,.55);
    transition: width .35s ease;
}

.ps-vet-progress__status {
    margin-top: 4px;
    font-family: "Figtree", sans-serif;
    font-size: 9px;
    font-weight: 500;
    color: var(--mist-300);
    letter-spacing: .02em;
    min-height: 11px;
}

/* ---------- Playlist Vet: final result with score bands ---------- */
/* Bands: 0% = Bot Risk (red), 1-9% = Organic (yellow), 10%+ = Powerhouse (green) */
.ps-vet-result {
    display: block;
    text-align: center;
    padding: 6px 2px;
    font-family: "Figtree", sans-serif;
}

.ps-vet-result__score {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: .01em;
}

.ps-vet-result__label {
    display: block;
    margin-top: 3px;
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--mist-400);
}

/* !important needed — DataTables cell color rules (table.dataTable tbody td)
   win on specificity otherwise and the score renders in the default mist
   text color instead of the band color. */
.ps-vet-result--dead .ps-vet-result__score {
    color: #ff5b5b !important;
    text-shadow: 0 0 14px rgba(255,91,91,.45);
}
.ps-vet-result--organic .ps-vet-result__score {
    color: var(--gold) !important;
    text-shadow: 0 0 14px rgba(249,200,70,.45);
}
.ps-vet-result--powerhouse .ps-vet-result__score {
    color: var(--frost-400) !important;
    text-shadow: 0 0 14px rgba(61,204,128,.5);
}