/* Smooth scroll padding for fixed navbar */
html {
  scroll-padding-top: 68px;
}

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

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

/* Dancing gradient balls */
@keyframes dance1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(100px, -50px) scale(1.1); }
  50% { transform: translate(-50px, -100px) scale(0.9); }
  75% { transform: translate(-100px, 50px) scale(1.05); }
}

@keyframes dance2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-80px, 60px) scale(0.95); }
  50% { transform: translate(120px, -30px) scale(1.1); }
  75% { transform: translate(60px, 80px) scale(1); }
}

@keyframes dance3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(70px, 70px) scale(1.05); }
  50% { transform: translate(-100px, 40px) scale(0.95); }
  75% { transform: translate(-30px, -80px) scale(1.1); }
}

.gradient-ball {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.7;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.ball-1 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  animation: dance1 20s infinite;
  top: 10%;
  left: 10%;
}

.ball-2 {
  width: 250px;
  height: 250px;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  animation: dance2 18s infinite;
  bottom: 20%;
  right: 15%;
}

.ball-3 {
  width: 350px;
  height: 350px;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  animation: dance3 22s infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Dark mode gradient balls */
.dark .ball-1 {
  background: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%);
  opacity: 0.5;
}

.dark .ball-2 {
  background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
  opacity: 0.5;
}

.dark .ball-3 {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  opacity: 0.5;
}

/* Mobile adjustments for gradient balls */
@media (max-width: 768px) {
  .ball-1 {
    width: 150px;
    height: 150px;
  }
  
  .ball-2 {
    width: 120px;
    height: 120px;
  }
  
  .ball-3 {
    width: 180px;
    height: 180px;
  }
  
  .gradient-ball {
    filter: blur(30px);
  }
}

/* Glass morphism effect */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Dark mode glass */
.dark .glass {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Theme toggle spin animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spin-back {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

.theme-toggle-btn {
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn img {
    transition: transform 0.5s ease;
}

.theme-toggle-btn:hover img {
    transform: rotate(360deg);
}

.theme-toggle-btn:not(:hover) img {
    transform: rotate(0deg);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.dark ::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.dark ::-webkit-scrollbar-thumb {
  background: #666;
}

/* Tom Select custom styling */
.voice-select-wrapper {
  position: relative;
}

.voice-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 18px;
  line-height: 1;
  color: #6b7280;
  background: none;
  border: none;
  z-index: 10;
  display: none;
}

.voice-clear-btn:hover {
  color: #374151;
}

.dark .voice-clear-btn {
  color: #9ca3af;
}

.dark .voice-clear-btn:hover {
  color: #e5e7eb;
}

.voice-select-wrapper.has-value .voice-clear-btn {
  display: block;
}

.voice-select-wrapper.has-value .ts-control {
  padding-right: 40px !important;
}

/* Sound wave animation */
.sound-wave {
  height: 20px;
  animation: wave 1.5s ease-in-out infinite;
  border-radius: 2px;
}

@keyframes wave {
  0%, 100% { height: 8px; }
  50% { height: 24px; }
}

@media (min-width: 768px) {
  .sound-wave {
    height: 24px;
  }
  
  @keyframes wave {
    0%, 100% { height: 12px; }
    50% { height: 32px; }
  }
}

/* Speaking Animation */
.speaking-animation {
  position: relative;
  width: 300px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* Center source point */
.center-source {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #4285f4;
  border-radius: 50%;
  z-index: 10;
  animation: source-pulse 1.5s ease-in-out infinite, google-colors 6s steps(1, end) infinite;
  box-shadow: 0 0 20px rgba(66, 133, 244, 0.5);
}

/* Dark theme - same Google colors animation */
.dark .center-source {
  background: #4285f4;
  animation: source-pulse 1.5s ease-in-out infinite, google-colors-dark 6s steps(1, end) infinite;
  box-shadow: 0 0 20px rgba(66, 133, 244, 0.5);
}

@keyframes source-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 1;
  }
}

/* Right-facing arc waves */
.waves-right {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateY(-50%);
  width: 150px;
  height: 100px;
}

.wave-arc-right {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 60px;
  border-right: 3px solid #dc2626;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-radius: 0 100% 100% 0;
  animation: wave-expand-right 1.5s ease-out infinite;
  opacity: 0;
}

/* Dark theme - green arc waves */
.dark .wave-arc-right {
  border-right: 3px solid #00ff88;
}

/* Left-facing arc waves */
.waves-left {
  position: absolute;
  right: 50%;
  top: 50%;
  transform: translateY(-50%);
  width: 150px;
  height: 100px;
}

.wave-arc-left {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 60px;
  border-left: 3px solid #dc2626;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-radius: 100% 0 0 100%;
  animation: wave-expand-left 1.5s ease-out infinite;
  opacity: 0;
}

/* Dark theme - green arc waves */
.dark .wave-arc-left {
  border-left: 3px solid #00ff88;
}

/* Different sizes for wave variation */
.wave-arc-right:nth-child(1), .wave-arc-left:nth-child(1) {
  width: 25px;
  height: 40px;
  animation-delay: 0s;
}

.wave-arc-right:nth-child(2), .wave-arc-left:nth-child(2) {
  width: 40px;
  height: 55px;
  animation-delay: 0.3s;
}

.wave-arc-right:nth-child(3), .wave-arc-left:nth-child(3) {
  width: 55px;
  height: 70px;
  animation-delay: 0.6s;
}

.wave-arc-right:nth-child(4), .wave-arc-left:nth-child(4) {
  width: 70px;
  height: 85px;
  animation-delay: 0.9s;
}

.wave-arc-right:nth-child(5), .wave-arc-left:nth-child(5) {
  width: 85px;
  height: 100px;
  animation-delay: 1.2s;
}

/* Animations */
@keyframes wave-expand-right {
  0% {
    transform: translateY(-50%) translateX(0) scaleX(0.3);
    opacity: 1;
    filter: blur(0px);
  }
  70% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-50%) translateX(30px) scaleX(1);
    opacity: 0;
    filter: blur(2px);
  }
}

