/* =========================================================
   PixelPalace Gradient Theme — COMPLETE UPDATED CSS (REWRITTEN)
   ✅ White background + black text + black borders
   ✅ Adds 3D + animation to .header-title
   (includes sticky header + sticky footer layout)
   IMPORTANT: Wrap your page content in <main class="page">…</main>
   ========================================================= */

/* ===== Theme Vars ===== */
:root {
    /* Keep palette vars (safe to leave) */
    --pp-blue: #8bb0ff;
    --pp-purple: #b48dff;
    --pp-pink: #ff9ad6;
    --pp-orange: #ffb07a;

    /* White / Black theme */
    --bg: #ffffff;

    /* Surfaces */
    --card: #ffffff;
    --card2: #ffffff;

    /* Borders / Text */
    --border: rgba(0, 0, 0, .85);
    --border2: rgba(0, 0, 0, .60);

    --text: #000000;
    --muted: rgba(0, 0, 0, .72);

    /* Shadows */
    --shadow: 0 18px 55px rgba(0, 0, 0, .14);

    /* Z-Index */
    --z-bg: -1;
    --z-base: 1;
    --z-card: 10;
    --z-sticky: 50;
}

/* ===== Base / Sticky Footer Layout ===== */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
    color: var(--text);

    /* ✅ White background (no gradients) */
    background: var(--bg);

    overflow-x: hidden;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Disable shimmer + orbs (from older theme) */
body::before {
    content: "";
    display: none;
}

.bg-orb {
    display: none !important;
}

/* ===== Sticky Header ===== */
header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid rgba(0, 0, 0, .85);
    z-index: 50;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: #000;
    box-shadow: none;
}

h1 {
    font-size: 20px;
    margin: 0;
}

.sub {
    font-size: 12px;
    color: rgba(0, 0, 0, .72);
}

/* ===== Main Layout ===== */
.page {
    flex: 1;
    position: relative;
    z-index: var(--z-base);
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 16px;
    width: 100%;
}

/* ===== Shared Surface ===== */
.card,
.panel,
.mini-card,
.notice {
    background: #ffffff;
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* ===== Cards ===== */
.card {
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    z-index: var(--z-card);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, .95);
    box-shadow: 0 26px 80px rgba(0, 0, 0, .18);
}

.card-head {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, .18);
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.title {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

/* ===== Pills + Buttons ===== */
.pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.pill {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border2);
    background: #ffffff;
    font-size: 12px;
    color: var(--muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border2);
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    font-size: 12px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.btn:hover {
    transform: translateY(-2px);
    background: rgba(0, 0, 0, .04);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .12);
}

.btn:active {
    transform: translateY(0) scale(.98);
}

.btn.secondary {
    background: #ffffff;
    border-color: rgba(0, 0, 0, .90);
}

.btn.ghost {
    background: transparent;
    box-shadow: none;
}

/* ===== Notice ===== */
.notice {
    margin: 12px 16px;
    padding: 10px 12px;
    border-radius: 14px;
    color: var(--muted);
    font-size: 13px;
}

/* ===== Toolbar ===== */
.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, .18);
}

/* Tabs */
.tabs {
    padding: 0 16px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.tab {
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border2);
    background: #ffffff;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.tab:hover {
    transform: translateY(-1px);
    background: rgba(0, 0, 0, .04);
    border-color: rgba(0, 0, 0, .70);
}

.tab.active {
    background: rgba(0, 0, 0, .06);
    border-color: rgba(0, 0, 0, .90);
}

/* Inputs / Selects */
.input,
select {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, .55);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 12px;
    outline: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
    transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}

.input:focus,
select:focus {
    border-color: rgba(0, 0, 0, .90);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .12);
    transform: translateY(-1px);
}

/* Dropdown options */
select option {
    background-color: #ffffff;
    color: #000000;
}

select option:checked {
    background-color: rgba(0, 0, 0, .08);
    color: #000000;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    border: 1px solid var(--border2);
    background: #ffffff;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--muted);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
}

.dot.good {
    background: rgba(34, 197, 94, .95);
}

.dot.warn {
    background: rgba(245, 158, 11, .95);
}

.dot.bad {
    background: rgba(239, 68, 68, .95);
}

/* ===== Table ===== */
.table-wrap {
    padding: 0 16px 16px;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 900px;
}

