/* Card container styles */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: flex-start;
}

/* Base card styles */
.group-card, .subject-card, .topic-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  overflow: hidden;
  /*width: 320px;*/
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}
.group-card:hover, .subject-card:hover, .topic-card:hover {
  box-shadow: 0 4px 16px rgba(99,102,241,0.13);
}

.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.overflow-hidden { overflow: hidden; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.h-40 { height: 10rem; }

.group-image, .subject-image, .topic-image {
  background: linear-gradient(90deg, #6366f1 0%, #a78bfa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-group { background: #6366f1; }
.badge-subject { background: #f59e42; }
.badge-topic { background: #10b981; }
.badge-new { background-color: var(--accent); color: white; }
.badge-popular { background-color: var(--primary); color: white; }
.badge-featured { background-color: var(--secondary); color: white; }

.p-4 { padding: 1rem; }
.font-bold { font-weight: bold; }
.text-lg { font-size: 1.25rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-3 { margin-bottom: 0.75rem; }
.text-gray-600 { color: #4b5563; }
.text-sm { font-size: 0.875rem; }
.btn {
  background: #6366f1;
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}
.btn:hover { background: #4338ca; }

/* Responsive */
@media (max-width: 600px) {
  .group-card, .subject-card, .topic-card {
    width: 100%;
    min-width: 0;
  }
  .card-container {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Icon fallback */
.fas {
  font-family: 'Font Awesome 5 Free', 'FontAwesome', Arial, sans-serif;
  font-weight: 900;
} 

/* --- Additional styles from knavigator.html --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --secondary: #06b6d4;
    --accent: #f97316;
    --success: #22c55e;
    --error: #ef4444;
    --background: #f8fafc;
    --text: #1e293b;
}
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background);
    color: var(--text);
}
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.btn:hover {
    transform: translateY(-3px);
}
.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}
.btn:hover::after {
    transform: translateX(0);
}
.card {
    transition: all 0.3s ease;
    border-radius: 1rem;
    overflow: hidden;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.nav-item {
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}
.nav-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.nav-item .icon {
    transition: all 0.3s ease;
}
.nav-item:hover .icon {
    transform: scale(1.1);
}
.group-card {
    transition: all 0.3s ease;
    border-radius: 1rem;
    overflow: hidden;
}
.group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.group-card .group-image {
    transition: all 0.5s ease;
}
.group-card:hover .group-image {
    transform: scale(1.05);
}
.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-group {
    background-color: var(--primary);
    color: white;
}
.badge-subject {
    background-color: var(--accent);
    color: white;
}
.search-container {
    position: relative;
}
.search-container input {
    padding-left: 40px;
    transition: all 0.3s ease;
}
.search-container input:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}
.sidebar {
    transition: transform 0.3s ease;
}
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 50;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 40;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    .overlay.active {
        opacity: 1;
        visibility: visible;
    }
}
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}
.breadcrumb-item {
    display: flex;
    align-items: center;
}
.breadcrumb-item:not(:first-child)::before {
    content: "/";
    padding: 0 0.5rem;
    color: #94a3b8;
}
.tooltip {
    position: relative;
    display: inline-block;
}
.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}
.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}
.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
@media (max-width: 640px) {
    .group-card {
        margin-bottom: 1rem;
    }
    .topic-item {
        padding: 1rem 0.75rem;
    }
    .topic-item h4 {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    .flex-wrap-mobile {
        flex-wrap: wrap;
    }
    .quiz-modal-content {
        max-height: 70vh;
        overflow-y: auto;
    }
    #quiz-modal .bg-white {
        max-height: 90vh;
        display: flex;
        flex-direction: column;
    }
    #quiz-modal-content {
        overflow-y: auto;
        flex-grow: 1;
    }
}
.group-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.topic-list {
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.topic-list.open {
    max-height: 500px;
}
.topic-item {
    transition: all 0.2s ease;
}
.topic-item:hover {
    background-color: #f1f5f9;
}
.path-line {
    position: absolute;
    left: 24px;
    top: 48px;
    bottom: 0;
    width: 2px;
    background-color: #e2e8f0;
}
.path-dot {
    position: absolute;
    left: 24px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translateX(-5px);
} 

.group-row-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}
/* "New" indicator badge — dedicated class (does NOT use .badge) so it
   can't inherit .badge's top:10px;right:10px, which previously combined
   with this element's own left offset to stretch it into a full-width
   band instead of a small corner pill. */
.new-indicator {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #ec4899;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    z-index: 5;
}

/* (i) button on exam cards. Visually small, but the hit area is ~44px so
   it's tappable on a phone without opening the card underneath. */
.info-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin: -10px -10px -10px -6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
}
.info-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    font: italic 700 12px/1 Georgia, serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}
.info-btn:hover .info-dot, .info-btn:focus-visible .info-dot { opacity: 1; }

/* Bottom sheet opened by the (i) */
.info-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.info-sheet {
    background: #fff;
    color: #1f2937;
    width: 100%;
    max-width: 520px;
    border-radius: 16px 16px 0 0;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: info-sheet-up 0.2s ease-out;
}
@keyframes info-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.info-sheet-title { font-size: 1.1rem; font-weight: 700; }
.info-sheet-sub { font-size: 0.85rem; color: #6b7280; margin-top: -4px; }
.info-sheet-desc { font-size: 0.95rem; line-height: 1.45; margin: 4px 0; }
.info-sheet-meta { font-size: 0.8rem; color: #6b7280; }
.info-sheet-link {
    margin-top: 6px;
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    background: #4f46e5;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}
.info-sheet-close {
    padding: 10px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #374151;
    border: none;
    font-weight: 500;
    cursor: pointer;
}

/* Push the title below the absolutely positioned "New" pill. */
.has-new-badge { padding-top: 2.5rem !important; }
/* Full exam name under the short card title (e.g. NDA -> National Defence Academy Exam). */
.card-full-name { font-size: 0.875rem; opacity: 0.8; margin: 0 0 0.5rem; }

/* Section header inside the .group-items grid - spans the full row. */
.knav-section-title {
    grid-column: 1 / -1;
    font-size: 1.05rem;
    font-weight: 700;
    color: #374151;
    margin: 0.75rem 0 -0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #e5e7eb;
}
.knav-section-title:first-child { margin-top: 0; }

/* "Showing first: India" picker above sectioned pages. */
.knav-country-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #4b5563;
}
.knav-country-row select {
    padding: 6px 10px;
    min-height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    font-size: 0.875rem;
}

/* "Show exams from other countries" - collapsed sections toggle. */
.knav-others-toggle {
    grid-column: 1 / -1;
    margin-top: 0.75rem;
    padding: 12px;
    border-radius: 10px;
    border: 1px dashed #c7d2fe;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

/* "Australia-focused" chip under a country-specific group title */
.knav-country-chip {
    display: inline-block; margin: 0.25rem 0 0.25rem; padding: 0.15rem 0.6rem;
    border-radius: 9999px; font-size: 0.8rem; font-weight: 600;
    background: rgba(13,148,136,0.12); color: #0f766e; border: 1px solid rgba(13,148,136,0.35);
}
