:root {
--primary-blue: #4361ee;
--primary-purple: #7209b7;
--app-bg: #f8f9fa;
--card-bg: #ffffff;
--text-primary: #212529;
--text-secondary: #6c757d;
--border-radius: 16px;
--shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
--shadow-md: 0 8px 24px rgba(0,0,0,0.08);
--header-height: 70px;
}

[data-bs-theme="dark"] {
--app-bg: #121212;
--card-bg: #1e1e1e;
--text-primary: #f8f9fa;
--text-secondary: #adb5bd;
--shadow-sm: 0 4px 12px rgba(0,0,0,0.3);
--shadow-md: 0 8px 24px rgba(0,0,0,0.4);
}

body {
background-color: var(--app-bg);
color: var(--text-primary);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
padding-bottom: 80px;
-webkit-overflow-scrolling: touch;
min-height: 100vh;
transition: background-color 0.3s ease;
}

/* Desktop Enhancement */
@media (min-width: 768px) {
body {
padding-bottom: 0;
background: linear-gradient(135deg, var(--app-bg) 0%, #f0f2ff 100%);
}
[data-bs-theme="dark"] body {
background: linear-gradient(135deg, var(--app-bg) 0%, #1a1a2e 100%);
}

.app-container {
/* max-width: 1200px; */
margin: 20px auto;
background: var(--app-bg);
border-radius: 24px;
box-shadow: var(--shadow-md);
min-height: calc(100vh - 40px);
position: relative;
overflow: hidden;
}

.app-container::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 300px;
background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-purple) 100%);
opacity: 0.05;
z-index: 0;
}

[data-bs-theme="dark"] .app-container::before { opacity: 0.1; }

main, header, footer {
position: relative;
z-index: 1;
}

.section-title {
position: relative;
padding-left: 20px;
}

.section-title::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 4px;
height: 24px;
background: linear-gradient(to bottom, var(--primary-blue), var(--primary-purple));
border-radius: 2px;
}

.hero-card {
background: linear-gradient(135deg, rgba(67, 97, 238, 0.1) 0%, rgba(114, 9, 183, 0.1) 100%);
border: 1px solid rgba(67, 97, 238, 0.2);
backdrop-filter: blur(10px);
}

[data-bs-theme="dark"] .hero-card {
background: linear-gradient(135deg, rgba(67, 97, 238, 0.2) 0%, rgba(114, 9, 183, 0.2) 100%);
border: 1px solid rgba(67, 97, 238, 0.3);
}
}

.app-container {
/* max-width: 768px; */
margin: 0 auto;
background: var(--app-bg);
}

/* Enhanced Header for Desktop */
.app-header {
background: var(--card-bg);
border-bottom: 1px solid rgba(0,0,0,0.1);
height: var(--header-height);
position: sticky;
top: 0;
z-index: 1000;
backdrop-filter: blur(10px);
background: rgba(255, 255, 255, 0.95);
}

[data-bs-theme="dark"] .app-header {
border-bottom: 1px solid rgba(255,255,255,0.1);
background: rgba(30, 30, 30, 0.95);
}

.app-card {
background: var(--card-bg);
border-radius: var(--border-radius);
border: none;
box-shadow: var(--shadow-sm);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
margin-bottom: 1rem;
overflow: hidden;
}

.app-card:hover {
transform: translateY(-4px);
box-shadow: var(--shadow-md);
}

.btn-app {
background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
border: none;
border-radius: 12px;
padding: 14px 28px;
font-weight: 600;
color: white;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}

.btn-app::after {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
transition: left 0.5s;
}

.btn-app:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(67, 97, 238, 0.3);
color: white;
}

.btn-app:hover::after {
left: 100%;
}