thead th {
    position: sticky;
    top: 0;
    background: #ffffff;
    text-align: left;
    font-size: 12px;
    color: #000000;
    padding: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, .40);
}

tbody td {
    padding: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, .18);
    font-size: 13px;
}

tbody tr:hover {
    background: rgba(0, 0, 0, .04);
}

/* Links */
a.company-link {
    color: var(--text);
    text-decoration: none;
}

a.company-link:hover {
    text-decoration: underline;
}

/* Pagination / Meta */
.meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
}

.pager {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pager a {
    color: var(--text);
    text-decoration: none;
}

.pager a:hover {
    text-decoration: underline;
}

.pager .disabled {
    opacity: .5;
}

/* ===== Change tracking UI ===== */
.grid3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 0 16px 16px;
}

@media (max-width: 1000px) {
    .grid3 {
        grid-template-columns: 1fr;
    }

    table {
        min-width: 700px;
    }
}

.mini-card {
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    z-index: calc(var(--z-card) + 1);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.mini-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, .95);
    box-shadow: 0 20px 70px rgba(0, 0, 0, .16);
}

/* Disable sheen */
.mini-card::after {
    display: none;
}

/* Mini sections */
.mini-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, .18);
}

.mini-head .label {
    font-weight: 900;
    font-size: 13px;
}

.mini-head .count {
    font-size: 12px;
    color: var(--muted);
}

.mini-body {
    padding: 10px 12px;
    max-height: 380px;
    overflow: auto;
}

.item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, .25);
}

.item:last-child {
    border-bottom: 0;
}

/* ===== Charts canvas surface ===== */
canvas {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, .55);
    border-radius: 14px;
    padding: 10px;
}

/* ===== PixelPalace Hero (optional) ===== */
.pixelpalace-hero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: #ffffff;
    border: 1.5px solid rgba(0, 0, 0, .85);
    box-shadow: var(--shadow);
}

.pixelpalace-hero::before,
.pixelpalace-hero::after {
    display: none;
}

/* ===== Optional: 3D Tilt Effect ===== */
.pp-3d {
    position: relative;
    transform-style: preserve-3d;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    will-change: transform;
}

.pp-3d::before {
    display: none;
}

.pp-3d:hover {
    transform: perspective(900px) rotateX(2deg) rotateY(-2deg) translateY(-2px);
    box-shadow: 0 26px 80px rgba(0, 0, 0, .16);
    border-color: rgba(0, 0, 0, .95);
}

/* ===== Footer ===== */
.site-footer {
    margin-top: 28px;
    padding: 18px 0 22px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, .85);
    color: var(--muted);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.site-footer .footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.site-footer .footer-left {
    font-size: 13px;
    line-height: 1.5;
    opacity: .95;
    max-width: 760px;
}

.site-footer .footer-right {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
    font-size: 13px;
}

.site-footer a,
.site-footer .footer-left a,
.site-footer .footer-right a {
    color: inherit;
    text-decoration: underline;
    opacity: .95;
    white-space: nowrap;
}

.site-footer a:hover {
    opacity: 1;
}

@media (max-width: 720px) {
    .site-footer .footer-inner {
        flex-direction: column;
    }

    .site-footer .footer-right {
        justify-content: flex-start;
        margin-left: 0;
        margin-top: 6px;
    }
}

/* =========================================================
   VISA CALCULATOR PAGE FIXES + MISSING STYLES (REWRITTEN)
   ========================================================= */

/* Make footer stick even though visa.php doesn't use <main class="page"> */
body.page-visa {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
}

body.page-visa>.wrap {
    flex: 1;
    width: 100%;
}

/* ---------- Top nav (Sponsor Licence Tracker / Home) ---------- */
.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin: 8px 0 14px;
    border-radius: 16px;

    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, .85);
    box-shadow: var(--shadow);
}

.topnav .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 13px;
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #000000;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, .08);
}

.topnav .navlinks a {
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, .60);
    background: #ffffff;
}

.topnav .navlinks a:hover {
    background: rgba(0, 0, 0, .04);
}

/* ---------- Headings / subtitle text ---------- */
body.page-visa h1 {
    margin: 0 0 6px;
    font-size: 26px;
    letter-spacing: .2px;
}

