/**
 * Alvin Kiveu brand theme — matches AK logo
 * Navy (#0a1628) + Royal Blue (#3d4fd8)
 */
:root {
    --ak-navy: #0a1628;
    --ak-navy-soft: #111d33;
    --ak-blue: #3d4fd8;
    --ak-blue-hover: #4f5fe0;
    --ak-blue-light: rgba(61, 79, 216, 0.1);
    --ak-ink: #1a1a2e;
    --ak-muted: #5c5c7a;
    --ak-bg: #f4f6fb;
    --ak-surface: #ffffff;
    --ak-border: rgba(10, 22, 40, 0.08);
    --ak-radius: 14px;
    --ak-shadow: 0 4px 24px rgba(10, 22, 40, 0.07);
    --ak-font: 'DM Sans', system-ui, sans-serif;
    --ak-display: 'Fraunces', Georgia, serif;
}

/* Override legacy primary */
.bg-primary { background-color: var(--ak-navy) !important; }
.btn-primary {
    background: linear-gradient(135deg, var(--ak-navy) 0%, var(--ak-blue) 100%) !important;
    border: none !important;
    color: #fff !important;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--ak-navy-soft) 0%, var(--ak-blue-hover) 100%) !important;
    color: #fff !important;
}
.btn-outline-primary {
    color: var(--ak-blue) !important;
    border-color: var(--ak-blue) !important;
}
.btn-outline-primary:hover {
    background: var(--ak-blue) !important;
    color: #fff !important;
}
.text-primary { color: var(--ak-blue) !important; }

/* ── Navbar ── */
.ak-navbar {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ak-border);
    padding: 0.65rem 0;
    box-shadow: 0 1px 0 rgba(10, 22, 40, 0.04);
}
.ak-navbar .container-fluid {
    max-width: 1320px;
    margin: 0 auto;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}
.ak-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none !important;
    color: var(--ak-navy) !important;
}
.ak-brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 10px;
}
.ak-brand-text {
    font-family: var(--ak-display);
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.ak-brand-text small {
    display: block;
    font-family: var(--ak-font);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ak-blue);
}
.ak-navbar .nav-link {
    color: var(--ak-muted) !important;
    font-weight: 500;
    font-size: 0.925rem;
    padding: 0.5rem 0.85rem !important;
    border-radius: 999px;
    transition: all 0.2s;
}
.ak-navbar .nav-link:hover {
    color: var(--ak-navy) !important;
    background: var(--ak-blue-light);
}
.ak-navbar .nav-link.active,
.ak-navbar .nav-link.ak-active {
    color: #fff !important;
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue));
}
.ak-btn-signin {
    background: transparent !important;
    border: 1px solid var(--ak-border) !important;
    color: var(--ak-navy) !important;
    border-radius: 999px !important;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.4rem 1rem !important;
}
.ak-btn-signin:hover {
    border-color: var(--ak-blue) !important;
    color: var(--ak-blue) !important;
    background: var(--ak-blue-light) !important;
}
.ak-btn-join {
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue)) !important;
    border: none !important;
    color: #fff !important;
    border-radius: 999px !important;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.4rem 1.1rem !important;
}
.ak-btn-join:hover { opacity: 0.92; color: #fff !important; }
.cart-icon-btn.cart-has-items {
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue)) !important;
}
.checkout-btn {
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue)) !important;
}

