/* ============================
   PsiMosaic — Global Styles
   Tech Noir theme — inspired by nicepage "Already Future Technology"
   ============================ */

:root {
    /* Dark sections */
    --qm-black: #000000;
    --qm-charcoal: #1e1e1e;
    --qm-dark: #111111;
    --qm-dark2: #2a2a2a;
    /* Light sections */
    --qm-white: #ffffff;
    --qm-light: #f7f9f9;
    --qm-mint: #ceecea;
    /* Borders */
    --qm-border-dark: rgba(255, 255, 255, 0.08);
    --qm-border-light: #e0e8e8;
    /* Accents */
    --qm-teal: #4ECDC4;
    --qm-teal-dark: #3ab8af;
    --qm-gold: #C4A862;
    --qm-gold-dark: #a88e4f;
    /* Text */
    --qm-text-dark: #1a1a1a;
    --qm-text-muted: #6b7280;
    --qm-text-light: #e8f0f0;
    --qm-text-faint: rgba(255, 255, 255, 0.55);
    /* Legacy aliases (used by other templates) */
    --quantum-bg: var(--qm-black);
    --quantum-surface: var(--qm-dark);
    --quantum-surface2: var(--qm-dark2);
    --quantum-border: var(--qm-border-dark);
    --quantum-accent: var(--qm-teal);
    --quantum-accent2: var(--qm-gold);
    --quantum-accent3: #9b7de8;
    --quantum-green: #3ddc6c;
    --quantum-text: var(--qm-text-light);
    --quantum-text-muted: rgba(255, 255, 255, 0.45);
    --quantum-glow: rgba(78, 205, 196, 0.10);
    --quantum-glow-gold: rgba(196, 168, 98, 0.14);
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
}


/* ── Base ─────────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--qm-white);
    color: var(--qm-text-dark);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--qm-teal);
    text-decoration: none;
    transition: color .2s;
}

a:hover {
    color: var(--qm-teal-dark);
}

h1,
h2,
h3,
h4,
h5 {
    line-height: 1.2;
}


/* ── Navbar ──────────────────────────────────────── */

.navbar {
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--qm-border-dark);
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-psi {
    color: var(--qm-gold);
}

.brand-mosaic {
    color: var(--qm-teal);
}

.nav-link {
    color: rgba(255, 255, 255, 0.60) !important;
    font-size: .88rem;
    font-weight: 500;
    padding: .45rem .9rem !important;
    border-radius: 4px;
    letter-spacing: .2px;
    transition: color .2s;
}

.nav-link:hover,
.nav-link.active {
    color: #fff !important;
    background: transparent;
}

.navbar-toggler-icon {
    filter: invert(1);
}


/* Dropdown */

.dropdown-menu {
    background: var(--qm-dark);
    border: 1px solid var(--qm-border-dark);
    border-radius: 8px;
}

.dropdown-item {
    color: rgba(255, 255, 255, 0.60);
    font-size: .88rem;
}

.dropdown-item:hover {
    background: rgba(78, 205, 196, 0.08);
    color: var(--qm-teal);
}

.dropdown-divider {
    border-color: var(--qm-border-dark);
}


/* ── Buttons ─────────────────────────────────────── */

.btn-quantum {
    background: var(--qm-teal);
    color: #000;
    font-weight: 700;
    border: 2px solid var(--qm-teal);
    padding: .65rem 1.8rem;
    border-radius: 3px;
    transition: background .2s, color .2s, transform .15s;
    letter-spacing: .5px;
    text-transform: uppercase;
    font-size: .85rem;
}

.btn-quantum:hover {
    background: transparent;
    color: var(--qm-teal);
    transform: translateY(-1px);
}

.btn-outline-quantum {
    color: var(--qm-teal);
    border: 2px solid var(--qm-teal);
    background: transparent;
    padding: .65rem 1.8rem;
    border-radius: 3px;
    font-weight: 700;
    font-size: .85rem;
    letter-spacing: .5px;
    text-transform: uppercase;
    transition: background .2s, color .2s, transform .15s;
}

.btn-outline-quantum:hover {
    background: var(--qm-teal);
    color: #000;
    transform: translateY(-1px);
}


/* Dark bg variant of outline button */

.btn-outline-quantum-dark {
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    padding: .65rem 1.8rem;
    border-radius: 3px;
    font-weight: 700;
    font-size: .85rem;
    letter-spacing: .5px;
    text-transform: uppercase;
    transition: all .2s;
}

.btn-outline-quantum-dark:hover {
    border-color: var(--qm-teal);
    color: var(--qm-teal);
}


/* ── Hero Section ────────────────────────────────── */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    background: #0a0a2e;
}

#particles-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .35;
}