.subtitle {
    margin: 10px 0 16px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, .85);
    color: rgba(0, 0, 0, .80);
    box-shadow: var(--shadow);
    line-height: 1.45;
}

/* ---------- Cards in visa.php have <h2> directly inside ---------- */
body.page-visa .card {
    padding: 16px;
    margin: 14px 0;
}

body.page-visa .card>h2 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 950;
    color: var(--text);
}

/* ---------- Two-column section layout ---------- */
.section-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 14px;
}

@media (max-width: 980px) {
    .section-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Panel styling (inside cards) ---------- */
.panel {
    border-radius: 16px;
    padding: 14px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, .55);
    box-shadow: none;
}

.panel-title {
    font-weight: 950;
    margin-bottom: 10px;
    font-size: 13px;
    opacity: .95;
}

.hint {
    font-size: 12px;
    color: rgba(0, 0, 0, .72);
    opacity: .9;
    margin: 6px 0 8px;
}

/* ---------- Form rows ---------- */
.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

@media (max-width: 720px) {
    .row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    font-weight: 850;
    font-size: 12px;
    margin: 10px 0 6px;
}

/* Inputs */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="url"],
textarea,
select {
    width: 100%;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, .55);
    color: var(--text);
    padding: 9px 10px;
    border-radius: 12px;
    font-size: 13px;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(0, 0, 0, .90);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .12);
}

/* ---------- Result widgets ---------- */
.summary-big {
    font-size: 34px;
    font-weight: 1000;
    line-height: 1;
    margin: 4px 0 10px;
}

.status {
    display: inline-block;
    padding: 8px 10px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 12px;
    border: 1px solid rgba(0, 0, 0, .60);
    background: #ffffff;
    margin: 0 0 10px;
}

.status.good {
    background: rgba(34, 197, 94, .10);
    border-color: rgba(34, 197, 94, .55);
}

.status.bad {
    background: rgba(239, 68, 68, .10);
    border-color: rgba(239, 68, 68, .55);
}

/* Key/Value lines in results */
.kv {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, .25);
    font-size: 13px;
}

.kv:last-child {
    border-bottom: 0;
}

/* Lists inside results */
body.page-visa ul {
    margin: 10px 0 0 18px;
    padding: 0;
}

body.page-visa li {
    margin: 6px 0;
    color: rgba(0, 0, 0, .85);
}

/* Trips grid */
.trip-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, .25);
}

.trip-row:last-child {
    border-bottom: 0;
}

@media (max-width: 820px) {
    .trip-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .trip-row .btn {
        justify-content: center;
    }
}

/* Footer note */
.footer-note {
    font-size: 12px;
    color: rgba(0, 0, 0, .80);
    opacity: .9;
}

.footer-note a {
    color: inherit;
}

/* =========================================================
   3D + ANIMATION TITLE PILL (Sponsor License Tracker)
   ========================================================= */
.header-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 24px;
    border-radius: 18px;

    background: #ffffff;
    color: #000000;
    border: 1px solid rgba(0, 0, 0, .85);

    transform-style: preserve-3d;
    box-shadow:
        0 10px 0 rgba(0, 0, 0, .22),
        0 18px 40px rgba(0, 0, 0, .18);

    animation: ppFloat 3.2s ease-in-out infinite;
    will-change: transform;
}

.header-title::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, .95),
            rgba(255, 255, 255, .40) 35%,
            rgba(255, 255, 255, 0) 70%);
    opacity: .9;
    transform: translateZ(10px);
}

.header-title::after {
    content: "";
    position: absolute;
    inset: -30% -40%;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(120deg,
            transparent 40%,
            rgba(255, 255, 255, .65) 50%,
            transparent 60%);
    transform: translateX(-45%) rotate(8deg) translateZ(14px);
    opacity: .55;
    animation: ppShine 2.8s ease-in-out infinite;
}

.header-title:hover {
    transform: perspective(900px) rotateX(7deg) rotateY(-10deg) translateY(-2px);
    box-shadow:
        0 12px 0 rgba(0, 0, 0, .24),
        0 24px 55px rgba(0, 0, 0, .22);
}

@keyframes ppFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

@keyframes ppShine {

    0%,
    100% {
        transform: translateX(-45%) rotate(8deg) translateZ(14px);
        opacity: .35;
    }

    50% {
        transform: translateX(45%) rotate(8deg) translateZ(14px);
        opacity: .70;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}