/* Worksheet & Math Theme Enhancements */
.worksheet-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
  background: url('https://cdn.pixabay.com/photo/2017/01/31/13/14/animal-2023924_1280.png') repeat;
  background-size: 200px;
  filter: blur(1px);
}

.worksheet-title {
  font-family: 'Comic Neue', 'Fredoka One', cursive, sans-serif;
  font-size: 2.2rem;
  color: #ff6b9d;
  text-shadow: 2px 2px 8px #fff7, 0 2px 8px #764ba2aa;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.math-emoji {
  font-size: 2rem;
  margin-right: 0.5rem;
  vertical-align: middle;
}

.problem-card {
  border: 3px dashed #FDB833 !important;
  background: linear-gradient(135deg, #fffbe7 0%, #ffe3f1 100%) !important;
  position: relative;
  overflow: visible;
}
.problem-card .math-emoji {
  position: absolute;
  top: -18px; right: -18px;
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 4px #ff6b9d88);
}

.answer-card {
  background: linear-gradient(135deg, #d1e7dd 0%, #e0f7fa 100%) !important;
  border: 2px solid #4CAF50 !important;
}

.answer-key-section {
  page-break-before: always;
  margin-top: 1.5rem;
  padding-top: .5rem;
  border-top: 4px dotted #6c757d;
  background: linear-gradient(90deg, #f3f4f6 0%, #e1bee7 100%) !important;
  border-radius: 20px;
}
/* ==========================================
   Kids-Friendly Theme CSS
   Colorful, Fun, and Engaging Design
   ========================================== */

/* Import fun Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@300;400;700&family=Quicksand:wght@300;400;500;600;700&family=Fredoka+One&display=swap');

/* Root Variables */
:root {
  --primary-color: #FF6B9D;
  --secondary-color: #FDB833;
  --success-color: #4CAF50;
  --info-color: #00BCD4;
  --warning-color: #FF9800;
  --danger-color: #F44336;
  --purple-color: #9C27B0;
  --blue-color: #2196F3;
  --green-color: #8BC34A;
  --orange-color: #FF5722;
}

/* Body and General Styles */
body {
  font-family: 'Quicksand', sans-serif !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%) !important;
  background-attachment: fixed !important;
  position: relative;
  overflow-x: hidden;
}

/* Animated Background Shapes */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(255, 107, 157, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(253, 184, 51, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(76, 175, 80, 0.2) 0%, transparent 50%);
  animation: backgroundMove 20s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes backgroundMove {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, 20px); }
}

/* Content Wrapper */
.content-wrapper {
  background: rgba(255, 255, 255, 0.95) !important;
  border-radius: 30px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
  margin: 15px !important;
  padding: 20px !important;
  position: relative;
  z-index: 1;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Comic Neue', cursive !important;
  font-weight: 700 !important;
  color: #5e35b1 !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.content-header h1 {
  font-size: 2.5rem !important;
  background: linear-gradient(45deg, #FF6B9D, #FDB833, #4CAF50, #00BCD4);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 5s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Card Styles */
.card {
  border-radius: 20px !important;
  border: none !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  overflow: hidden;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%) !important;
}

.card:hover {
  transform: translateY(-10px) rotate(1deg) !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25) !important;
}

.card-header {
  background: linear-gradient(135deg, #FF6B9D, #FDB833) !important;
  color: white !important;
  border-radius: 20px 20px 0 0 !important;
  font-family: 'Comic Neue', cursive !important;
  font-weight: 700 !important;
  border: none !important;
  padding: 15px 20px !important;
}

/* Colorful Card Variants */
.card.card-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
}

.card.card-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
  color: white !important;
}

.card.card-warning {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
  color: white !important;
}

.card.card-info {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
  color: white !important;
}