.hero-image-col {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero-image-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    /* Push JPEG near-blacks to true black — eliminates the foggy gray look */
    filter: brightness(0.81) contrast(1.61);
}

.hero-text-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    position: relative;
    z-index: 1;
}


/* Hero inner container */
.hero-inner {
  min-height: 100vh;
  padding-top: 5rem;
  padding-bottom: 5rem;
  position: relative;
  z-index: 1;
}

/* Book cover wrapper — manja korica sa glow efektom */
.hero-book-wrap {
  position: relative;
  display: inline-block;
}

.hero-book-img {
  width: 100%;
  max-width: 350px;
  display: block;
  border-radius: 10px;
  filter: brightness(0.81) contrast(1.61);
  box-shadow:
    -18px 22px 50px rgba(196, 168, 98, 0.40),
     18px -10px 35px rgba(78, 205, 196, 0.25),
     0 0 80px rgba(78, 205, 196, 0.10);
  transition: transform .3s, box-shadow .3s;
}

.hero-book-img:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow:
    -22px 30px 60px rgba(196, 168, 98, 0.50),
     22px -12px 40px rgba(78, 205, 196, 0.35),
     0 0 100px rgba(78, 205, 196, 0.15);
}

/* Vertical teal accent bar — matches nicepage style */

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: transparent;
    color: var(--qm-teal);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: .3rem .9rem;
    border-radius: 2px;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(2.8rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 1.2rem;
    color: #fff;
    letter-spacing: -1px;
}

.hero-title .highlight {
    color: var(--qm-teal);
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--qm-text-faint);
    max-width: 460px;
    margin-bottom: 2rem;
    line-height: 1.7;
}


/* Stats row */

.hero-stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.hero-stat-label {
    font-size: .75rem;
    color: var(--qm-text-faint);
    letter-spacing: .3px;
    margin-top: .2rem;
}


/* ── Accent bar (short teal underline) ───────────── */

.hero-accent-bar {
    width: 48px;
    height: 3px;
    background: var(--qm-teal);
    border-radius: 2px;
    margin-bottom: 1rem;
}

/* ── Section labels & titles ─────────────────────── */

.section-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--qm-gold);
    margin-bottom: .6rem;
}


/* Dark bg variant */

.section-label-dark {
    color: var(--qm-teal);
}

.section-title {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    color: var(--qm-text-dark);
    margin-bottom: .75rem;
    letter-spacing: -0.5px;
}

.section-title-light {
    color: #fff;
}


/* ── Split section layout ────────────────────────── */

.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 480px;
}

.split-dark {
    background: var(--qm-dark);
    padding: 5rem 4rem;
    color: #fff;
}

.split-mint {
    background: var(--qm-mint);
    position: relative;
    overflow: hidden;
}


/* Diagonal dot/line pattern — decorative */

.split-mint::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 30%;
    background-image: repeating-linear-gradient( 45deg, rgba(78, 205, 196, 0.15) 0px, rgba(78, 205, 196, 0.15) 1px, transparent 1px, transparent 14px);
}


/* ── Cards ───────────────────────────────────────── */


/* Dark card (on dark sections) */

.quantum-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--qm-border-dark);
    border-radius: 4px;
    padding: 1.75rem;
    transition: border-color .25s, transform .25s, box-shadow .25s;
    color: #fff;
}

.quantum-card:hover {
    border-color: rgba(78, 205, 196, 0.35);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(78, 205, 196, 0.08);
}

.quantum-card .card-icon {
    width: 52px;
    height: 52px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    color: var(--qm-gold);
}

.quantum-card h3 {
    color: var(--qm-gold);
}

.quantum-card p,
.quantum-card .text-muted-q {
    color: rgba(255, 255, 255, 0.60) !important;
}


/* Light card (on white/light sections) */

.light-card {
    background: var(--qm-white);
    border: 1px solid var(--qm-border-light);
    border-radius: 4px;
    padding: 1.75rem;
    transition: border-color .25s, transform .25s, box-shadow .25s;
    color: var(--qm-text-dark);
}

.light-card:hover {
    border-color: var(--qm-teal);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(78, 205, 196, 0.12);
}

.light-card .card-icon {
    font-size: 1.6rem;
    color: var(--qm-teal);
    margin-bottom: 1rem;
}

.light-card h3 {
    color: var(--qm-text-dark);
    font-size: 1.05rem;
    margin-bottom: .5rem;
}

.light-card p {
    color: var(--qm-text-muted);
    font-size: .9rem;
}


/* ── Teal-bordered image frame ───────────────────── */

.teal-frame {
    border: 3px solid var(--qm-teal);
    border-radius: 4px;
    overflow: hidden;
}


