/* static/css/style.css */

body {
    font-family: 'Inter', sans-serif;
}

/* Base Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem; /* Consistent padding */
    border-width: 1px;
    border-color: transparent;
    font-weight: 500;
    border-radius: 0.75rem; /* Slightly more rounded */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06); /* Stronger shadow */
    color: #ffffff;
    transition: all 0.2s ease-in-out; /* Smooth transitions for all properties */
    cursor: pointer;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px); /* Subtle lift on hover */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05); /* Enhanced shadow on hover */
}

/* Specific Button Colors */
.btn-primary {
  background-color: #4F46E5; /* Indigo-600 */
}

.btn-primary:hover:not(:disabled) {
    background-color: #4338CA; /* Indigo-700 */
}

.btn-secondary {
    background-color: #4B5563; /* Slate-600 */
}

.btn-secondary:hover:not(:disabled) {
    background-color: #374151; /* Slate-700 */
}

.btn-success {
    background-color: #10B981; /* Emerald-500 */
}

.btn-success:hover:not(:disabled) {
    background-color: #059669; /* Emerald-600 */
}

.btn-danger {
    background-color: #EF4444; /* Red-500 */
}

.btn-danger:hover:not(:disabled) {
    background-color: #DC2626; /* Red-600 */
}

/* Updated Disabled Styles */
.btn:disabled, .btn-disabled {
    background-color: #9CA3AF; /* Gray-400 */
    color: #E5E7EB; /* Lighter text for disabled */
    cursor: not-allowed;
    transform: none; /* Disable lift for disabled buttons */
    box-shadow: none; /* Disable shadow for disabled buttons */
    opacity: 0.7; /* Add opacity for visual cue */
}

/* Select Element Styles */
select {
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  border: 1px solid #D1D5DB; /* Gray-300 */
  border-radius: 0.5rem;
  width: 100%;
  color: #374151; /* Slate-700 */
  line-height: 1.25;
  padding: 0.5rem 1rem; /* Added padding for better visual */
}

select:focus {
  outline: none;
  border-color: #4F46E5; /* Indigo-600 on focus */
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); /* Soft indigo ring */
}

/* Text Gradient */
.text-gradient {
  background: linear-gradient(to right, #4F46E5, #8B5CF6, #D946EF); /* More vibrant gradient */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

/* Navigation Link Styles */
.nav-link {
  display: inline-flex;
  align-items: center;
  border-bottom: 0.15rem solid transparent; /* Use border-bottom for active state */
  font-weight: 500;
  color: #4B5563; /* Slate-600 */
  transition: all 0.2s ease-in-out;
  padding: 0.5rem 0.75rem; /* Add padding for clickable area */
  border-radius: 0.5rem; /* Slight roundness for hover background */
}

.nav-link:hover {
  background-color: #F3F4F6; /* Gray-100 */
  color: #1F2937; /* Gray-900 */
}

.nav-link-active {
  background-color: #4F46E5; /* Indigo-600 */
  border-color: transparent; /* No border for active on mobile/collapsed */
  color: white;
}

.nav-link-active:hover {
  background-color: #4338CA; /* Indigo-700 */
  color: white; /* Keep text white on hover for active */
}

@media (min-width: 768px) {
  .nav-link-active {
    border-color: #4F46E5; /* Indigo-600 border for active on desktop */
    background-color: transparent; /* Transparent background on desktop */
    color: #1F2937; /* Dark text for active on desktop */
  }
  .nav-link-active:hover {
    background-color: #F3F4F6; /* Gray-100 on hover for active desktop */
    color: #1F2937; /* Dark text on hover for active desktop */
  }
}

/* Card Animations & Shadows */
.animate-card {
  position: relative;
  overflow: hidden;
  transition: all 0.7s ease;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05); /* Standard card shadow */
}

.animate-card::before {
  content: '';
  position: absolute;
  top: -70%;
  left: -70%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    0deg, 
    transparent, 
    transparent 20%, 
    rgba(129, 140, 248, 0.35) /* Lighter blue/purple tint */
  );
  transform: rotate(-45deg);
  transition: all 0.8s ease;
  opacity: 0;
}

