/**
 * Continuous Curves (Squircles)
 * Apple's signature smooth, continuous corner curves
 * More organic than standard border-radius
 */

/* ========================================================================
   SQUIRCLE UTILITIES
   ======================================================================== */

/* Small squircle (buttons, badges) */
.squircle-sm {
  border-radius: 10% / 6%;
}

/* Medium squircle (cards, containers) */
.squircle-md {
  border-radius: 16% / 10%;
}

/* Large squircle (modals, sheets) */
.squircle-lg {
  border-radius: 20% / 12%;
}

/* Extra large squircle (full-screen elements) */
.squircle-xl {
  border-radius: 24% / 14%;
}

/* Full squircle (circular but with continuous curves) */
.squircle-full {
  border-radius: 50% / 30%;
}

/* ========================================================================
   PRECISE SQUIRCLES (using clip-path)
   More accurate but requires data-squircle attribute for JS application
   ======================================================================== */

.squircle-precise {
  /* Will be set by squircle-generator.js */
  position: relative;
}

/* ========================================================================
   COMPONENT-SPECIFIC SQUIRCLES
   ======================================================================== */

/* Button squircles */
.btn-squircle,
.cta-primary,
.cta-secondary,
.demo-button,
[data-elastic-button] {
  border-radius: 14% / 8%;
}

/* Card squircles */
.feature-card,
.lesson-card,
.demo-container,
.card {
  border-radius: 18% / 11%;
}

/* Input squircles */
input[type="text"],
input[type="email"],
input[type="search"],
textarea,
select {
  border-radius: 12% / 7%;
}

/* Badge/pill squircles */
.badge,
.pill,
.demo-badge,
.tag {
  border-radius: 50% / 30%;
}

/* Modal/dialog squircles */
.modal,
.dialog,
.sheet {
  border-radius: 20% / 12%;
}

/* Avatar squircles (iOS-style rounded squares) */
.avatar,
.profile-pic {
  border-radius: 22% / 13%;
}

/* Icon container squircles */
.icon-container,
.feature-icon {
  border-radius: 20% / 12%;
}

/* ========================================================================
   CAROUSEL & LESSON CARDS
   ======================================================================== */

.lesson-card-container {
  border-radius: 20% / 12%;
}

.carousel-slide {
  border-radius: 18% / 11%;
}

/* ========================================================================
   HOVER STATES
   Maintain squircle shape during transforms
   ======================================================================== */

.squircle-sm:hover,
.squircle-md:hover,
.squircle-lg:hover,
.squircle-xl:hover {
  /* Squircle shape preserved during scale/transform */
  transform-origin: center;
}

/* ========================================================================
   RESPONSIVE ADJUSTMENTS
   ======================================================================== */

@media (max-width: 768px) {
  /* Slightly reduce corner smoothing on small screens */
  .squircle-md {
    border-radius: 15% / 9%;
  }

  .squircle-lg {
    border-radius: 18% / 11%;
  }
}

/* ========================================================================
   ACCESSIBILITY
   ======================================================================== */

@media (prefers-reduced-motion: reduce) {
  /* Keep squircles but remove any transitioning effects */
  .squircle-sm,
  .squircle-md,
  .squircle-lg,
  .squircle-xl {
    transition: none;
  }
}

/* ========================================================================
   ADVANCED: GRADIENT BORDERS WITH SQUIRCLES
   ======================================================================== */

.squircle-gradient-border {
  position: relative;
  border-radius: 18% / 11%;
  background: rgba(255, 255, 255, 0.03);
}

.squircle-gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(235, 195, 120, 0.3),
    rgba(255, 215, 145, 0.2)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ========================================================================
   GLASS EFFECT WITH SQUIRCLES
   ======================================================================== */

.squircle-glass {
  border-radius: 18% / 11%;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.squircle-glass:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================================================
   DAG NODE SQUIRCLES
   ======================================================================== */

.dag-node {
  /* Nodes are circular but with continuous curve squircle */
  border-radius: 50%;
  /* For more precision, use data-squircle on node elements */
}

.dag-node.squircle {
  border-radius: 30% / 18%;
}

/* ========================================================================
   NOTIFICATION SQUIRCLES
   ======================================================================== */

.notification,
.toast,
.alert {
  border-radius: 16% / 10%;
}

/* ========================================================================
   BOTTOM NAV SQUIRCLES
   ======================================================================== */

.mobile-bottom-nav {
  border-radius: 20% / 12%;
}

.bottom-nav-item {
  border-radius: 14% / 8%;
}

/* ========================================================================
   FOOTER SQUIRCLE
   ======================================================================== */

.site-footer {
  border-radius: 20% / 12%;
}

/* ========================================================================
   IMAGE SQUIRCLES
   ======================================================================== */

img.squircle {
  border-radius: 18% / 11%;
  object-fit: cover;
}

/* ========================================================================
   VIDEO PLAYER SQUIRCLES
   ======================================================================== */

video.squircle,
.video-container {
  border-radius: 16% / 10%;
  overflow: hidden;
}
