.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem; /* p-1 */
    border-radius: 9999px; /* rounded-full */
    background-color: #25D366; /* WhatsApp Green */
    color: white;
    transition: transform 0.2s;
}
.whatsapp-btn:hover {
    transform: scale(1.1);
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.outline-clamped {
    max-height: 72px; /* Adjust this value to show about 3 items */
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.student-assign-item {
    transition: background-color 0.2s, border-color 0.2s;
}
.student-assign-item.selected {
    background-color: #eef2ff; /* indigo-50 */
    border-color: #6366f1; /* indigo-500 */
}

.student-assign-item {
    transition: background-color 0.2s, border-color 0.2s;
}

.test-builder-layout {
    display: flex;
    height: 70vh;
    border-top: 1px solid #e5e7eb;
}
.question-nav {
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid #e5e7eb;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
}
.question-nav-list {
    flex-grow: 1;
    overflow-y: auto;
}
.question-nav-item {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    font-weight: 500;
}
.question-nav-item:hover {
    background-color: #f3f4f6;
}
.question-nav-item.active {
    background-color: #eef2ff;
    color: #4338ca;
    font-weight: 600;
}
.question-editor {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fade-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}
.toast {
    animation: fade-in 0.5s ease forwards;
}
.toast.fade-out {
    animation: fade-out 0.5s ease forwards;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}
.info-card {
    background-color: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
}
.info-card .content {
    padding: 1.5rem;
    flex-grow: 1;
}
.info-card .actions {
    padding: 1rem 1.5rem;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    border-bottom-left-radius: 0.75rem;
    border-bottom-right-radius: 0.75rem;
}

.input {
    margin-top: 0.25rem;
    display: block;
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    background-color: #fff;
    border-width: 1px;
    border-color: #d1d5db; /* gray-300 */
    border-radius: 0.375rem; /* rounded-md */
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.input:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: #4f46e5; /* indigo-600 */
    box-shadow: 0 0 0 1px #4f46e5;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.builder-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: center;
    background-color: #f9fafb;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: #2563EB;
    /* blue-600 */
}

input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.low-balance {
    background-color: #FEE2E2 !important;
    /* Tailwind's red-100 */
    color: #991B1B !important;
    /* Tailwind's red-800 */
}

@keyframes breathing-warning {
    0% {
        transform: scale(1);
        box-shadow: 0 0 4px #F87171;
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 0 12px #EF4444;
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 4px #F87171;
    }
}

.breathing-red {
    animation: breathing-warning 2s ease-in-out infinite;
}

.animate-fade-in-up {
    animation: fade-in-up 0.5s ease-out forwards;
    opacity: 0;
}

.dashboard-cards .card {
    opacity: 0;
    /* Initially hidden */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5;
}

.sidebar {
    --tw-bg-opacity: 1;
    background-color: rgb(255 255 255 / var(--tw-bg-opacity));
}

.main-content {
    transition: margin-left 0.3s ease-in-out;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease-in-out;
}

.modal-content {
    transition: transform 0.3s ease-in-out;
}

.certificate-container {
    border: 10px double #4a5568;
    padding: 2.5rem;
    background: white;
    position: relative;
    width: 1056px;
    /* A fixed width for better design control */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    margin: auto;
}

.certificate-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://www.transparenttextures.com/patterns/crissxcross.png');
    opacity: 0.05;
    z-index: 0;
}

.certificate-content {
    position: relative;
    z-index: 1;
}

.auth-tab.active {
    background-color: #EF4444;
    /* red-500 */
    color: white;
}

.auth-tab {
    background-color: #E5E7EB;
    /* gray-200 */
    color: #374151;
    /* gray-700 */
}

.q-palette-btn {
    border: 1px solid #d1d5db;
    background-color: #f9fafb;
    color: #374151;
}

.q-palette-btn.answered {
    background-color: #10B981;
    /* green-500 */
    color: white;
    border-color: #10B981;
}

.q-palette-btn.current {
    background-color: #3B82F6;
    /* blue-500 */
    color: white;
    border-color: #3B82F6;
}

@media print {
    body,
    .modal-backdrop {
        background-color: white !important;
        padding: 0;
        margin: 0;
    }

    body * {
        visibility: hidden;
    }

    .certificate-print-area,
    .certificate-print-area * {
        visibility: visible;
    }

    .certificate-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
    }

    .no-print {
        display: none !important;
    }

    .modal-content {
        max-width: 1100px !important;
        max-height: none !important;
        border: none !important;
        box-shadow: none !important;
    }
}

.notification-item.unread {
    background-color: #f0f5ff; /* A light blue for unread items */
}