.animate-card:hover {
  transform: translateY(-5px); /* Stronger lift on hover */
  box-shadow: 0 20px 25px -5px rgba(79, 70, 229, 0.2), 0 8px 10px -6px rgba(79, 70, 229, 0.1); /* Indigo-focused shadow */
}

.animate-card:hover::before {
  opacity: 0.8;
  transform: rotate(-50deg) translateY(130%);
}

@media (max-width: 40rem) {
  .animate-card:hover::before {
    transform: rotate(-50deg) translateY(180%);
  }
}

/* --- Recording Button Styles (Unified for practice_word and flashcard_detail) --- */
/* Base record button (the large circular one) */
.record-btn-main {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem; /* 64px */
    height: 4rem; /* 64px */
    background-color: #EF4444; /* Red-500 */
    color: white;
    border-radius: 9999px; /* Fully rounded */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.record-btn-main:hover {
    background-color: #DC2626; /* Red-600 */
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -5px rgba(0, 0, 0, 0.1), 0 6px 8px -6px rgba(0, 0, 0, 0.05);
}

.record-btn-main:disabled {
    background-color: #FCA5A5; /* Red-300 */
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Play/Pause button for audio previews (small circular) */
.play-pause-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem; /* 40px */
    height: 2.5rem; /* 40px */
    background-color: rgba(255, 255, 255, 0.8); /* White with opacity */
    border-radius: 9999px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    flex-shrink: 0; /* Prevent shrinking in flex container */
}

.play-pause-btn:hover {
    background-color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
}

.play-pause-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* General style for the custom audio player container (wraps button and waveform) */
.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* 12px */
    padding: 0.75rem; /* 12px */
    background-color: #F3F4F6; /* Gray-100 */
    border-radius: 0.5rem; /* 8px */
    width: 100%;
}

.custom-audio-player .waveform-container {
    flex-grow: 1;
    height: 3rem; /* 48px */
    background-color: #E5E7EB; /* Gray-200 */
    border-radius: 0.375rem; /* 6px */
    cursor: pointer;
}