/* Header actions */
.ak-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.ak-cart-btn {
    width: 40px;
    height: 40px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    border: 1px solid var(--ak-border) !important;
    background: var(--ak-surface) !important;
    color: var(--ak-muted) !important;
    transition: all 0.2s ease;
    position: relative;
}
.ak-cart-btn:hover {
    color: var(--ak-blue) !important;
    border-color: var(--ak-blue) !important;
    background: var(--ak-blue-light) !important;
    transform: translateY(-1px);
}
.ak-cart-btn.cart-has-items {
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue)) !important;
    border-color: transparent !important;
    color: #fff !important;
}
.ak-cart-btn.dropdown-toggle::after,
.ak-avatar-btn.dropdown-toggle::after {
    display: none;
}
.ak-cart-btn .cart-badge {
    font-size: 0.65rem;
    min-width: 17px;
    height: 17px;
    line-height: 17px;
    padding: 0 4px;
}
.ak-avatar-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--ak-border);
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue));
    color: #fff;
    text-decoration: none !important;
    transition: transform 0.2s, box-shadow 0.2s;
}
.ak-avatar-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(61, 79, 216, 0.35);
    color: #fff;
}
.ak-avatar-btn i {
    font-size: 1rem;
}
.ak-user-menu {
    min-width: 260px;
    border: 1px solid var(--ak-border) !important;
    border-radius: 14px !important;
    box-shadow: var(--ak-shadow) !important;
    padding: 0.5rem !important;
    margin-top: 0.65rem !important;
}
.ak-user-menu .dropdown-item {
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font-weight: 500;
    font-size: 0.9rem;
}
.ak-user-menu .dropdown-item:hover {
    background: var(--ak-blue-light);
    color: var(--ak-navy);
}
.ak-user-menu-head {
    padding: 0.65rem 0.75rem 0.5rem;
}
.ak-user-menu-head h6 {
    font-weight: 700;
    color: var(--ak-navy);
    margin-bottom: 0.15rem;
}
.ak-user-menu-head p {
    font-size: 0.8rem;
    color: var(--ak-muted);
    margin: 0;
}
.ak-navbar .navbar-toggler {
    border: 1px solid var(--ak-border);
    border-radius: 10px;
    padding: 0.45rem 0.55rem;
}
.ak-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 3px var(--ak-blue-light);
}
.ak-navbar .navbar-toggler .icon-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--ak-navy);
    border-radius: 2px;
    transition: all 0.2s;
}
.ak-navbar .navbar-toggler .middle-bar {
    margin: 4px 0;
}
.ak-nav-more > .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.ak-nav-more .dropdown-menu {
    border: 1px solid var(--ak-border);
    border-radius: 14px;
    box-shadow: var(--ak-shadow);
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 210px;
}
.ak-nav-more .dropdown-item {
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}
.ak-nav-more .dropdown-item:hover,
.ak-nav-more .dropdown-item:focus {
    background: var(--ak-blue-light);
    color: var(--ak-navy);
}
.ak-nav-more .dropdown-item.ak-active {
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue));
    color: #fff !important;
}
@media (max-width: 991.98px) {
    .ak-navbar .navbar-collapse {
        background: var(--ak-surface);
        border: 1px solid var(--ak-border);
        border-radius: 14px;
        margin: 0.75rem 0 0.5rem;
        padding: 0.75rem;
    }
    .ak-navbar .navbar-nav {
        gap: 0.15rem;
    }
    .ak-nav-more .dropdown-menu {
        border: none;
        box-shadow: none;
        padding: 0 0 0 0.75rem;
        margin: 0;
        position: static !important;
        transform: none !important;
    }
}