.icon-wrapper {
width: 64px;
height: 64px;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 16px;
background: linear-gradient(135deg, #e0e7ff, #f3e8ff);
transition: all 0.3s ease;
}

.app-card:hover .icon-wrapper {
transform: scale(1.05);
}

[data-bs-theme="dark"] .icon-wrapper {
background: linear-gradient(135deg, rgba(67, 97, 238, 0.2), rgba(114, 9, 183, 0.2));
}

/* Enhanced Navigation */
.nav-bottom {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: var(--card-bg);
border-top: 1px solid rgba(0,0,0,0.1);
padding: 12px 0;
z-index: 1000;
max-width: 768px;
margin: 0 auto;
backdrop-filter: blur(10px);
background: rgba(255, 255, 255, 0.95);
border-radius: 20px 20px 0 0;
box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
}

[data-bs-theme="dark"] .nav-bottom {
border-top: 1px solid rgba(255,255,255,0.1);
background: rgba(30, 30, 30, 0.95);
box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}

.nav-item {
text-align: center;
color: var(--text-secondary);
transition: all 0.3s ease;
position: relative;
padding: 8px 0;
}

.nav-item.active {
color: var(--primary-blue);
}

.nav-item.active::before {
content: '';
position: absolute;
top: -12px;
left: 50%;
transform: translateX(-50%);
width: 30px;
height: 3px;
background: linear-gradient(to right, var(--primary-blue), var(--primary-purple));
border-radius: 3px;
}

.nav-icon {
font-size: 24px;
margin-bottom: 4px;
transition: transform 0.3s ease;
}

.nav-item.active .nav-icon {
transform: scale(1.1);
}

/* Enhanced Countdown Cards */
.countdown-card {
background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
color: white;
border-radius: var(--border-radius);
padding: 24px;
text-align: center;
position: relative;
overflow: hidden;
}

.countdown-card::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle, rgba(255,255,255,0.1) 1%, transparent 20%);
animation: pulse 4s linear infinite;
}