@keyframes wave-expand-left {
  0% {
    transform: translateY(-50%) translateX(0) scaleX(0.3);
    opacity: 1;
    filter: blur(0px);
  }
  70% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-50%) translateX(-30px) scaleX(1);
    opacity: 0;
    filter: blur(2px);
  }
}

/* Google Colors Animation - changes every 1.5s when wave completes */
@keyframes google-colors {
  0%, 24.99% { 
    background: #4285f4; /* Google Blue */
    box-shadow: 0 0 20px rgba(66, 133, 244, 0.5);
  }
  25%, 49.99% { 
    background: #ea4335; /* Google Red */
    box-shadow: 0 0 20px rgba(234, 67, 53, 0.5);
  }
  50%, 74.99% { 
    background: #fbbc05; /* Google Yellow */
    box-shadow: 0 0 20px rgba(251, 188, 5, 0.5);
  }
  75%, 99.99% { 
    background: #34a853; /* Google Green */
    box-shadow: 0 0 20px rgba(52, 168, 83, 0.5);
  }
  100% { 
    background: #4285f4; /* Google Blue */
    box-shadow: 0 0 20px rgba(66, 133, 244, 0.5);
  }
}

@keyframes google-colors-dark {
  0%, 24.99% { 
    background: #4285f4; /* Google Blue */
    box-shadow: 0 0 20px rgba(66, 133, 244, 0.5);
  }
  25%, 49.99% { 
    background: #ea4335; /* Google Red */
    box-shadow: 0 0 20px rgba(234, 67, 53, 0.5);
  }
  50%, 74.99% { 
    background: #fbbc05; /* Google Yellow */
    box-shadow: 0 0 20px rgba(251, 188, 5, 0.5);
  }
  75%, 99.99% { 
    background: #34a853; /* Google Green */
    box-shadow: 0 0 20px rgba(52, 168, 83, 0.5);
  }
  100% { 
    background: #4285f4; /* Google Blue */
    box-shadow: 0 0 20px rgba(66, 133, 244, 0.5);
  }
}

/* Support card flex layout for aligned buttons */
.support-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.support-card .text-center {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.support-card .support-button {
  margin-top: auto;
}