/* ── Feature section (dark charcoal bg) ─────────── */

.features-dark {
    background: var(--qm-charcoal);
    padding: 5rem 0;
}


/* ── Code blocks ─────────────────────────────────── */

pre,
code {
    font-family: var(--font-mono);
}

.code-block {
    background: #04040e;
    border: 1px solid var(--qm-border-dark);
    border-radius: 6px;
    overflow: hidden;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--qm-dark2);
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--qm-border-dark);
}

.code-block-header .lang-badge {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--quantum-green);
    background: rgba(61, 220, 108, 0.08);
    padding: .2rem .6rem;
    border-radius: 4px;
}

.code-block pre {
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    font-size: .85rem;
    line-height: 1.65;
    color: #abb2bf;
    margin: 0;
}

.copy-btn {
    background: none;
    border: 1px solid var(--qm-border-dark);
    color: rgba(255, 255, 255, 0.40);
    font-size: .75rem;
    padding: .2rem .65rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all .2s;
}

.copy-btn:hover {
    border-color: var(--qm-teal);
    color: var(--qm-teal);
}


/* ── Blog / Program list cards ───────────────────── */

.post-card {
    background: var(--qm-white);
    border: 1px solid var(--qm-border-light);
    border-radius: 4px;
    overflow: hidden;
    transition: transform .25s, border-color .25s, box-shadow .25s;
    height: 100%;
}

.post-card:hover {
    transform: translateY(-4px);
    border-color: var(--qm-teal);
    box-shadow: 0 10px 35px rgba(78, 205, 196, 0.10);
}

.post-card .post-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-card .post-cover-placeholder {
    width: 100%;
    height: 200px;
    background: var(--qm-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--qm-teal);
}

.post-card .card-body {
    padding: 1.25rem;
}

.post-card .category-tag {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--qm-gold);
    margin-bottom: .5rem;
    display: block;
}

.post-card h3 {
    font-size: 1rem;
    margin-bottom: .4rem;
    color: var(--qm-text-dark);
}

.post-card p {
    color: var(--qm-text-muted);
}


/* ── Errata table ────────────────────────────────── */

.errata-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.errata-table th {
    background: var(--qm-light);
    color: var(--qm-text-muted);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    padding: .75rem 1rem;
    border-bottom: 2px solid var(--qm-border-light);
}

.errata-table td {
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--qm-border-light);
    font-size: .9rem;
    vertical-align: top;
    color: var(--qm-text-dark);
}

.errata-table tr:last-child td {
    border-bottom: none;
}

.severity-badge {
    font-size: .7rem;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.severity-critical {
    background: rgba(244, 67, 54, .12);
    color: #c0392b;
}

.severity-major {
    background: rgba(255, 152, 0, .12);
    color: #e67e22;
}

.severity-minor {
    background: rgba(78, 205, 196, .12);
    color: #27ae60;
}

.severity-typo {
    background: rgba(107, 114, 128, .12);
    color: #6b7280;
}


/* ── Bloch sphere form ───────────────────────────── */

.quantum-form label {
    color: var(--qm-text-muted);
    font-size: .85rem;
    margin-bottom: .3rem;
}

.quantum-form .form-control {
    background: var(--qm-light) !important;
    border: 1px solid var(--qm-border-light) !important;
    color: var(--qm-text-dark) !important;
    border-radius: 4px;
}

.quantum-form .form-control:focus {
    border-color: var(--qm-teal) !important;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, .12) !important;
}

.bloch-image-container {
    background: var(--qm-light);
    border: 1px solid var(--qm-border-light);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.bloch-image-container img {
    max-width: 100%;
    border-radius: 6px;
}


/* ── Shop ────────────────────────────────────────── */

.book-detail-cover {
    border-radius: 8px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.20), 0 0 40px rgba(78, 205, 196, 0.10);
    max-width: 280px;
}

.price-display {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--qm-text-dark);
    line-height: 1;
}

.price-note {
    font-size: .8rem;
    color: var(--qm-text-muted);
}

.book-features li {
    padding: .4rem 0;
    color: var(--qm-text-muted);
    font-size: .9rem;
}

.book-features li i {
    color: var(--qm-teal);
    margin-right: .5rem;
}


/* ── Footer ──────────────────────────────────────── */

footer {
    background: var(--qm-black);
    border-top: 1px solid var(--qm-border-dark);
    color: rgba(255, 255, 255, 0.50);
    font-size: .85rem;
}

footer a {
    color: rgba(255, 255, 255, 0.50);
}

footer a:hover {
    color: var(--qm-teal);
}

footer .footer-brand {
    font-weight: 700;
    color: #fff;
}

footer h6 {
    color: rgba(255, 255, 255, 0.70) !important;
}


