:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --header-bg: #6a0dad;
  --header-text: #ffffff;
  --accordion-bg: #ffffff;
  --accordion-border: #e0e0e0;
  --accordion-header-bg: linear-gradient(to right, #fcfcfc, #f8f8f8);
  --accordion-text: #4b0082;
  --accordion-content-bg: #ffffff;
  --accordion-content-text: #444;
  --accordion-hover-shadow: rgba(0,0,0,0.1);
  --whatsapp-color: #25D366;
  --telegram-color: #0088cc;
  --quiz-color: #ff6b6b;
  --transition-speed: 0.3s;
  --border-radius-sm: 5px;
  --border-radius-lg: 25px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
}

[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #ffffff;
  --header-bg: #4a0080;
  --header-text: #ffffff;
  --accordion-bg: #2d2d2d;
  --accordion-border: #404040;
  --accordion-header-bg: linear-gradient(to right, #2d2d2d, #333333);
  --accordion-text: #e0b0ff;
  --accordion-content-bg: #2d2d2d;
  --accordion-content-text: #dddddd;
  --accordion-hover-shadow: rgba(0,0,0,0.3);
  --whatsapp-color: #1ea952;
  --telegram-color: #0077b5;
  --quiz-color: #e65d5d;
}

.common-transition {
  transition: all var(--transition-speed) ease;
}

/* General Styling */
body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.5;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header Styling */
header {
  background-color: var(--header-bg);
  color: var(--header-text);
  padding: 0.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0 auto;
  font-size: 1.5rem;
  text-align: center;
  flex-grow: 1;
}

/* Theme Toggle Button */
.theme-toggle-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-text {
  color: var(--header-text);
  font-size: 0.9rem;
}

.theme-toggle {
  background: transparent;
  border: none;
  color: var(--header-text);
  cursor: pointer;
  padding: 0.5rem;
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

@media (max-width: 480px) {
  .theme-text {
    font-size: 0.8rem;
  }
}

/* Marquee Container */
.marquee-container {
  background: linear-gradient(45deg, #6a0dad, #9b4dca);
  padding: 8px 0;
  overflow: hidden;
  position: relative;
}

.marquee {
  white-space: nowrap;
  display: flex;
  animation: marquee 20s linear infinite;
}

.marquee span {
  color: white;
  font-size: 0.9rem;
  padding: 0 20px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

@keyframes marquee {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* WhatsApp Button and Circular Marquee */
.whatsapp-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.whatsapp-button {
  position: relative;
  background-color: #25D366;
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  text-decoration: none;
  transition: all 0.3s ease;
  z-index: 2;
}

.whatsapp-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.whatsapp-button i {
  font-size: 30px;
}

.whatsapp-marquee {
  position: absolute;
  width: 100%;
  height: 100%;
  animation: rotate 12s linear infinite;
  pointer-events: none;
}

.whatsapp-marquee-text {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: #25D366;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.whatsapp-marquee::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2px dashed #25D366;
  border-radius: 50%;
  animation: rotate 12s linear infinite reverse;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Data Tabs */
.data-tabs {
  background: #f8f9fa;
  padding: 1rem;
  border-bottom: 1px solid #dee2e6;
}

.data-tabs-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.data-tab {
  padding: 0.85rem 1.75rem; /* Increased padding for better touch targets */
  border: none;
  border-radius: 25px;
  background: #fff;
  color: #4b0082;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 44px; /* Minimum touch target size */
}

.data-tab:hover {
  background: #ede7f6;
  transform: translateY(-2px);
}

.data-tab.active {
  background: #6a0dad;
  color: white;
}

.quiz-tab {
  background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
  margin-left: auto;
}

.quiz-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.telegram-tab {
  background: linear-gradient(45deg, #0088cc, #00a0e3);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
  margin-left: 1rem;
}

.telegram-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

/* Navigation Bar */
.navbar-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 0 10px;
  background: #f8f9fa;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.navbar {
  display: flex;
  white-space: nowrap;
  scrollbar-width: thin;
  scroll-behavior: smooth;
  padding: 10px 0;
  gap: 0.5rem;
  min-width: min-content;
  justify-content: flex-start;
}

.navbar::-webkit-scrollbar {
  height: 4px;
}

.navbar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.navbar::-webkit-scrollbar-thumb {
  background: #9b4dca;
  border-radius: 4px;
}

.nav-link {
  flex: 0 0 auto;
  padding: 12px 24px; /* Increased padding for better touch targets */
  background-color: #f5f5f5;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  color: #4b0082;
  min-width: max-content;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
  touch-action: manipulation; /* Optimize for touch */
}

.nav-link:hover {
  background-color: #ede7f6;
  transform: translateY(-2px);
}

.nav-link.active {
  background-color: #6a0dad;
  color: white;
}

/* WhatsApp Button */
.whatsapp-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.whatsapp-button {
  background-color: #25D366;
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.whatsapp-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.whatsapp-button i {
  font-size: 30px;
}

/* Back to Top Button */
#back-to-top {
  position: fixed;
  bottom: 100px;
  right: 90px;
  z-index: 1000;
  width: 60px;
  height: 60px;
  background-color: var(--accordion-text);
  color: var(--bg-color);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  opacity: 0.9;
}

#back-to-top::before {
  content: "Back to Top";
  position: absolute;
  bottom: 100%;
  right: 50%;
  transform: translateX(50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 10px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#back-to-top::after {
  content: "";
  position: absolute;
  top: -10px;
  right: 50%;
  transform: translateX(50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#back-to-top:hover::before,
#back-to-top:hover::after {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* Tooltip for WhatsApp button */
.whatsapp-button::before {
  content: "Suggestions & Corrections";
  position: absolute;
  bottom: 100%;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 10px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.whatsapp-button::after {
  content: "";
  position: absolute;
  bottom: 100%;
  right: 25px;
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.whatsapp-button:hover::before,
.whatsapp-button:hover::after {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
  #back-to-top,
  .whatsapp-button {
    width: 50px;
    height: 50px;
  }
  
  #back-to-top {
    font-size: 20px;
  }
  
  .whatsapp-button i {
    font-size: 25px;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .whatsapp-button {
    width: 50px;
    height: 50px;
  }
  
  .whatsapp-button i {
    font-size: 25px;
  }
  
  .whatsapp-button::before {
    font-size: 12px;
    padding: 6px 10px;
  }
}

@media (max-width: 480px) {
  .whatsapp-button {
    width: 45px;
    height: 45px;
  }
  
  .whatsapp-button i {
    font-size: 22px;
  }
  
  .whatsapp-button::before {
    font-size: 11px;
    padding: 5px 8px;
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
  }
  
  .whatsapp-button:hover::before {
    transform: translateX(-50%) translateY(0);
  }
  
  .whatsapp-button::after {
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
  }
  
  .whatsapp-button:hover::after {
    transform: translateX(-50%) translateY(0);
  }
}

/* Touch-specific styles */
@media (hover: none) and (pointer: coarse) {
  /* Improve scrolling on touch devices */
  .navbar-container {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 0.5rem 0;
  }

  .nav-link {
    scroll-snap-align: center;
    margin: 0 0.25rem;
  }

  /* Larger touch targets on mobile */
  .whatsapp-button {
    width: 60px;
    height: 60px;
    margin: 10px;
  }

  /* Remove hover effects on touch devices */
  .data-tab:hover,
  .nav-link:hover,
  .accordion:hover {
    transform: none;
  }

  /* Active state feedback */
  .data-tab:active,
  .nav-link:active,
  .accordion:active {
    transform: scale(0.98);
    transition: transform 0.1s;
  }
}

/* Momentum scrolling for iOS */
* {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 480px) {
  .navbar-container {
    padding: 0 3px;
  }

  .nav-link {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .whatsapp-marquee {
    width: 140px;
    height: 140px;
  }
  
  .whatsapp-marquee-text::after {
    width: 140px;
    top: -40px;
    transform-origin: 0 70px;
    font-size: 9px;
  }

  .whatsapp-button {
    width: 45px;
    height: 45px;
  }

  .whatsapp-button i {
    font-size: 22px;
  }
}



/* Main container for accordions */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Accordion Styling */
.accordion {
  border: 1px solid var(--accordion-border);
  margin-bottom: 1rem;
  background-color: var(--accordion-bg);
  transition: all 0.3s ease;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.accordion:hover {
  box-shadow: 0 5px 15px var(--accordion-hover-shadow);
}

.accordion__header {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  position: relative;
  padding: 1.25rem 3.5rem 1.25rem 1.5rem;
  color: var(--accordion-text);
  min-height: 44px;
  background: var(--accordion-header-bg);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.accordion__header::after {
  content: '';
  position: absolute;
  right: 1.5rem;
  width: 20px;
  height: 20px;
  background: var(--accordion-text);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.accordion__header::before {
  content: '+';
  position: absolute;
  right: 1.5rem;
  width: 20px;
  height: 20px;
  color: var(--accordion-bg);
  z-index: 1;
  text-align: center;
  line-height: 20px;
  font-size: 20px;
  transition: transform 0.3s ease;
}

.accordion input:checked ~ .accordion__header::before {
  transform: rotate(45deg);
}

.accordion__content {
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
  background-color: var(--accordion-content-bg);
  border-top: 1px solid var(--accordion-border);
}

.accordion input {
  display: none;
}

.accordion input:checked ~ .accordion__content {
  max-height: 2000px;
  padding: 1.5rem;
}

/* Content styling inside accordion */
.accordion__content h3 {
  color: var(--accordion-text);
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accordion-border);
}

.accordion__content ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.accordion__content li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--accordion-border);
  color: var(--accordion-content-text);
  font-size: 1rem;
  line-height: 1.6;
}

.accordion__content li strong {
  font-weight: 800;
  color: var(--accordion-text);
  margin-right: 0.5rem;
}

.accordion__content li:last-child {
  border-bottom: none;
}

/* Year content header styling */
#year-content h2 {
  text-align: center;
  color: var(--accordion-text);
  margin: 2rem 0;
  font-size: 1.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Footer */
footer {
  background-color: #4b0082;
  color: white;
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
}

footer a {
  color: white;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  header { padding: 0.3rem; }
  .header-content { padding: 0.3rem; }
  header h1 { font-size: 1.2rem; }
  .theme-toggle {
    font-size: 1rem;
    padding: 0.3rem;
  }
  .theme-text { font-size: 0.8rem; }
  .marquee-container { padding: 6px 0; }
  .marquee span {
    font-size: 0.8rem;
    padding: 0 15px;
  }
}

@media (max-width: 480px) {
  header { padding: 0.2rem; }
  .header-content { padding: 0.2rem; }
  header h1 { font-size: 1rem; }
  .theme-toggle {
    font-size: 0.9rem;
    padding: 0.2rem;
  }
  .theme-text { font-size: 0.7rem; }
  .marquee-container { padding: 4px 0; }
  .marquee span {
    font-size: 0.75rem;
    padding: 0 10px;
  }
  .data-tabs { padding: 0.5rem; }
  .data-tab {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }
  .nav-link {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  .quiz-tab, .telegram-tab {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 360px) {
  header h1 { font-size: 0.9rem; }
  .theme-toggle { font-size: 0.8rem; }
  .theme-text { font-size: 0.65rem; }
  .data-tab {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
  .nav-link {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}