/* Specific styling for the 'Analyze' / 'Submit Recording' button */
.analyze-submit-btn {
    padding: 0.75rem 1.5rem; /* 12px 24px */
    font-size: 1rem; /* text-base */
    font-weight: 500;
    color: white;
    background-color: #4F46E5; /* Indigo-600 */
    border: 1px solid transparent;
    border-radius: 0.75rem; /* 12px */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.analyze-submit-btn:hover {
    background-color: #4338CA; /* Indigo-700 */
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

.analyze-submit-btn:disabled {
    background-color: #9CA3AF; /* Gray-400 */
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Live Waveform Canvas */
.live-waveform-canvas {
    width: 100%;
    height: 3.5rem; /* 56px */
    background-color: rgba(229, 231, 235, 0.5); /* Gray-200 with opacity */
    border-radius: 0.5rem;
    box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}


/* Keyframe Animations */
@keyframes pulse-animation {
  0% {
    box-shadow: 0 0 0 0px rgba(239, 68, 68, 0.3); /* Red-500 with alpha */
  }
  100% {
    box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
  }
}

/* Background Balls (for home page) */
.ball {
    position: absolute;
    width: 30vmin;
    height: 30vmin;
    border-radius: 50%;
    backface-visibility: hidden;
    animation: move linear infinite;
    z-index: -1;
    filter: blur(50px); /* Increased blur for a softer look */
}

.ball:nth-child(odd) {
  color: rgba(129, 140, 248, 0.4); /* Indigo-300 */
}

.ball:nth-child(even) {
    color: rgba(99, 102, 241, 0.4); /* Indigo-500 */
}

/* Adjusted ball positions for more spread out effect */
.ball:nth-child(1) {
    top: 70%;
    left: 85%;
    animation-duration: 40s;
    animation-delay: -3s;
    transform-origin: 16vw -2vh;
    box-shadow: 40vmin 0 5vmin currentColor;
}
.ball:nth-child(2) {
    top: 30%;
    left: 5%;
    animation-duration: 53s;
    animation-delay: -29s;
    transform-origin: -19vw 21vh;
    box-shadow: -40vmin 0 5vmin currentColor;
}
.ball:nth-child(3) {
    top: 15%;
    left: 20%;
    animation-duration: 49s;
    animation-delay: -8s;
    transform-origin: -22vw 3vh;
    box-shadow: 40vmin 0 5vmin currentColor;
}
.ball:nth-child(4) {
    top: 60%;
    left: 70%;
    animation-duration: 26s;
    animation-delay: -21s;
    transform-origin: -17vw -6vh;
    box-shadow: 40vmin 0 5vmin currentColor;
}
.ball:nth-child(5) {
    top: 50%;
    left: 10%;
    animation-duration: 36s;
    animation-delay: -40s;
    transform-origin: 4vw 0vh;
    box-shadow: -40vmin 0 5vmin currentColor;
}
.ball:nth-child(6) {
    top: 80%;
    left: 25%;
    animation-duration: 31s;
    animation-delay: -10s;
    transform-origin: 18vw 4vh;
    box-shadow: 40vmin 0 5vmin currentColor;
}
.ball:nth-child(7) {
    top: 5%;
    left: 75%;
    animation-duration: 55s;
    animation-delay: -6s;
    transform-origin: 1vw -23vh;
    box-shadow: -40vmin 0 5vmin currentColor;
}
.ball:nth-child(8) {
    top: 40%;
    left: 50%;
    animation-duration: 43s;
    animation-delay: -28s;
    transform-origin: 25vw -3vh;
    box-shadow: 40vmin 0 5vmin currentColor;
}
.ball:nth-child(9) {
    top: 20%;
    left: 80%;
    animation-duration: 49s;
    animation-delay: -8s;
    transform-origin: -22vw 3vh;
    box-shadow: 40vmin 0 5vmin currentColor;
}

@keyframes move {
    100% {
        transform: translate3d(0, 0, 1px) rotate(360deg);
    }
}

/* Background Cubes (for no_sentences page) */
.cube {
  position: absolute;
  width: 0.8rem;
  height: 0.8rem;
  border-width: 0.1rem;
  transform-origin: top left;
  transform: scale(0) rotate(0deg) translate(-50%, -50%);
  animation: cube 12s ease-in forwards infinite;
  opacity: 1;
  z-index: -1;
}

.cube:nth-child(odd) {
  border-color: #6366F1; /* Indigo-500 */
}

.cube:nth-child(even) {
  border-color: #818CF8; /* Indigo-300 */
}

/* Adjusted cube positions and animation delays */
.cube:nth-child(1) { top: 20%; left: 30%; animation-delay: 0s; }
.cube:nth-child(2) { top: 40%; left: 15%; animation-delay: 1.5s; }
.cube:nth-child(3) { top: 50%; left: 75%; animation-delay: 3s; }
.cube:nth-child(4) { top: 20%; left: 90%; animation-delay: 4.5s; }
.cube:nth-child(5) { top: 90%; left: 10%; animation-delay: 6s; }
.cube:nth-child(6) { top: 70%; left: 60%; animation-delay: 7.5s; } /* Added a 6th cube */

@keyframes cube {
  from {
    transform: scale(0.5) rotate(0deg) translate(-50%, -50%);
    opacity: 1;
  }
  to {
    transform: scale(10) rotate(960deg) translate(-50%, -50%);
    opacity: 0;
  }
}

/* Animated Border Button (if needed for future use - currently unused) */
.animate-border-btn {
  position: relative;
  color: #1670f0;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.3125rem;
  box-shadow: 0 0.625rem 1.875rem rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transition: color 0.3s ease, transform 0.1s ease;
}

.animate-border-btn:hover {
  color: #1364d6;
  transform: scale(0.99);
}

.animate-border-btn::before
{
  content:"";
  position:absolute;
  top:2px;
  left:2px;
  bottom:2px;
  width:50%;
  background:rgba(255,255,255,0.05);
}

.animate-border-btn span:nth-child(1)
{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:2px;
  background:linear-gradient(to right, #0c002b ,#4F46E5); /* Adjusted gradient */
  animation: animate1 2s linear infinite;
  animation-delay:1s;
}

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

.animate-border-btn span:nth-child(2)
{
  position:absolute;
  top:0;
  right:0;
  width:2px;
  height:100%;
  background:linear-gradient(to bottom, #0c002b ,#4F46E5); /* Adjusted gradient */
  animation: animate2 2s linear infinite;
  animation-delay:2s;
}

@keyframes animate2
{
  0%
  {
    transform:translateY(-100%);
}
  100%
  {
    transform:translateY(100%);
  }
}

.animate-border-btn span:nth-child(3)
{
  position:absolute;
  bottom:0;
  left:0;
  width:100%;
  height:2px;
  background:linear-gradient(to left, #0c002b ,#4F46E5); /* Adjusted gradient */
  animation: animate3 2s linear infinite;
  animation-delay:1s;

}

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

.animate-border-btn span:nth-child(4)
{
  position:absolute;
  top:0;
  left:0;
  width:2px;
  height:100%;
  background:linear-gradient(to top, #0c002b ,#4F46E5); /* Adjusted gradient */
   animation: animate4 2s linear infinite;
  animation-delay:2s;

}

@keyframes animate4
{
  0%
  {
    transform:translateY(100%);
}
  100%
  {
    transform:translateY(-100%);
  }
}

/* Root CSS Variables for Consistent Colors */
:root {
  --purple: #8B5CF6; /* Violet-500 */
  --blue: #4F46E5; /* Indigo-600 */
  --ltblue: #6366F1; /* Indigo-500 */
  --magenta: #EC4899; /* Pink-500 */
}

/* Practice Home Background Elements (for articulate_now/practice_home) */
.practice-home {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  position: relative;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* Ensure elements don't overflow */
}

.practice-home::before,
.practice-home::after {
  content: "";
  display: block;
  position: absolute;
  pointer-events: none;
  z-index: -1;
  filter: blur(80px); /* Increased blur */
}

.practice-home::before {
  right: -10%; /* Slightly adjust position */
  top: -10%;
  height: 28rem;
  width: 28rem;
  border-radius: 28rem;
  background: #60A5FA; /* Blue-400 */
  animation: heart-beat 7s ease-in-out infinite;
  opacity: 0.7; /* Slightly less opaque */
}

.practice-home::after {
  bottom: -10%; /* Adjust to bottom left */
  left: -10%;
  height: 12rem;
  width: 12rem;
  border-radius: 12rem;
  background: linear-gradient(var(--blue), var(--purple));
  animation: heart-beat-alt 5s ease-in-out infinite;
  opacity: 0.6; /* Slightly less opaque */
}

.main__text-wrapper {
  position: relative;
  padding: 2rem;
}

.main__text-wrapper::before,
.main__text-wrapper::after {
  content: "";
  display: block;
  position: absolute;
  pointer-events: none;
  z-index: -1;
  filter: blur(60px); /* Increased blur */
}

.main__text-wrapper::before {
  top: -3rem;
  right: -3rem;
  width: 10rem; /* Slightly larger */
  height: 10rem;
  opacity: 0.6;
  border-radius: 15rem;
  background: linear-gradient(var(--ltblue), var(--purple));
  animation: heart-beat-alt 3s ease-in-out infinite;
}

.main__text-wrapper::after {
  bottom: -5rem; /* Closer to the bottom */
  left: -5rem; /* Closer to the left */
  width: 18rem; /* Slightly larger */
  height: 18rem;
  border-radius: 25rem;
  background: linear-gradient(var(--magenta), var(--blue)); /* Changed gradient */
  animation: heart-beat-alt 5s ease-in-out infinite;
  opacity: 0.6;
}

/* Dotted Circle (for articulate_now/practice_home) */
.dotted-circle {
  position: absolute;
  top: 10%; /* Adjusted top position */
  right: 10%; /* Adjusted right position */
  opacity: 0.2; /* More subtle */
  animation: rotation 38s linear infinite;
  max-width: 25rem; /* Limit max size */
  max-height: 25rem; /* Limit max size */
}

@media (max-width: 48rem) {
  .practice-home::before {
    height: 20rem;
    width: 20rem;
    border-radius: 20rem;
  }

  .practice-home::after {
    height: 10rem;
    width: 10rem;
    border-radius: 10rem;
  }

  .main__text-wrapper::before {
    right: -1rem;
    width: 7rem;
    height: 7rem;
    border-radius: 10rem;
  }

  .main__text-wrapper::after {
    width: 15rem;
    height: 15rem;
    border-radius: 20rem;
  }

  .cube {
    width: 0.5rem; /* Slightly larger for mobile */
    height: 0.5rem;
    border-width: 0.08rem;
  }

  .dotted-circle {
    left: unset; /* Remove left override */
    right: 5%; /* Adjust right for mobile */
    top: 5%; /* Adjust top for mobile */
    width: 15rem;
    height: 15rem;
  }
}

@media (max-width: 40rem) {
  .practice-home::before {
    height: 16rem;
    width: 16rem;
    border-radius: 16rem;
    right: -15%;
    top: -15%;
  }

  .practice-home::after {
    height: 8rem;
    width: 8rem;
    border-radius: 8rem;
    bottom: -15%;
    left: -15%;
  }

  .main__text-wrapper::before {
    top: 0rem;
    right: -0.5rem;
    width: 5rem;
    height: 5rem;
  }

  .main__text-wrapper::after {
    width: 12rem;
    height: 12rem;
    border-radius: 18rem;
    bottom: -8rem;
    left: -8rem;
  }

  .cube {
    width: 0.4rem;
    height: 0.4rem;
    border-width: 0.06rem;
  }

  .dotted-circle {
    width: 12rem;
    height: 12rem;
    top: 0;
    right: 0;
  }
}


/* Arrow Background Elements (for articulate_now/practice_home & word_list) */
.arrow {
  opacity: 0.3; /* More subtle */
  position: absolute;
}

.arrow--top {
  top: -2rem; /* Adjusted top position */
  left: -2rem; /* Adjusted left position */
  width: 200px; /* Constrain size */
  height: 400px; /* Constrain size */
}

@media (max-width: 768px) {
  .arrow--top {
    width: 150px;
    height: 300px;
    top: -1rem;
    left: -1rem;
  }
}

@media (max-width: 640px) {
  .arrow--top {
    width: 100px;
    height: 200px;
    top: -0.5rem;
    left: -0.5rem;
  }
}

.circle {
  transform: translate(50%, -50%) rotate(0deg);
  transform-origin: center;
}

.circle--ltblue {
  height: 20rem;
  width: 20rem;
  border-radius: 20rem;
  background: linear-gradient(var(--ltblue), var(--blue));
}

.draw-in {
  stroke-dasharray: 1000;
  stroke-dashoffset: 10;
  animation: draw 15s ease-in-out alternate infinite;
}

@keyframes draw {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.item-to {
  animation-duration: 10s;
  animation-iteration-count: infinite;
  transform-origin: bottom;
}

/* Bounce animations remain the same */
.bounce-1 { animation-name: bounce-1; animation-timing-function: ease; }
.bounce-2 { animation-name: bounce-2; animation-timing-function: ease; }
.bounce-3 { animation-name: bounce-3; animation-timing-function: ease; }

@keyframes bounce-1 {
  0% { transform: translateY(0); }
  50% { transform: translateY(3.125rem); }
  100% { transform: translateY(0); }
}

@keyframes bounce-2 {
  0% { transform: translateY(0); }
  50% { transform: translateY(-1.875rem); }
  100% { transform: translateY(0); }
}

@keyframes bounce-3 {
  0% { transform: translateY(0); }
  50% { transform: translateY(1.875rem); }
  100% { transform: translateY(0); }
}

/* General Animations */
@keyframes rotation {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes heart-beat {
  0%, 100% { transform: scale(0.98); }
  50% { transform: scale(1.04); }
}

@keyframes heart-beat-alt {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoom-in {
  from { transform: scale(0.9); opacity: 0; } /* Start slightly smaller and transparent */
  to { transform: scale(1); opacity: 1; }
}

@keyframes zoom-fade-in {
  from { opacity: 0; transform: scale(0.8); } /* Start smaller and transparent */
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-in { animation: fade-in 0.6s ease-out forwards; } /* Slower fade-in */
.animate-zoom-in { animation: zoom-in 0.5s ease-out forwards; } /* Slower zoom-in */
.animate-zoom-fade-in { animation: zoom-fade-in 0.6s ease-out forwards; } /* Slower zoom-fade-in */


/* Specific styles for flashcard_detail.html for transitions */
.sentence-wrapper {
    position: relative;
    overflow: hidden; /* Hide overflowing text during transition */
}

#sentence-text {
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; /* Smoother transition duration */
}

.sentence-wrapper.is-changing #sentence-text {
    opacity: 0;
    transform: translateY(20px); /* Move further down for effect */
}

/* Adding directional transitions for a more natural feel */
.sentence-wrapper.is-changing.from-right #sentence-text {
    transform: translateX(-20px); /* Slide out from left when coming from right */
}

.sentence-wrapper.is-changing.from-left #sentence-text {
    transform: translateX(20px); /* Slide out from right when coming from left */
}

/* Text slide-in animation */
.sentence-wrapper:not(.is-changing) #sentence-text {
    transform: translateY(0); /* Reset transform */
    opacity: 1; /* Ensure full opacity */
    transition: transform 0.4s ease-out, opacity 0.4s ease-out; /* Longer and ease-out for entrance */
}

.sentence-wrapper:not(.is-changing).from-right #sentence-text {
    transform: translateX(0);
}

.sentence-wrapper:not(.is-changing).from-left #sentence-text {
    transform: translateX(0);
}


body.is-loading {
    cursor: wait !important;
    pointer-events: none !important;
}

body.is-loading #nprogress .spinner {
    display: block !important;
}

/* Filter buttons in speech tuner sidebar */
.filter-btn {
    @apply px-3 py-1.5 text-sm font-medium rounded-lg text-center transition-colors text-gray-600 hover:text-indigo-600; /* Subtle hover color */
}

.filter-btn.active {
    @apply bg-indigo-50 text-indigo-700 shadow-sm font-semibold; /* Active state using indigo */
}

/* Glowing border for recorded sentences */
@keyframes border-glow {
    0%, 100% {
        border-color: rgba(99, 102, 241, 0.4); /* Indigo-500 */
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.3); /* Softer, indigo glow */
    }
    50% {
        border-color: rgba(129, 140, 248, 0.6); /* Indigo-300 */
        box-shadow: 0 0 25px rgba(129, 140, 248, 0.4);
    }
}

.glowing-border {
    animation: border-glow 3s ease-in-out infinite alternate; /* Shorter animation, alternate direction */
    border-color: rgba(99, 102, 241, 0.5) !important;
}

/* Audio Player Placeholder (for partials) */
.audio-player-placeholder {
    width: 2.5rem; /* Make it small and discreet, 40px */
    height: 2.5rem; /* 40px */
    background-color: #E5E7EB; /* Gray-200 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.audio-player-placeholder::before {
    content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%236B7280"><path d="M8 5v14l11-7z"/></svg>'); /* Gray-500 */
    display: block;
    width: 1.25rem; /* 20px */
    height: 1.25rem; /* 20px */
}

.audio-player-placeholder:hover {
    background-color: #D1D5DB; /* Gray-300 */
}

/* Phoneme Comparison Cards */
.phoneme-card {
    border: 1px solid rgba(229, 231, 235, 0.8); /* Gray-200 with opacity */
    transition: all 0.2s ease;
}

.phoneme-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}