/* Cart dropdown */
.cart-dropdown {
    border: 1px solid var(--ak-border) !important;
    border-radius: 14px !important;
    box-shadow: var(--ak-shadow) !important;
    overflow: hidden;
    min-width: min(350px, 90vw) !important;
}
.cart-header,
.cart-footer {
    background: var(--ak-bg) !important;
    border-color: var(--ak-border) !important;
}
.cart-items-container {
    background: var(--ak-surface);
}
.cart-item-card {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--ak-border) !important;
}
.cart-item-card:hover {
    background: var(--ak-blue-light);
}
.cart-item-card:last-child {
    border-bottom: none !important;
}
.cart-view-link {
    color: var(--ak-blue) !important;
    font-size: 0.85rem;
    font-weight: 600;
}
.checkout-btn {
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue)) !important;
    border: none !important;
    font-weight: 600;
}
.checkout-btn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* ── Shared page typography ── */
.ak-page {
    font-family: var(--ak-font);
    background: var(--ak-bg);
}
.ak-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ak-blue);
    margin-bottom: 0.5rem;
}
.ak-heading {
    font-family: var(--ak-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ak-navy);
}
.ak-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.65rem 1.35rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.ak-btn--primary {
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue));
    color: #fff;
}
.ak-btn--primary:hover { opacity: 0.92; color: #fff; transform: translateY(-1px); }
.ak-btn--outline {
    background: #fff;
    color: var(--ak-navy);
    border: 1px solid var(--ak-border);
}
.ak-btn--outline:hover {
    border-color: var(--ak-blue);
    color: var(--ak-blue);
}
.ak-btn--success {
    background: #059669;
    color: #fff;
}
.ak-btn--success:hover { background: #047857; color: #fff; }
.ak-btn--block { width: 100%; }

/* ── Marketplace / courses hero ── */
.ak-scripts-hero,
.ak-courses-hero {
    background: linear-gradient(135deg, var(--ak-navy) 0%, #1a2d5a 45%, var(--ak-blue) 100%);
    color: #fff;
    padding: 3.5rem 0 3rem;
    position: relative;
    overflow: hidden;
}
.ak-scripts-hero::before,
.ak-courses-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.6;
}
.ak-scripts-hero .container,
.ak-courses-hero .container { position: relative; z-index: 1; }
.ak-scripts-hero h1,
.ak-courses-hero h1 {
    font-family: var(--ak-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #fff;
}
.ak-scripts-hero p,
.ak-courses-hero p {
    color: rgba(255,255,255,0.78);
    font-size: 1.1rem;
    max-width: 32rem;
    margin-bottom: 0;
}
.ak-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.15);
}
.ak-hero-stat strong {
    display: block;
    font-family: var(--ak-display);
    font-size: 1.75rem;
    color: #fff;
}
.ak-hero-stat span {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
}

/* ── Filter bar ── */
.ak-filter-bar {
    background: var(--ak-surface);
    border-radius: var(--ak-radius);
    border: 1px solid var(--ak-border);
    box-shadow: var(--ak-shadow);
    padding: 1.25rem 1.5rem;
    margin-top: -2rem;
    position: relative;
    z-index: 2;
    margin-bottom: 2rem;
}
.ak-filter-bar h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ak-navy);
    margin: 0;
}
.ak-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--ak-border);
    color: var(--ak-muted);
    background: #fff;
    transition: all 0.2s;
}
.ak-pill:hover {
    border-color: var(--ak-blue);
    color: var(--ak-blue);
}
.ak-pill.is-active {
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue));
    border-color: transparent;
    color: #fff;
}
.ak-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.ak-toolbar select {
    border-radius: 999px;
    border: 1px solid var(--ak-border);
    font-size: 0.875rem;
    padding: 0.4rem 1rem;
    max-width: 220px;
}

/* ── Script card ── */
.ak-script-card {
    background: var(--ak-surface);
    border-radius: var(--ak-radius);
    border: 1px solid var(--ak-border);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s;
}
.ak-script-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(10, 22, 40, 0.12);
}
.ak-script-card__thumb {
    display: block;
    height: 190px;
    overflow: hidden;
    background: #e8ecf4;
    position: relative;
}
.ak-script-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.ak-script-card:hover .ak-script-card__thumb img { transform: scale(1.05); }
.ak-script-card__body {
    padding: 1.15rem 1.25rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.ak-script-card__type {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ak-blue);
}
.ak-script-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0.35rem 0 0.75rem;
}
.ak-script-card__title a {
    color: var(--ak-navy) !important;
    text-decoration: none;
}
.ak-script-card__title a:hover { color: var(--ak-blue) !important; }
.ak-script-card__meta {
    font-size: 0.78rem;
    color: var(--ak-muted);
    margin-bottom: 1rem;
}
.ak-script-card__foot { margin-top: auto; }

