/* ===================================
   DuckyCode Custom Styles
   Child-friendly educational robot website
   =================================== */

/* ===================================
   Variables and Root Styles
   =================================== */
:root {
  --primary-color: #0066cc;
  --secondary-color: #ff6b6b;
  --success-color: #51cf66;
  --warning-color: #ffd93d;
  --info-color: #74c0fc;
  --dark-color: #2d3748;
  --light-color: #f8f9fa;
  --white: #ffffff;

  --font-family-base:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --border-radius: 0.75rem;
  --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* ===================================
   Global Styles
   =================================== */
body {
  font-family: var(--font-family-base);
  color: var(--dark-color);
  line-height: 1.6;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* ===================================
   Typography
   =================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
}

.display-1,
.display-2,
.display-3,
.display-4 {
  font-weight: 800;
}

/* ===================================
   Buttons
   =================================== */
.btn {
  border-radius: var(--border-radius);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

/* ===================================
   Navigation
   =================================== */
.navbar {
  transition: all 0.3s ease;
}

.navbar-brand {
  display: inline-block;
  padding-top: 0.3125rem;
  padding-bottom: 0.3125rem;
  margin-right: 1rem;
  line-height: inherit;
  white-space: nowrap;
}

.navbar-brand img {
  height: 40px;
  width: auto;
  display: block;
  transition: transform 0.3s ease;
}

.navbar-brand:hover img {
  transform: scale(1.05);
}

.nav-link {
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
  padding: 0.5rem 1rem;
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

/* ===================================
   Cards
   =================================== */
.card {
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow-lg);
}

.card-body {
  padding: 1.5rem;
}

/* ===================================
   Hero Section
   =================================== */
.hero-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.carousel {
  max-height: 600px;
}

.carousel-inner {
  border-radius: var(--border-radius);
  overflow: hidden;
}

.carousel-item {
  position: relative;
  background: #1a1a2e;
}

.carousel-item img {
  width: 100%;
  height: auto;
  min-height: 400px;
  max-height: 600px;
  object-fit: contain;
  object-position: center;
}

.carousel-caption {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(15px);
  border-radius: var(--border-radius);
  padding: 2rem;
  bottom: 2rem;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  max-width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.carousel-caption h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-caption p {
  font-size: 1rem;
  margin-bottom: 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Carousel controls */
.carousel-control-prev,
.carousel-control-next {
  width: 5%;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 3rem;
  height: 3rem;
  background-size: 100%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Carousel indicators */
.carousel-indicators {
  bottom: 1rem;
}

.carousel-indicators [data-bs-target] {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 5px;
  background-color: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}

.carousel-indicators .active {
  background-color: #ffffff;
  transform: scale(1.2);
}

@media (max-width: 768px) {
  .carousel {
    max-height: 400px;
  }

  .carousel-item img {
    min-height: 300px;
    max-height: 400px;
  }

  .carousel-caption {
    padding: 1rem;
    bottom: 1rem;
  }

  .carousel-caption h2 {
    font-size: 1.25rem;
  }

  .carousel-caption p {
    font-size: 0.875rem;
  }

  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
  }
}

@media (max-width: 576px) {
  .carousel-caption h2 {
    font-size: 1rem;
  }

  .carousel-caption p {
    font-size: 0.75rem;
  }
}

.bg-gradient-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-secondary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.bg-gradient-success {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* ===================================
   Feature Boxes
   =================================== */
.feature-box {
  transition: all 0.3s ease;
  border-radius: var(--border-radius);
}

.feature-box:hover {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.1) 100%
  );
  transform: translateY(-5px);
}

/* ===================================
   Pricing Cards
   =================================== */
.card.border-primary {
  border-width: 3px;
  overflow: visible; /* Allow "MOST POPULAR" badge to show */
}

.badge {
  font-weight: 600;
  padding: 0.5rem 1rem;
}

/* ===================================
   Animations
   =================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* ===================================
   Forms
   =================================== */
.form-control,
.form-select {
  border-radius: var(--border-radius);
  border: 2px solid #e2e8f0;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

/* ===================================
   Footer
   =================================== */
footer a {
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--white) !important;
  text-decoration: underline;
}

/* ===================================
   Accordion
   =================================== */
.accordion-button {
  font-weight: 600;
  background-color: var(--light-color);
}

.accordion-button:not(.collapsed) {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.1) 100%
  );
  color: var(--primary-color);
}

.accordion-button:focus {
  box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

/* ===================================
   Tables
   =================================== */
.table {
  border-radius: var(--border-radius);
  overflow: hidden;
}

.table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--white);
}

/* ===================================
   Images
   =================================== */
img {
  max-width: 100%;
  height: auto;
}

.img-fluid {
  border-radius: var(--border-radius);
}

.rounded-circle {
  border: 4px solid var(--light-color);
  box-shadow: var(--box-shadow);
}

/* ===================================
   Utility Classes
   =================================== */
.shadow-sm {
  box-shadow: var(--box-shadow) !important;
}

.shadow-lg {
  box-shadow: var(--box-shadow-lg) !important;
}

.text-primary {
  color: var(--primary-color) !important;
}

/* ===================================
   Responsive Utilities
   =================================== */
@media (max-width: 576px) {
  .display-4 {
    font-size: 2rem;
  }

  .lead {
    font-size: 1rem;
  }

  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }

  .card-body.p-5 {
    padding: 2rem !important;
  }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
  .navbar,
  footer,
  .btn,
  .carousel-control-prev,
  .carousel-control-next,
  .carousel-indicators {
    display: none !important;
  }
}

/* ===================================
   Child-Friendly Elements
   =================================== */
.playful-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Icon hover effects */
.card img,
.feature-box img {
  transition: transform 0.3s ease;
}

.card:hover img,
.feature-box:hover img {
  transform: scale(1.1) rotate(5deg);
}

/* Fun hover effect for team member cards */
.card-body img.rounded-circle {
  transition: all 0.3s ease;
}

.card:hover .card-body img.rounded-circle {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* Colorful badges */
.badge.bg-success {
  background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%) !important;
}

.badge.bg-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* ===================================
   Loading Animation (Optional)
   =================================== */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

/* ===================================
   Accessibility
   =================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ===================================
   Custom Scrollbar (Webkit browsers)
   =================================== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--light-color);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}