@keyframes pulse {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

.countdown-number {
font-size: 2.8rem;
font-weight: 800;
line-height: 1;
position: relative;
z-index: 1;
text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Enhanced Search */
.search-bar {
background: var(--card-bg);
border-radius: 50px;
padding: 16px 28px;
border: 2px solid transparent;
box-shadow: var(--shadow-sm);
transition: all 0.3s ease;
background: linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
  linear-gradient(135deg, var(--primary-blue), var(--primary-purple)) border-box;
}

.search-bar:focus-within {
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(67, 97, 238, 0.15);
}

/* Enhanced Horizontal Scroll */
.horizontal-scroll {
display: flex;
overflow-x: auto;
scroll-snap-type: x mandatory;
-webkit-overflow-scrolling: touch;
gap: 20px;
padding: 16px 0;
margin: 0 -16px;
padding-left: 16px;
scrollbar-width: none;
}

.horizontal-scroll::-webkit-scrollbar {
display: none;
}

.video-card {
flex: 0 0 auto;
width: 300px;
scroll-snap-align: start;
}

/* Enhanced Progress Circle */
.progress-circle {
width: 140px;
height: 140px;
border-radius: 50%;
background: conic-gradient(var(--primary-blue) 75%, transparent 0);
display: flex;
align-items: center;
justify-content: center;
position: relative;
animation: rotate 2s linear infinite;
animation-play-state: paused;
}

.progress-circle:hover {
animation-play-state: running;
}

@keyframes rotate {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

.progress-inner {
width: 110px;
height: 110px;
background: var(--card-bg);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
position: relative;
z-index: 1;
}

/* Enhanced Theme Toggle */
.theme-toggle {
position: fixed;
top: 20px;
right: 20px;
z-index: 1001;
width: 56px;
height: 56px;
border-radius: 50%;
background: var(--card-bg);
border: 2px solid transparent;
background: linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
  linear-gradient(135deg, var(--primary-blue), var(--primary-purple)) border-box;
display: flex;
align-items: center;
justify-content: center;
box-shadow: var(--shadow-md);
transition: all 0.3s ease;
cursor: pointer;
}

.theme-toggle:hover {
transform: rotate(30deg) scale(1.1);
}

/* Enhanced Dashboard Icons */
.dashboard-icon {
width: 56px;
height: 56px;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 12px;
background: linear-gradient(135deg, #e0e7ff, #f3e8ff);
transition: all 0.3s ease;
}

.app-card:hover .dashboard-icon {
transform: rotate(5deg) scale(1.1);
}

[data-bs-theme="dark"] .dashboard-icon {
background: linear-gradient(135deg, rgba(67, 97, 238, 0.2), rgba(114, 9, 183, 0.2));
}

/* Enhanced Footer */
.app-footer {
background: var(--card-bg);
border-top: 1px solid rgba(0,0,0,0.1);
padding: 40px 0 20px;
margin-top: 40px;
}

[data-bs-theme="dark"] .app-footer {
border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-link {
color: var(--text-secondary);
text-decoration: none;
transition: all 0.3s ease;
position: relative;
padding-left: 16px;
}

.footer-link::before {
content: '›';
position: absolute;
left: 0;
opacity: 0;
transition: all 0.3s ease;
}

.footer-link:hover {
color: var(--primary-blue);
padding-left: 24px;
transform: translateX(5px);
}

.footer-link:hover::before {
opacity: 1;
left: 8px;
}

/* Hide bottom nav on desktop */
@media (min-width: 768px) {
.nav-bottom {
display: none;
}
.horizontal-scroll {
margin: 0;
padding-left: 0;
}
.theme-toggle {
top: 30px;
right: 30px;
}
}

/* Loading animation for cards */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

.animate-card {
animation: fadeInUp 0.6s ease forwards;
}

/* Gradient text for desktop */
@media (min-width: 768px) {
.gradient-text {
background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
}

/* Dashboard Specific Styles */
.dashboard-header {
background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
color: white;
padding: 24px 20px;
border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.profile-avatar {
width: 80px;
height: 80px;
border-radius: 50%;
border: 3px solid rgba(255,255,255,0.3);
overflow: hidden;
}

.stats-card {
background: var(--card-bg);
border-radius: var(--border-radius);
padding: 20px;
border-left: 4px solid var(--primary-blue);
}

.rank-badge {
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
color: white;
}

.subject-progress {
height: 8px;
border-radius: 4px;
background: rgba(0,0,0,0.1);
overflow: hidden;
}

[data-bs-theme="dark"] .subject-progress {
background: rgba(255,255,255,0.1);
}

.progress-fill {
height: 100%;
border-radius: 4px;
background: linear-gradient(90deg, var(--primary-blue), var(--primary-purple));
}

.topper-card {
    flex-shrink: 0;
    width: 40%; /* default: tablet + desktop */
}

/* Mobile devices */
@media (max-width: 767px) {
    .topper-card {
        width: 50%;
    }
}

/* Page Transitions */
.page-transition {
animation: fadeInUp 0.4s ease;
}

/* Breadcrumb */
.breadcrumb-wrap {
  background-color: white;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
}

.breadcrumb {
  background-color: transparent;
  padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "›";
  color: #6c757d;
  padding: 0 8px;
}

[data-bs-theme="dark"] .breadcrumb-wrap {
  background-color: #1e293b;
  border-bottom-color: #334155;
}

[data-bs-theme="dark"] .breadcrumb a {
  color: #c7d2fe;
}

[data-bs-theme="dark"] .breadcrumb-item.active {
  color: #e5e7eb;
}

/* Card Icons */
.content-card {
background: white;
border-radius: 12px;
padding: 20px;
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
height: 100%;
position: relative;
transition: transform 0.2s ease;
}

.content-card:hover {
transform: translateY(-2px);
}

.card-icon {
font-size: 32px;
margin-bottom: 12px;
}

.folder .card-icon {
color: #ffc107;
}

.pdf .card-icon {
color: #dc3545;
}

.video .card-icon {
color: #4361ee;
}

.card-title {
font-size: 16px;
font-weight: 600;
margin-bottom: 6px;
}

.card-meta {
font-size: 13px;
color: #6c757d;
margin-bottom: 0;
}

.card-actions {
position: absolute;
top: 16px;
right: 16px;
}

.btn-action {
background: none;
border: none;
color: #6c757d;
padding: 4px;
}

/* ===============================
   WHITE THEME CARD (APP STYLE)
================================ */
.stat-card-white{
    background:#ffffff;
    border-radius:18px;
    border:1px solid rgba(99,102,241,0.25);
    box-shadow:0 8px 24px rgba(0,0,0,0.08);
    transition:all .3s ease;
}

.stat-card-white:hover{
    transform:translateY(-3px);
    box-shadow:0 14px 30px rgba(0,0,0,0.12);
}

/* Icon */
.icon-box{
    width:56px;
    height:56px;
    border-radius:14px;
    background:rgba(99,102,241,0.12);
    display:flex;
    align-items:center;
    justify-content:center;
    color:#4f46e5;
    font-size:26px;
}

/* Text */
.stat-card-white h2{
    color:#111827;
}

.stat-card-white p{
    font-size:15px;
}

/* Dark mode support */
[data-bs-theme="dark"] .stat-card-white{
    background:#1f2937;
    border-color:#6366f1;
}

[data-bs-theme="dark"] .stat-card-white h2{
    color:#f9fafb;
}

[data-bs-theme="dark"] .stat-card-white p{
    color:#d1d5db;
}

/* ===============================
   PROGRESS BAR
================================ */
.subject-progress {
    position: relative;
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 6px;
    margin-top: 18px;
    overflow: visible; /* CRITICAL */
}

/* Filled progress */
.progress-fill {
    height: 100%;
    border-radius: 6px;
}

/* ===============================
   LOCATION PIN BASE
================================ */
.progress-pin {
    position: absolute;
    top: -22px;
    width: 14px;
    height: 14px;
    border-radius: 50% 50% 50% 0;
    transform: translateX(-50%) rotate(-45deg);
    z-index: 9999;
    cursor: pointer;
}

/* Inner white dot */
.progress-pin::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    top: 4px;
    left: 4px;
}

/* ===============================
   PIN COLORS
================================ */
.pin-min {
    background: #dc3545; /* red */
}

.pin-avg {
    background: #ffc107;
    box-shadow: 0 0 0 2px #ffffff;
}

.pin-max {
    background: #198754; /* green */
}

/* ===============================
   TOOLTIP (HOVER / TAP)
================================ */
.progress-pin::before {
    content: attr(data-label);
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    background: #111827;
    color: #ffffff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* Show tooltip */
.progress-pin:hover::before,
.progress-pin:active::before {
    opacity: 1;
}

/* ===============================
   DARK MODE
================================ */
[data-bs-theme="dark"] .subject-progress {
    background: #374151;
}

[data-bs-theme="dark"] .progress-pin::before {
    background: #f9fafb;
    color: #111827;
}

/* Trend animations */
.animate-up {
    animation: rise 0.4s ease-in-out;
}
.animate-down {
    animation: fall 0.4s ease-in-out;
}
.animate-flat {
    animation: pulse 0.6s ease-in-out;
}

@keyframes rise {
    from { transform: translateY(6px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fall {
    from { transform: translateY(-6px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { opacity: .6; }
    50% { opacity: 1; }
    100% { opacity: .6; }
}

.subject-hover {
    cursor: pointer;
}

.subject-hover:hover {
    text-decoration: underline;
    color: var(--bs-primary);
}

.subject-trigger {
    cursor: pointer;
}

.subject-trigger:hover {
    color: var(--bs-primary);
    text-decoration: underline;
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gradient-text {
    background: linear-gradient(135deg, #4361ee, #7209b7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Security Toggle Box */
.security-header {
    cursor: pointer;
}

.security-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
    opacity: 0;
}

.security-box.open .security-content {
    max-height: 600px; /* enough for content */
    opacity: 1;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.security-box.open .toggle-icon {
    transform: rotate(180deg);
}

.message-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999999;

    display: none;              /* ⬅️ important */
    align-items: center;
    justify-content: center;
}

.message-alert {
    max-width: 420px;
    width: calc(100% - 32px);
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.mobile-menu{
position:fixed;
top:0;
right:-280px;
width:260px;
height:100%;
background:#fff;
box-shadow:0 0 20px rgba(0,0,0,0.15);
transition:0.3s;
z-index:9999;
}

.mobile-menu.active{
right:0;
}

.mobile-menu-content{
padding:25px;
}

.menu-link{
display:flex;
align-items:center;
padding:12px 0;
color:#333;
text-decoration:none;
border-bottom:1px solid #eee;
font-weight:500;
}

.menu-link:hover{
color:var(--primary-blue);
}