/* ── Course card ── */
.ak-course-card {
    background: var(--ak-surface);
    border-radius: var(--ak-radius);
    border: 1px solid var(--ak-border);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s;
}
.ak-course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(10, 22, 40, 0.12);
}
.ak-course-card__thumb {
    display: block;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #e8ecf4, #d4daf0);
    position: relative;
}
.ak-course-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}
.ak-course-card:hover .ak-course-card__thumb img { transform: scale(1.05); }
.ak-course-card__placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ak-blue);
    font-size: 2.5rem;
    opacity: 0.5;
}
.ak-course-card__level {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ak-navy);
    backdrop-filter: blur(4px);
}
.ak-course-card__level--beginner { color: #059669; }
.ak-course-card__level--intermediate { color: #4f46e5; }
.ak-course-card__level--advanced { color: #dc2626; }
.ak-course-card__body {
    padding: 1.15rem 1.25rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.ak-course-card__type {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ak-blue);
    margin-bottom: 0.35rem;
}
.ak-course-card__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.65rem;
}
.ak-course-card__title a {
    color: var(--ak-navy) !important;
    text-decoration: none;
}
.ak-course-card__title a:hover { color: var(--ak-blue) !important; }
.ak-course-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    font-size: 0.78rem;
    color: var(--ak-muted);
    margin-bottom: 0.85rem;
}
.ak-course-card__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.ak-course-card__rating {
    color: #d97706;
}
.ak-course-card__rating small {
    color: var(--ak-muted);
}
.ak-course-card__instructor {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ak-muted);
    margin-bottom: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ak-border);
}
.ak-course-card__avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--ak-border);
}
.ak-course-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ak-course-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
}
.ak-course-card__price {
    font-family: var(--ak-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ak-navy);
}
.ak-course-card__price--free {
    color: #059669;
}
.ak-course-card__foot .ak-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ── Script detail page ── */
.ak-detail-hero {
    background: linear-gradient(135deg, var(--ak-navy) 0%, var(--ak-blue) 100%);
    color: #fff;
    padding: 2rem 0 2.5rem;
}
.ak-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    font-size: 0.85rem;
}
.ak-breadcrumb a {
    color: rgba(255,255,255,0.65) !important;
    text-decoration: none;
}
.ak-breadcrumb a:hover { color: #fff !important; }
.ak-breadcrumb li + li::before {
    content: '›';
    margin-right: 0.35rem;
    color: rgba(255,255,255,0.4);
}
.ak-breadcrumb li:last-child { color: #fff; }
.ak-detail-hero h1 {
    font-family: var(--ak-display);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}
.ak-detail-layout {
    padding: 2.5rem 0 4rem;
}
.ak-detail-image {
    border-radius: var(--ak-radius);
    overflow: hidden;
    border: 1px solid var(--ak-border);
    box-shadow: var(--ak-shadow);
    position: relative;
    background: #e8ecf4;
}
.ak-detail-image img {
    width: 100%;
    display: block;
}
.ak-detail-badges {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.ak-badge {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ak-navy);
}
.ak-detail-panel {
    background: var(--ak-surface);
    border-radius: var(--ak-radius);
    border: 1px solid var(--ak-border);
    box-shadow: var(--ak-shadow);
    padding: 1.75rem;
}
.ak-price-box {
    background: linear-gradient(135deg, var(--ak-blue-light), rgba(10, 22, 40, 0.04));
    border: 1px solid var(--ak-border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.ak-price-box.is-free {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.2);
}
.ak-price-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ak-muted);
}
.ak-price-amount {
    font-family: var(--ak-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ak-navy);
}
.ak-price-box.is-free .ak-price-amount { color: #059669; }
.ak-feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin: 1.25rem 0;
}
.ak-feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: var(--ak-bg);
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--ak-navy);
}
.ak-feature-item i { color: var(--ak-blue); }
.ak-desc-panel {
    background: var(--ak-surface);
    border-radius: var(--ak-radius);
    border: 1px solid var(--ak-border);
    padding: 1.75rem;
    margin-top: 2rem;
}
.ak-desc-panel h2 {
    font-family: var(--ak-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ak-navy);
    margin-bottom: 1rem;
}

/* ── Pagination ── */
.ak-pagination {
    background: var(--ak-surface);
    border-radius: var(--ak-radius);
    border: 1px solid var(--ak-border);
    padding: 1.25rem 1.5rem;
    margin-top: 2.5rem;
}

