/* ==========================================================================
   Biology theme for the student portal, admin panel and login/register pages.
   Kept subtle: decoration sits behind white cards/tables so they stay readable.
   Artwork: assets/img/bio-sketch-*.svg, bio-sidebar-plants.svg (original drawings).
   ========================================================================== */

/* ─── Pencil-sketch biology drawings behind the page content ────────────── */
#content {
    position: relative;
}
#content::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../img/bio-sketch-green.svg") repeat 0 0 / 520px 520px;
    opacity: 0.16;
    pointer-events: none;
    /* Behind everything inside #content without creating stacking contexts
       (so Bootstrap modals / dropdowns inside pages are unaffected) */
    z-index: -1;
}

/* ─── Sidebar: faint white sketches + plants growing at the bottom ──────── */
#sidebar {
    display: flex;
    flex-direction: column;
    background-color: var(--sidebar-bg);
    background-image: url("../img/bio-sketch-white.svg");
    background-repeat: repeat;
    background-size: 420px 420px;
}
#sidebar::after {
    content: "";
    display: block;
    flex-shrink: 0;
    margin-top: auto;          /* push to the bottom of the sidebar ... */
    position: sticky;
    bottom: 0;                 /* ... and keep it in view while the page scrolls */
    height: 170px;
    background: url("../img/bio-sidebar-plants.svg") no-repeat center bottom / 100% auto;
    pointer-events: none;
}

/* Small leaf marker on the active menu item, sprouting on hover */
#sidebar ul li a {
    position: relative;
}
#sidebar ul li a::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M4 36 C 6 18 18 6 36 4 C 34 22 22 34 4 36 Z' fill='%238cc63f'/%3E%3Cpath d='M4 36 L 26 14' stroke='%23063b00' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
    transform: scale(0) rotate(-45deg);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#sidebar ul li a:hover::after,
#sidebar ul li.active > a::after {
    transform: scale(1) rotate(0deg);
}

/* ─── Login / register pages: sketches over the green gradient ──────────── */
.hero-gradient {
    background-image:
        url("../img/bio-sketch-white.svg"),
        linear-gradient(135deg, var(--primary-darkest) 0%, var(--primary-main) 100%);
    background-repeat: repeat, no-repeat;
    background-size: 520px 520px, cover;
}