/* --- Modal Styles (Same as before) --- */
.modal-overlay {
    position: fixed; z-index: 1000; left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex; align-items: center; justify-content: center;
}
.modal-content {
    background-color: #ffffff; border-radius: 8px;
    width: 90%; max-width: 500px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slide-down 0.3s ease-out;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px; border-bottom: 1px solid #e0e0e0;
}
.modal-close {
    color: #aaa; font-size: 28px; font-weight: bold; cursor: pointer;
}
.modal-close:hover { color: #000; }
.modal-body { padding: 24px; }
@keyframes slide-down {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


/* =============================================
   Action Dropdown Menu (Kebab Menu)
   ============================================= */

/* The parent "div" with class="relative" uses this */
/* This is the container for the hidden dropdown */
.action-dropdown {
  display: none; /* Hidden by default */
  position: absolute;
  right: 0;
  top: 100%; /* Positions it below the button */
  margin-top: 6px;
  background-color: white;
  border: 1px solid #e5e7eb; /* border-gray-200 */
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 10;
  width: 170px;
  overflow: hidden;
}

/* This class is added by JS to show the menu */
.action-dropdown.open {
  display: block;
}

/* These are the buttons inside the dropdown */
.action-dropdown-link {
  display: block;
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  text-align: left;
  background-color: white;
  border: none;
  cursor: pointer;
  line-height: 1.5;
}

.action-dropdown-link:hover {
  background-color: #f3f4f6; /* bg-gray-100 */
}

/* We re-apply the text colors */
.action-dropdown-link.text-green-600 { color: #059669; }
.action-dropdown-link.text-blue-600 { color: #2563eb; }
.action-dropdown-link.text-red-600 { color: #dc2626; }

/* Styles for disabled links in the dropdown */
.action-dropdown-link:disabled {
  color: #9ca3af; /* text-gray-400 */
  cursor: not-allowed;
  background-color: white;
}



/* =============================================
   Student Lesson Drawer Modal
   ============================================= */

.lesson-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 40;
  display: none; /* Hidden by default */
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.lesson-drawer-overlay.open {
  display: block;
  opacity: 1;
}

.lesson-drawer-content {
  position: fixed;
  top: 0;
  right: -100%; /* Start off-screen */
  width: 100%;
  height: 100%;
  background-color: #f3f4f6; /* bg-gray-100 */
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
}

.lesson-drawer-overlay.open .lesson-drawer-content {
  right: 0; /* Slide in */
}

/* Make it full-screen on mobile, but a side-panel on desktop */
@media (min-width: 768px) {
  .lesson-drawer-content {
    width: 90%;
    max-width: 1200px;
  }
}

.lesson-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background-color: white;
  border-bottom: 1px solid #e5e7eb; /* border-gray-200 */
  flex-shrink: 0;
}

.lesson-drawer-body {
  flex-grow: 1;
  display: flex;
  overflow: hidden;
}

/* This is the two-column layout inside the modal */
.lesson-sidebar {
  width: 300px;
  background-color: white;
  border-right: 1px solid #e5e7eb;
  overflow-y: auto;
  flex-shrink: 0;
  padding: 1rem;
}

.lesson-content-area {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
}

.lesson-content-area h1 {
  font-size: 1.875rem; /* text-3xl */
  font-weight: 700;
  margin-bottom: 1rem;
}
.lesson-content-area h2 {
  font-size: 1.5rem; /* text-2xl */
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.25rem;
}
.lesson-content-area p {
  font-size: 1.125rem; /* text-lg */
  line-height: 1.75;
  margin-bottom: 1rem;
}
.lesson-content-area ul {
  list-style-type: disc;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}
.lesson-content-area code {
  background-color: #1f2937; /* bg-gray-800 */
  color: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: monospace;
}

/* Curriculum List Styling */
.lesson-sidebar-section {
  font-size: 1rem;
  font-weight: 600;
  color: #111827; /* text-gray-900 */
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}
.lesson-sidebar-page {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #374151; /* text-gray-700 */
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
}
.lesson-sidebar-page:hover {
  background-color: #f3f4f6; /* bg-gray-100 */
}
.lesson-sidebar-page.active {
  background-color: #eef2ff; /* bg-indigo-50 */
  color: #4338ca; /* text-indigo-700 */
  font-weight: 600;
}

/* Allow dropdowns to spill outside of student/course cards */
.info-card {
    overflow: visible !important;
    z-index: auto;
}

/* Ensure dropdowns always sit on top of everything else */
.action-dropdown {
    z-index: 9999 !important;
}


/* Modern Exam Palette */
.palette-btn {
    @apply text-sm w-10 h-10 flex items-center justify-center rounded-lg
           font-semibold border transition;
}

.palette-unvisited {
    @apply bg-gray-200 text-gray-700;
}

.palette-answered {
    @apply bg-blue-600 text-white;
}

.palette-marked {
    @apply bg-purple-600 text-white;
}

.palette-current {
    @apply ring-2 ring-blue-400;
}



/* 💎 PREMIUM LESSON CONTENT STYLING 💎 */
.custom-premium-lesson {
    word-wrap: break-word; /* Lambe words ko tod dega */
    overflow-wrap: break-word;
}

/* Main Headings inside content */
.custom-premium-lesson h2 {
    color: #1e1b4b;
    font-size: 1.75rem;
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
}

/* Sub-headings */
.custom-premium-lesson h3 {
    color: #4f46e5;
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Paragraph spacing */
.custom-premium-lesson p {
    margin-bottom: 1.25rem;
}

/* Highlighted Keywords */
.custom-premium-lesson strong {
    color: #0f172a;
    font-weight: 700;
    background-color: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Lists formatting */
.custom-premium-lesson ul, .custom-premium-lesson ol {
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.custom-premium-lesson li {
    margin-bottom: 0.5rem;
}

/* Blockquotes (Used for Notes/Tips by AI) */
.custom-premium-lesson blockquote {
    background-color: #f8fafc;
    border-left: 4px solid #4f46e5;
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
    color: #475569;
    font-style: italic;
}
/* Inline code (chhote formulas) */
.custom-premium-lesson code {
    white-space: pre-wrap; /* Code ko zaroorat padne par next line me bhej dega */
    word-break: break-word;
}