/* ── Footer ── */
.footer {
    background: var(--ak-navy) !important;
    color: rgba(255,255,255,0.7);
    border-top: none !important;
}
.footer .nav-link {
    color: rgba(255,255,255,0.65) !important;
}
.footer .nav-link:hover { color: #fff !important; }
.footer span { color: rgba(255,255,255,0.7); }

@media (max-width: 991.98px) {
    .ak-brand-text { display: none; }
    .ak-filter-bar { margin-top: -1rem; }
}
@media (max-width: 575.98px) {
    .ak-hero-stats { gap: 1.25rem; }
    .ak-feature-grid { grid-template-columns: 1fr; }
}

/* ── Student dashboard area ── */
.student-area {
    --sd-primary: var(--ak-navy);
    --sd-blue: var(--ak-blue);
    --sd-accent: rgba(61, 79, 216, 0.08);
    --sd-border: var(--ak-border);
    --sd-muted: var(--ak-muted);
    --sd-surface: var(--ak-bg);
}
.sd-section {
    padding: 2rem 0 3rem;
    background: var(--sd-surface);
    font-family: var(--ak-font);
}
.sd-profile-banner-bg {
    background: linear-gradient(135deg, var(--ak-navy) 0%, #1a2d5a 50%, var(--ak-blue) 100%) !important;
}
.student-area .sd-sidebar .nav-item.active > .nav-link {
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue)) !important;
}
.sd-quick-icon {
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue)) !important;
}
.sd-stat-card::before {
    background: linear-gradient(90deg, var(--ak-navy), var(--ak-blue)) !important;
}
.sd-stat-value { color: var(--ak-navy) !important; }
.sd-tip-card { border-left-color: var(--ak-blue) !important; }
.sd-tip-icon { background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue)) !important; }

/* ── Cart page ── */
.ak-cart-page { padding: 2rem 0 4rem; background: var(--ak-bg); }
.ak-cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
@media (max-width: 991.98px) { .ak-cart-layout { grid-template-columns: 1fr; } }
.ak-cart-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    border-bottom: 1px solid var(--ak-border);
    align-items: center;
}
.ak-cart-item:last-child { border-bottom: none; }
.ak-cart-item img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--ak-border);
}
.ak-cart-item-info { flex: 1; min-width: 0; }
.ak-cart-item-info h5 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ak-navy);
    margin: 0 0 0.25rem;
}
.ak-cart-item-price {
    font-family: var(--ak-display);
    font-weight: 700;
    color: var(--ak-blue);
    white-space: nowrap;
}
.ak-panel {
    background: var(--ak-surface);
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius);
    box-shadow: var(--ak-shadow);
    overflow: hidden;
}
.ak-panel-head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ak-border);
    font-weight: 700;
    color: var(--ak-navy);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ak-panel-head--brand {
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue));
    color: #fff;
    border-bottom: none;
}
.ak-panel-body { padding: 1.25rem; }
.ak-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--ak-muted);
}
.ak-summary-row.total {
    border-top: 1px solid var(--ak-border);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    font-weight: 700;
    color: var(--ak-navy);
    font-size: 1.05rem;
}
.ak-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}
.ak-empty-state i { font-size: 3rem; color: var(--ak-blue); opacity: 0.35; display: block; margin-bottom: 1rem; }

/* ── Contact page ── */
.ak-contact-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}
@media (max-width: 991.98px) { .ak-contact-grid { grid-template-columns: 1fr; } }
.ak-contact-form .form-control,
.ak-contact-form .form-select {
    border-radius: 12px;
    border: 1px solid var(--ak-border);
    padding: 0.65rem 1rem;
}
.ak-contact-form .form-control:focus {
    border-color: var(--ak-blue);
    box-shadow: 0 0 0 3px rgba(61, 79, 216, 0.12);
}
.ak-contact-card {
    background: var(--ak-surface);
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.ak-contact-card h3 {
    font-family: var(--ak-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ak-navy);
    margin-bottom: 1rem;
}
.ak-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--ak-border);
    color: var(--ak-navy) !important;
    text-decoration: none;
    transition: all 0.2s;
}
.ak-social-link:hover {
    background: var(--ak-blue);
    border-color: var(--ak-blue);
    color: #fff !important;
}

