/* Base Styles */
:root {
  --primary-color: #4361ee;
  --primary-light: #4895ef;
  --secondary-color: #3f37c9;
  --accent-color: #4cc9f0;
  --dark-color: #1a1a2e;
  --light-color: #f8f9fa;
  --success-color: #4caf50;
  --error-color: #f44336;
  --warning-color: #ff9800;
  --info-color: #2196f3;
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.18);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: var(--light-color);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background Animation */
.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.15;
}

.shape-1 {
  width: 600px;
  height: 600px;
  background: var(--primary-color);
  top: -10%;
  left: -10%;
  animation: float 15s infinite ease-in-out;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-color);
  bottom: -10%;
  right: -10%;
  animation: float 12s infinite ease-in-out reverse;
}

.shape-3 {
  width: 300px;
  height: 300px;
  background: var(--secondary-color);
  top: 30%;
  right: 20%;
  animation: float 10s infinite ease-in-out;
}

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

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(26, 26, 46, 0.7);
  border-bottom: 1px solid var(--glass-border);
}
.header.hide-on-scroll {
  transform: translateY(-100%);
  transition: transform 0.3s ease-in-out;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

.logo i {
  color: var(--accent-color);
  font-size: 1.4rem;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  color: white;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: var(--transition);
}

.nav-link:hover::after {
  width: 100%;
}

/* Main Content */
.main {
  padding: 8rem 0 3rem;
}

.hero {
  text-align: center;
  margin-bottom: 3rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.gradient-text {
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Glass Card Styles */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  transition: var(--transition);
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* App Container */
.app-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  margin-top: 2rem;
}

.main-card {
  grid-column: 1;
}

.side-panel {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Controls Section */
.controls-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1.5rem;
}

.language-selector {
  flex: 1;
}

.label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.label i {
  margin-right: 0.5rem;
  color: var(--accent-color);
}

.select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}

.select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(76, 201, 240, 0.2);
}

.mic-controls {
  display: flex;
  gap: 1rem;
}

.mic-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: var(--primary-color);
  color: white;
}

.mic-btn:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

.mic-btn:active {
  transform: translateY(0);
}

.mic-btn.recording {
  animation: pulse 1.5s infinite;
}

.mic-btn.stop-btn {
  background: var(--error-color);
}

.mic-btn.stop-btn:hover {
  background: #e53935;
}

.mic-btn i {
  font-size: 1rem;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(67, 97, 238, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(67, 97, 238, 0);
  }
}

/* Status Section */
.status-section {
  margin-bottom: 1.5rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.1);
}

.status i {
  font-size: 1rem;
}

.confidence {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.confidence-label {
  color: rgba(255, 255, 255, 0.8);
}

.confidence-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  width: 0%;
  transition: width 0.3s ease;
}

.confidence-value {
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

/* Transcript Section */
.transcript-section {
  margin-top: 1.5rem;
}

.transcript-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.transcript-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

.transcript-header i {
  color: var(--accent-color);
}

.transcript-actions {
  display: flex;
  gap: 0.75rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.action-btn i {
  font-size: 0.8rem;
}

.transcript-area {
  height: 300px;
  overflow-y: auto;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.transcript-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.transcript-placeholder i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.3);
}

.placeholder-sub {
  font-size: 0.9rem;
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.4);
}

.transcript-text {
  white-space: pre-wrap;
  line-height: 1.7;
}

.interim-result {
  padding: 0.5rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
  border-top: 1px solid var(--glass-border);
}

/* Side Panel Cards */
.stats-card h3,
.features-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

.stats-card h3 i {
  color: var(--primary-light);
}

.features-card h3 i {
  color: var(--accent-color);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.stat-label {
  color: rgba(255, 255, 255, 0.8);
}

.stat-value {
  font-weight: 600;
}

.features-list {
  list-style: none;
}

.features-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.features-list i {
  color: var(--success-color);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

/* Notification */
.notification {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.notification.show {
  bottom: 30px;
  opacity: 1;
}

.notification.success {
  background: var(--success-color);
  color: white;
}

.notification.error {
  background: var(--error-color);
  color: white;
}

.notification.info {
  background: var(--info-color);
  color: white;
}

.notification-icon {
  font-size: 1.2rem;
}

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

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  
  .side-panel {
    grid-column: 1;
    grid-row: 2;
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .stats-card,
  .features-card {
    flex: 1;
    min-width: 250px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .controls-section {
    flex-direction: column;
    align-items: stretch;
  }
  
  .mic-controls {
    justify-content: center;
  }
  
  .side-panel {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .header .container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav {
    gap: 1rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .transcript-actions {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .notification {
    width: 90%;
    text-align: center;
  }
}