/* ─── "Biology fact of the day" card (dashboards) ───────────────────────── */
.bio-fact-card {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 16px;
    color: #fff;
    background:
        url("../img/bio-sketch-white.svg") repeat 0 0 / 360px 360px,
        linear-gradient(120deg, #063b00 0%, #0a5d00 55%, #089000 100%);
    box-shadow: 0 6px 18px rgba(6, 59, 0, 0.18);
}
.bio-fact-card .card-body {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
}
.bio-fact-icon {
    flex-shrink: 0;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    border: 2px solid rgba(184, 242, 124, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}
.bio-fact-icon svg {
    width: 34px;
    height: 34px;
    color: #b8f27c;
    animation: bioFactSpin 8s ease-in-out infinite;
}
@keyframes bioFactSpin {
    0%, 100% { transform: rotate(-8deg); }
    50%      { transform: rotate(8deg); }
}
.bio-fact-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #b8f27c;
    margin-bottom: 2px;
}
.bio-fact-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.45;
    color: #fff;
}
.bio-fact-text strong { color: #e6ffd0; }

@media (max-width: 576px) {
    .bio-fact-card .card-body { padding: 14px 16px; gap: 12px; }
    .bio-fact-icon { width: 46px; height: 46px; }
    .bio-fact-icon svg { width: 26px; height: 26px; }
    .bio-fact-text { font-size: 0.92rem; }
}

@media (prefers-reduced-motion: reduce) {
    .bio-fact-icon svg { animation: none; }
    #sidebar ul li a::after { transition: none; }
}

/* Don't print decorations */
@media print {
    #content::before, #sidebar::after { display: none; }
}

/* ==========================================================================
   Pagination - "cell pills": round buttons, current page is a filled green
   cell with a soft halo. Applies to every .pagination in the portals
   (server pager from renderPagination() and the student exam-marks table).
   ========================================================================== */
.lms-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    padding: 14px 16px;
    border-top: 1px solid #e3f1df;
}
.lms-pager-info {
    color: #557055;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}
.lms-pager-info b { color: #1a2e1a; }
.lms-pager-size {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #557055;
    font-size: 0.9rem;
}
.lms-pager-size label { white-space: nowrap; }
.lms-pager-size .form-select {
    width: auto;
    min-width: 78px;
    border-radius: 999px;
    padding-left: 14px;
    padding-right: 2.1rem;
    border-color: #d6ead3;
}

.pagination {
    gap: 6px;
    flex-wrap: wrap;
}
.pagination .page-link {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px !important;     /* override Bootstrap's joined first/last corners */
    border: 1px solid #d6ead3;
    color: #1a2e1a;
    background: #fff;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.pagination .page-item:not(:first-child) .page-link { margin-left: 0; }
.pagination .page-link:hover {
    border-color: #089000;
    color: #089000;
    background: #fff;
}
.pagination .page-item.active .page-link {
    background: #089000;
    border-color: #089000;
    color: #fff;
    box-shadow: 0 0 0 4px #e8fce8, 0 4px 10px rgba(8, 144, 0, 0.35);
}
.pagination .page-item.disabled .page-link {
    background: transparent;
    border-color: transparent;
    color: #9bb39a;
}
.pagination .lms-pager-edge .page-link { font-size: 1.2rem; line-height: 1; }
.lms-pager-where { display: none; }

/* Phones: collapse the numbers to "‹  Page 3 of 12  ›" with bigger tap targets */
@media (max-width: 576px) {
    .lms-pager { justify-content: center; text-align: center; }
    .lms-pager-info, .lms-pager-size { width: 100%; justify-content: center; }
    .lms-pager-pages .lms-pager-num { display: none; }
    .lms-pager-pages .lms-pager-where { display: list-item; list-style: none; }
    .lms-pager-pages .lms-pager-where .page-link { border-color: transparent; background: transparent; min-width: 0; }
    .lms-pager-pages .lms-pager-edge .page-link { min-width: 46px; height: 46px; }
}

/* ==========================================================================
   Student class cards - "specimen card" (student/my_classes.php)
   Green sketch band with a round class-type icon, price, contents,
   this month's payment status, next Zoom class and actions.
   ========================================================================== */
.spec-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #d6ead3;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(6, 59, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.spec-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 26px rgba(6, 59, 0, 0.14);
}
.spec-band {
    position: relative;
    height: 88px;
    flex-shrink: 0;
    background:
        radial-gradient(circle at 85% 25%, rgba(140, 198, 63, 0.35), transparent 45%),
        url("../img/bio-sketch-white.svg") repeat 0 0 / 300px 300px,
        linear-gradient(120deg, #063b00 0%, #0a5d00 55%, #089000 100%);
}
.spec-available .spec-band {
    background:
        radial-gradient(circle at 85% 25%, rgba(255, 255, 255, 0.25), transparent 45%),
        url("../img/bio-sketch-white.svg") repeat 0 0 / 300px 300px,
        linear-gradient(120deg, #2f7d1e 0%, #5aa52e 60%, #8cc63f 100%);
}
.spec-type {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    padding: 3px 10px;
    border-radius: 999px;
}
.spec-icon {
    position: absolute;
    left: 18px;
    bottom: -26px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #e8fce8;
    color: #089000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 6px 16px rgba(6, 59, 0, 0.18);
    transition: transform 0.35s ease;
}
.spec-icon svg { width: 30px; height: 30px; }
.spec-card:hover .spec-icon { transform: rotate(-10deg) scale(1.06); }

.spec-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 36px 18px 18px;
}
.spec-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}
.spec-title h5 {
    margin: 0;
    font-weight: 700;
    color: var(--primary-darkest, #063b00);
    line-height: 1.3;
}
.spec-price {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 700;
    color: #0a5d00;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.spec-price small { font-family: 'Inter', sans-serif; font-weight: 500; color: #557055; font-size: 0.75rem; }

.spec-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    color: #557055;
    font-size: 0.85rem;
}
.spec-stats i { color: #8cc63f; margin-right: 2px; }
.spec-stats b { color: #1a2e1a; font-variant-numeric: tabular-nums; }
.spec-hall { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.spec-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 10px;
}
.spec-status.spec-ok   { background: #e3f8df; color: #1f6b12; }
.spec-status.spec-due  { background: #fff4d6; color: #8a5a00; }
.spec-status.spec-wait { background: #eef3ff; color: #2c4f9e; }
.spec-status.spec-info { background: #f2f7f1; color: #3f6a3a; }

.spec-zoom { font-size: 0.85rem; color: #557055; }
.spec-zoom i { color: #089000; margin-right: 4px; }
.spec-zoom b { color: #1a2e1a; }
.spec-joined { font-size: 0.78rem; color: #8aa388; }

.spec-actions {
    margin-top: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding-top: 4px;
}
.spec-actions.spec-single { grid-template-columns: 1fr; }
.spec-actions .btn { border-radius: 10px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
    .spec-card, .spec-icon { transition: none; }
}

/* ==========================================================================
   Admin class cards - "class health card" (admin/classes.php, Cards view)
   ========================================================================== */
.ach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
    padding: 18px;
    background: #f7fbf6;
}
.ach-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #fff;
    border: 1px solid #d6ead3;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(6, 59, 0, 0.06);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    min-width: 0;
}
.ach-card:hover { box-shadow: 0 10px 24px rgba(6, 59, 0, 0.12); transform: translateY(-2px); }
.ach-card.ach-inactive { opacity: 0.62; }
.ach-card.ach-inactive:hover { opacity: 0.9; }

.ach-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ach-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ach-ico {
    width: 46px; height: 46px; flex-shrink: 0;
    border-radius: 12px;
    background: #e8fce8;
    color: #089000;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem;
}
.ach-ico svg { width: 26px; height: 26px; }
.ach-title { min-width: 0; }
.ach-title h6 { margin: 0; font-weight: 700; color: #063b00; font-size: 1.02rem; }
.ach-sub { color: #6b8569; font-size: 0.8rem; line-height: 1.35; overflow-wrap: anywhere; }

/* On/off status switch (links to the existing toggle action) */
.ach-switch {
    position: relative;
    flex-shrink: 0;
    width: 46px; height: 26px;
    border-radius: 999px;
    background: #089000;
    transition: background 0.2s;
}
.ach-switch::after {
    content: "";
    position: absolute;
    top: 4px; left: 24px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: left 0.2s;
}
.ach-switch[aria-checked="false"] { background: #c9d6c7; }
.ach-switch[aria-checked="false"]::after { left: 4px; }

.ach-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ach-metric { background: #f2f7f1; border-radius: 10px; padding: 8px 10px; min-width: 0; }
.ach-metric b {
    display: block;
    font-family: 'Poppins', 'Inter', sans-serif;
    font-size: 1.3rem;
    line-height: 1.2;
    color: #1a2e1a;
    font-variant-numeric: tabular-nums;
}
.ach-metric span { font-size: 0.72rem; color: #6b8569; }
.ach-metric.ach-warn { background: #fff4d6; }
.ach-metric.ach-warn b { color: #8a5a00; }

.ach-bar { display: grid; gap: 6px; }
.ach-bar-label { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; color: #6b8569; font-variant-numeric: tabular-nums; }
.ach-bar-track { height: 8px; border-radius: 999px; background: #e8fce8; overflow: hidden; }
.ach-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #8cc63f, #089000); }

.ach-note { font-size: 0.82rem; color: #6b8569; }
.ach-note b { color: #1a2e1a; }

.ach-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.ach-actions .btn {
    border: 1px solid #d6ead3;
    border-radius: 8px;
    color: #1a2e1a;
    background: #fff;
    font-size: 0.8rem;
    padding: 5px 10px;
}
.ach-actions .btn i { color: #089000; margin-right: 3px; }
.ach-actions .btn:hover { border-color: #089000; color: #089000; }
.ach-actions .ach-danger { margin-left: auto; }
.ach-actions .ach-danger i { color: #dc3545; margin: 0; }
.ach-actions .ach-danger:hover { border-color: #dc3545; }

@media (max-width: 576px) {
    .ach-grid { grid-template-columns: 1fr; padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .ach-card, .ach-switch, .ach-switch::after { transition: none; }
}