/* ── Profile & settings ── */
.ak-profile-hero {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--ak-border);
}
.ak-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    flex-shrink: 0;
}
.ak-field {
    margin-bottom: 1rem;
}
.ak-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ak-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
    display: block;
}
.ak-field .form-control {
    border-radius: 10px;
    border: 1px solid var(--ak-border);
    background: var(--ak-bg);
}
.ak-settings-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--ak-border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}
.ak-settings-link:hover {
    border-color: var(--ak-blue);
    background: var(--ak-blue-light);
    color: inherit;
}
.ak-settings-link i:first-child {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue));
    color: #fff;
    border-radius: 10px;
}

/* ── My scripts table ── */
.ak-table thead th {
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    padding: 0.85rem 1rem;
}
.ak-table tbody td { padding: 1rem; vertical-align: middle; }
.ak-table tbody tr:hover { background: var(--ak-bg); }
.ak-course-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--ak-border);
}
.ak-course-row:last-child { border-bottom: none; }
.ak-course-row img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--ak-border);
}
.ak-course-row-info { flex: 1; min-width: 180px; }
.ak-course-row-info h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ak-navy);
    margin-bottom: 0.25rem;
}

/* ── Portfolio ── */
.ak-portfolio-hero {
    background: linear-gradient(135deg, var(--ak-navy) 0%, #1a2d5a 45%, var(--ak-blue) 100%);
    color: #fff;
    padding: 3.5rem 0;
    position: relative;
    overflow: hidden;
}
.ak-portfolio-hero .container { position: relative; z-index: 1; }
.ak-portfolio-avatar {
    width: 140px;
    height: 140px;
    border-radius: 20px;
    border: 3px solid rgba(255,255,255,0.25);
    object-fit: cover;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.ak-portfolio-hero h1 {
    font-family: var(--ak-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
}
.ak-skill-card {
    background: var(--ak-surface);
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius);
    padding: 1.25rem;
    height: 100%;
    display: flex;
    gap: 1rem;
    transition: transform 0.25s, box-shadow 0.25s;
}
.ak-skill-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ak-shadow);
}
.ak-skill-card-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.ak-project-card {
    background: var(--ak-surface);
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s;
}
.ak-project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(10, 22, 40, 0.12);
}
.ak-project-card__img {
    height: 200px;
    object-fit: cover;
    width: 100%;
    transition: transform 0.4s;
}
.ak-project-card:hover .ak-project-card__img { transform: scale(1.04); }
.ak-project-card__body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.ak-project-cat {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(255,255,255,0.95);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ak-navy);
}
.ak-connect-banner {
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue));
    border-radius: var(--ak-radius);
    padding: 2rem;
    color: #fff;
}

/* ── YouTube tutorials ── */
.ak-yt-hero {
    background: linear-gradient(135deg, var(--ak-navy) 0%, #1a2d5a 40%, #c4302b 100%);
    color: #fff;
    padding: 3.5rem 0 3rem;
}
.ak-yt-hero h1 {
    font-family: var(--ak-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    color: #fff;
}
.ak-yt-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(255,255,255,0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}
.ak-yt-card {
    background: var(--ak-surface);
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s, box-shadow 0.25s;
}
.ak-yt-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(10, 22, 40, 0.12);
}
.ak-yt-card__thumb {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #111;
}
.ak-yt-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.92;
    transition: opacity 0.3s;
}
.ak-yt-card:hover .ak-yt-card__thumb img { opacity: 1; }
.ak-yt-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 22, 40, 0.35);
    opacity: 0;
    transition: opacity 0.25s;
}
.ak-yt-card:hover .ak-yt-play { opacity: 1; }
.ak-yt-play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    border: none;
    color: #c4302b;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.ak-yt-card__body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.ak-yt-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ak-navy);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}