/* ── Utilities ───────────────────────────────────── */

.text-accent {
    color: var(--qm-teal) !important;
}

.text-accent2 {
    color: var(--qm-gold) !important;
}

.text-accent3 {
    color: #9b7de8 !important;
}

.text-muted-q {
    color: var(--qm-text-muted) !important;
}

.bg-surface {
    background: var(--qm-light);
}

.bg-surface2 {
    background: var(--qm-charcoal);
}

.border-quantum {
    border-color: var(--qm-border-light) !important;
}

.section-pad {
    padding: 5rem 0;
}

.section-pad-sm {
    padding: 3rem 0;
}


/* ── Mosaic card grid ───────────────────────────── */

.mosaic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.mosaic-cell {
    min-height: 220px;
    overflow: hidden;
    position: relative;
}

.mosaic-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mosaic-cell-text {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mosaic-gold {
    background: var(--qm-gold);
}

.mosaic-mint {
    background: var(--qm-mint);
}

.mosaic-dark {
    background: var(--qm-dark2);
    color: #fff;
}


/* ── Art backgrounds ─────────────────────────────── */

.page-art-header {
    position: relative;
    overflow: hidden;
    min-height: 240px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-repeat: no-repeat;
    padding: 4rem 0 3rem;
}

.page-art-header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
}

.page-art-header>.container {
    position: relative;
    z-index: 1;
}

.art-bg-entangle {
    background-image: url("../images/art_entangle.57c1fb9046cf.jpg");
    background-position: center 10%;
}

.art-bg-entangle::before {
    background: linear-gradient(to bottom, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .55) 55%, rgba(0, 0, 0, .88) 100%);
}

.art-bg-bloch {
    background-image: url("../images/art_quantum.4cf132276adb.jpg");
    background-position: 12% 30%;
}

.art-bg-bloch::before {
    background: linear-gradient(to right, rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .45) 50%, rgba(0, 0, 0, .85) 100%);
}

.art-bg-circuit {
    background-image: url("../images/art_quantum.4cf132276adb.jpg");
    background-position: center 58%;
}

.art-bg-circuit::before {
    background: linear-gradient(to bottom, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .45) 50%, rgba(0, 0, 0, .82) 100%);
}

.art-bg-starburst {
    background-image: url("../images/art_entangle.57c1fb9046cf.jpg");
    background-position: center 88%;
}

.art-bg-starburst::before {
    background: linear-gradient(to bottom, rgba(0, 0, 0, .80) 0%, rgba(0, 0, 0, .40) 55%, rgba(0, 0, 0, .80) 100%);
}

.art-strip {
    position: relative;
    overflow: hidden;
    height: 160px;
    border-radius: 4px;
    background-size: cover;
    background-repeat: no-repeat;
}

.art-strip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .45) 50%, rgba(0, 0, 0, .92) 100%);
    z-index: 0;
}

.art-strip>* {
    position: relative;
    z-index: 1;
}


/* ── CTA section ─────────────────────────────────── */

.cta-section {
    background: var(--qm-black);
    padding: 5rem 0;
    text-align: center;
}


/* ── Alert tweaks ────────────────────────────────── */

.alert {
    background: var(--qm-light);
    border: 1px solid var(--qm-border-light);
    color: var(--qm-text-dark);
    border-radius: 4px;
}


/* ── Form controls (auth pages) ──────────────────── */

.form-control,
.form-select {
    background: var(--qm-light) !important;
    border: 1px solid var(--qm-border-light) !important;
    color: var(--qm-text-dark) !important;
    border-radius: 4px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--qm-teal) !important;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, .12) !important;
}

.form-control::placeholder {
    color: var(--qm-text-muted) !important;
}


/* Auth page wrapper — keep dark bg for account pages */

.auth-page-bg {
    background: var(--qm-black);
    min-height: 100vh;
    display: flex;
    align-items: center;
}


/* ── Horizontal image strip ─────────────────────── */

.img-strip {
    display: grid;
    gap: 0;
    overflow: hidden;
}

.img-strip img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: opacity .3s;
}

.img-strip img:hover {
    opacity: .85;
}


/* ── Responsive ──────────────────────────────────── */

@media (max-width: 991px) {
    .hero {
        flex-direction: column;
        min-height: auto;
    }
    .hero-image-col {
        height: 50vw;
        min-height: 300px;
    }
    .hero-text-col {
        padding: 3rem 1.5rem;
    }
    .split-section {
        grid-template-columns: 1fr;
    }
    .split-dark,
    .split-mint {
        padding: 3rem 1.5rem;
    }
    .mosaic-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.4rem;
    }
    .section-pad {
        padding: 3.5rem 0;
    }
}