/* Button Styles */
.btn {
  border-radius: 25px !important;
  font-family: 'Quicksand', sans-serif !important;
  font-weight: 600 !important;
  padding: 12px 30px !important;
  border: none !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: scale(1.1) rotate(-2deg) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.btn-success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

.btn-warning {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.btn-info {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
}

.btn-secondary {
  background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%) !important;
}

/* Animated Icons */
.fa, .fas, .far, .fab {
  animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Progress Bar */
.progress {
  border-radius: 15px !important;
  height: 25px !important;
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 100%) !important;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  border-radius: 15px !important;
  background: linear-gradient(90deg, #FF6B9D, #FDB833, #4CAF50) !important;
  background-size: 200% 100%;
  animation: progressGradient 2s linear infinite;
  box-shadow: 0 2px 10px rgba(255, 107, 157, 0.5);
}

@keyframes progressGradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Form Elements */
.form-control, .form-select {
  border-radius: 15px !important;
  border: 2px solid #e0e0e0 !important;
  padding: 12px 20px !important;
  font-family: 'Quicksand', sans-serif !important;
  transition: all 0.3s ease !important;
}

.form-control:focus, .form-select:focus {
  border-color: #FF6B9D !important;
  box-shadow: 0 0 0 0.2rem rgba(255, 107, 157, 0.25) !important;
  transform: scale(1.02);
}

.form-check-input:checked {
  background-color: #FF6B9D !important;
  border-color: #FF6B9D !important;
}

/* Badges */
.badge {
  border-radius: 15px !important;
  padding: 8px 15px !important;
  font-weight: 600 !important;
  font-family: 'Quicksand', sans-serif !important;
}

/* Alert Styles */
.alert {
  border-radius: 15px !important;
  border: none !important;
  font-family: 'Quicksand', sans-serif !important;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.alert-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
  color: #155724 !important;
}

.alert-danger {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%) !important;
  color: #721c24 !important;
}

.alert-info {
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%) !important;
  color: #0c5460 !important;
}

/* Sidebar */
.main-sidebar {
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%) !important;
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2) !important;
}

.main-sidebar, .main-sidebar .brand-link, .main-sidebar .nav-sidebar .nav-link, .main-sidebar .nav-header {
  color: #fff !important;
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
  background: rgba(255, 255, 255, 0.2) !important;
  border-radius: 10px !important;
  margin: 5px 10px !important;
  color: #fff !important;
  font-weight: bold;
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.nav-sidebar .nav-link {
  color: #fff !important;
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
  font-weight: 600;
}

.nav-sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  transform: translateX(5px);
  transition: all 0.3s ease;
  color: #fff !important;
}

/* Navbar */
.main-header {
  background: linear-gradient(90deg, #FF6B9D 0%, #FDB833 50%, #4CAF50 100%) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

/* Floating Animation */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

.float-animation {
  animation: float 3s ease-in-out infinite;
}

/* Bounce Animation */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.bounce-animation {
  animation: bounce 1s ease-in-out infinite;
}

/* Sidebar Brand Glowing Animation */
.brand-link .brand-text span {
  display: inline-block;
  transition: all 0.3s ease;
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

/* Wiggle Animation */
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

.wiggle-animation {
  animation: wiggle 1s ease-in-out infinite;
}

/* Star Rating/Decorations */
.star-decoration {
  display: inline-block;
  font-size: 2rem;
  color: #FDB833;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  animation: starTwinkle 1.5s ease-in-out infinite;
}

@keyframes starTwinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.2); }
}

/* Confetti Effect (for success pages) */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: #FDB833;
  position: absolute;
  animation: confettiFall 3s linear infinite;
}

@keyframes confettiFall {
  to {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* List Group Items */
.list-group-item {
  border-radius: 15px !important;
  border: none !important;
  margin-bottom: 10px !important;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
}

.list-group-item:hover {
  transform: translateX(10px) scale(1.02) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
  background: linear-gradient(135deg, #FF6B9D 0%, #FDB833 100%) !important;
  color: white !important;
}

/* Table Styles */
.table {
  border-radius: 15px !important;
  overflow: hidden;
}

.table thead th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  font-family: 'Comic Neue', cursive !important;
  border: none !important;
}

.table tbody tr {
  transition: all 0.3s ease;
}

.table tbody tr:hover {
  background: linear-gradient(135deg, #f8f9ff 0%, #e8eaff 100%) !important;
  transform: scale(1.01);
}

/* Loading Spinner */
.spinner-border {
  border-top-color: #FF6B9D !important;
  animation: spinner 1s linear infinite, colorChange 3s linear infinite;
}

@keyframes colorChange {
  0% { border-top-color: #FF6B9D; }
  33% { border-top-color: #FDB833; }
  66% { border-top-color: #4CAF50; }
  100% { border-top-color: #FF6B9D; }
}

/* Tooltip */
.tooltip-inner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border-radius: 10px !important;
  font-family: 'Quicksand', sans-serif !important;
}

/* Modal */
.modal-content {
  border-radius: 25px !important;
  border: none !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
}

.modal-header {
  background: linear-gradient(135deg, #FF6B9D, #FDB833) !important;
  color: white !important;
  border-radius: 25px 25px 0 0 !important;
  border: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .content-wrapper {
    margin: 10px !important;
    padding: 15px !important;
    border-radius: 20px !important;
  }
  
  .card {
    margin-bottom: 15px !important;
  }
  
  h1 {
    font-size: 1.8rem !important;
  }
}

/* Print Styles */
@media print {
  body {
    background: white !important;
  }
  
  .content-wrapper {
    background: white !important;
    box-shadow: none !important;
  }
}