.ak-btn--yt {
    background: #c4302b;
    color: #fff;
}
.ak-btn--yt:hover { background: #a82824; color: #fff; }
.ak-modal-header-brand {
    background: linear-gradient(135deg, var(--ak-navy), var(--ak-blue));
    color: #fff;
    border: none;
}
.ak-video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
}
.ak-video-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* ── Theme toggle ── */
.ak-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--ak-border);
    border-radius: 50%;
    background: transparent;
    color: var(--ak-muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.ak-theme-toggle:hover {
    color: var(--ak-blue);
    border-color: var(--ak-blue);
    background: var(--ak-blue-light);
}
.ak-theme-icon {
    font-size: 1.1rem;
    line-height: 1;
}
[data-bs-theme="light"] .ak-theme-icon--light,
[data-bs-theme="dark"] .ak-theme-icon--dark {
    display: none;
}
[data-bs-theme="light"] .ak-theme-icon--dark,
[data-bs-theme="dark"] .ak-theme-icon--light {
    display: inline;
}

/* ── Dark mode ── */
[data-bs-theme="dark"] {
    --ak-navy: #e8ecf4;
    --ak-navy-soft: #cbd5e1;
    --ak-blue: #6b7cff;
    --ak-blue-hover: #8291ff;
    --ak-blue-light: rgba(107, 124, 255, 0.14);
    --ak-ink: #e8ecf4;
    --ak-muted: #94a3b8;
    --ak-bg: #0a1628;
    --ak-surface: #111d33;
    --ak-border: rgba(255, 255, 255, 0.08);
    --ak-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
}

[data-bs-theme="dark"] body {
    background-color: var(--ak-bg) !important;
    color: var(--ak-ink);
}

[data-bs-theme="dark"] a:not(.btn):not(.dropdown-item):not(.ak-brand):not(.nav-link) {
    color: var(--ak-blue);
}

[data-bs-theme="dark"] .ak-navbar {
    background: rgba(17, 29, 51, 0.92) !important;
    border-bottom-color: var(--ak-border);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .ak-navbar .nav-link.active,
[data-bs-theme="dark"] .ak-navbar .nav-link.ak-active,
[data-bs-theme="dark"] .ak-nav-more .dropdown-item.ak-active {
    background: linear-gradient(135deg, #0a1628, #3d4fd8) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .ak-cart-btn {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-muted) !important;
}

[data-bs-theme="dark"] .cart-header,
[data-bs-theme="dark"] .cart-footer {
    background: var(--ak-bg) !important;
}

[data-bs-theme="dark"] .cart-items-container {
    background: var(--ak-surface);
}

[data-bs-theme="dark"] .ak-navbar .navbar-toggler .icon-bar {
    background: var(--ak-ink);
}

[data-bs-theme="dark"] .ak-user-menu-head h6 {
    color: var(--ak-ink);
}

[data-bs-theme="dark"] .ak-btn-signin {
    border-color: var(--ak-border) !important;
    color: var(--ak-navy) !important;
}

[data-bs-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #0a1628 0%, #3d4fd8 100%) !important;
}

[data-bs-theme="dark"] .ak-scripts-hero,
[data-bs-theme="dark"] .ak-courses-hero,
[data-bs-theme="dark"] .ak-detail-hero,
[data-bs-theme="dark"] .ak-profile-hero,
[data-bs-theme="dark"] .ak-portfolio-hero,
[data-bs-theme="dark"] .ak-yt-hero {
    background: linear-gradient(135deg, #0a1628 0%, #1a2d5a 45%, #3d4fd8 100%);
}

[data-bs-theme="dark"] .ak-btn--outline {
    background: var(--ak-surface);
    color: var(--ak-ink);
    border-color: var(--ak-border);
}

[data-bs-theme="dark"] .ak-btn--outline:hover {
    border-color: var(--ak-blue);
    color: var(--ak-blue);
}

[data-bs-theme="dark"] .ak-card,
[data-bs-theme="dark"] .ak-panel,
[data-bs-theme="dark"] .ak-script-card,
[data-bs-theme="dark"] .ak-course-card,
[data-bs-theme="dark"] .ak-filter-bar,
[data-bs-theme="dark"] .ak-detail-panel,
[data-bs-theme="dark"] .ak-yt-card {
    background: var(--ak-surface);
    border-color: var(--ak-border);
}

[data-bs-theme="dark"] .ak-filter-bar .form-control,
[data-bs-theme="dark"] .ak-filter-bar .form-select {
    background: var(--ak-bg);
    border-color: var(--ak-border);
    color: var(--ak-ink);
}

[data-bs-theme="dark"] .dropdown-menu {
    background: var(--ak-surface);
    border-color: var(--ak-border);
}

[data-bs-theme="dark"] .dropdown-item {
    color: var(--ak-ink);
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background: var(--ak-blue-light);
    color: var(--ak-ink);
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: var(--ak-border);
}

[data-bs-theme="dark"] .text-muted {
    color: var(--ak-muted) !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: var(--ak-surface) !important;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: var(--ak-bg);
    border-color: var(--ak-border);
    color: var(--ak-ink);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: var(--ak-bg);
    color: var(--ak-ink);
}

/* Home page */
[data-bs-theme="dark"] .home-page {
    --home-bg: #0a1628;
    --home-surface: #111d33;
    --home-ink: #e8ecf4;
    --home-muted: #94a3b8;
    --home-accent: #6b7cff;
    --home-accent-dark: #a5b4fc;
    --home-dark: #0a1628;
    --home-border: rgba(255, 255, 255, 0.08);
    --home-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .home-hero {
    background: linear-gradient(180deg, #111d33 0%, var(--home-bg) 100%);
}

[data-bs-theme="dark"] .home-product-card,
[data-bs-theme="dark"] .home-offer-card {
    background: var(--home-surface);
    border-color: var(--home-border);
}

[data-bs-theme="dark"] .home-courses-bg {
    background: var(--home-bg);
}

[data-bs-theme="dark"] .home-skill {
    background: var(--home-surface);
    border-color: var(--home-border);
}

[data-bs-theme="dark"] .btn-home-outline {
    border-color: var(--home-border);
    color: var(--home-ink);
}

[data-bs-theme="dark"] .btn-home-outline:hover {
    border-color: var(--home-accent);
    color: var(--home-accent);
    background: rgba(107, 124, 255, 0.1);
}

[data-bs-theme="dark"] .home-newsletter-form .form-control {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Auth pages */
[data-bs-theme="dark"] .auth-body {
    background: var(--ak-bg);
    color: var(--ak-ink);
}

[data-bs-theme="dark"] .auth-panel {
    background: var(--ak-bg);
}

[data-bs-theme="dark"] .auth-back-home {
    color: var(--ak-muted);
}

[data-bs-theme="dark"] .auth-back-home:hover {
    color: var(--ak-blue);
}

[data-bs-theme="dark"] .auth-card-head h1 {
    color: var(--ak-ink);
}

[data-bs-theme="dark"] .auth-card-head p,
[data-bs-theme="dark"] .auth-form .form-check-label {
    color: var(--ak-muted);
}

[data-bs-theme="dark"] .auth-form .form-label {
    color: var(--ak-ink);
}

[data-bs-theme="dark"] .auth-form .form-control {
    background: var(--ak-surface);
    border-color: var(--ak-border);
    color: var(--ak-ink);
}

[data-bs-theme="dark"] .btn-auth-google {
    background: var(--ak-surface);
    border-color: var(--ak-border);
    color: var(--ak-ink);
}

[data-bs-theme="dark"] .auth-divider {
    color: var(--ak-muted);
}

[data-bs-theme="dark"] .auth-divider::before,
[data-bs-theme="dark"] .auth-divider::after {
    background: var(--ak-border);
}

/* Student dashboard */
[data-bs-theme="dark"] .student-area {
    --sd-primary: #e8ecf4;
    --sd-primary-light: #6b7cff;
    --sd-accent: rgba(107, 124, 255, 0.12);
    --sd-border: rgba(255, 255, 255, 0.08);
    --sd-muted: #94a3b8;
    --sd-surface: #0a1628;
}

[data-bs-theme="dark"] .student-area .sd-sidebar {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
}

[data-bs-theme="dark"] .student-area .sd-sidebar .nav-item .nav-link {
    color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .student-area .sd-sidebar .nav-item.active > .nav-link {
    background: linear-gradient(135deg, #0a1628, #3d4fd8) !important;
    color: #fff !important;
}

[data-bs-theme="dark"] .sd-content-panel {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
}

[data-bs-theme="dark"] .sd-stat-card {
    background: var(--ak-surface);
    border-color: var(--ak-border);
}

[data-bs-theme="dark"] .sd-quick-card {
    background: var(--ak-surface);
    border-color: var(--ak-border);
}

[data-bs-theme="dark"] .sd-tip-card {
    background: var(--ak-surface);
}
