/* Modern Professional UI Styling for LipReader AI */
:root {
  --primary-color: #4a6cf7;
  --primary-dark: #3a56d4;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --body-bg: #f5f8ff;
  --card-bg: #ffffff;
  --text-color: #333333;
  --text-muted: #6c757d;
  --border-color: #e9ecef;
  --border-radius: 10px;
  --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
  --premium-color: #ffd700;
  --premium-gradient: linear-gradient(135deg, #ffd700, #ffb700);
}

.dark-mode {
  --primary-color: #5d7bf9;
  --primary-dark: #4a6cf7;
  --body-bg: #1a1f25;
  --card-bg: #2a2f35;
  --text-color: #f0f0f0;
  --text-muted: #adb5bd;
  --border-color: #444;
  --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: var(--transition);
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--body-bg);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Styling */
header {
  background-color: var(--card-bg);
  padding: 1rem 2rem;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  animation: fadeInDown 0.8s ease-out;
}

.logo-icon {
  font-size: 2rem;
  color: var(--primary-color);
  animation: pulse 2s infinite;
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  animation: fadeInDown 0.8s ease-out;
}

.language-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.language-selector label {
  font-weight: 500;
}

.language-selector select {
  padding: 0.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  color: var(--text-color);
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-color);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.theme-toggle:hover {
  background-color: var(--border-color);
  transform: rotate(15deg);
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  flex: 1;
  animation: fadeIn 0.8s ease-out;
}

/* Upload Container */
.upload-container {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--box-shadow);
  animation: slideInUp 0.8s ease-out;
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  text-align: center;
  transition: var(--transition);
}

.upload-content:hover {
  border-color: var(--primary-color);
}

.upload-content i {
  font-size: 3.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  animation: bounce 2s infinite;
}

.hidden {
  display: none;
}

.btn-upload {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: var(--transition);
}

.btn-upload:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.upload-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Video Preview */
.video-preview-container {
  margin: 1.5rem 0;
  animation: fadeIn 0.8s ease-out;
}

.video-preview {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  background-color: #000;
  max-height: 500px;
}

.video-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.playback-speed {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.playback-speed label {
  font-weight: 500;
}

.playback-speed select {
  padding: 0.5rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  color: var(--text-color);
  font-family: 'Poppins', sans-serif;
}

/* Analysis Options */
.analysis-options {
  display: flex;
  gap: 1.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.analysis-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.analysis-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

.flex {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.justify-center {
  justify-content: center;
  align-items: center;
}

/* Buttons */
.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.8rem 1.8rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled {
  background-color: var(--secondary-color);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background-color: #5a6268;
  transform: translateY(-2px);
}

.btn-premium {
  background: var(--premium-gradient);
  color: #333;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-premium:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

/* Processing Container */
.processing-container {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--box-shadow);
  text-align: center;
  animation: fadeIn 0.8s ease-out;
}

.progress-bar {
  height: 10px;
  background-color: var(--border-color);
  border-radius: 5px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 5px;
  transition: width 0.3s ease;
}

.processing-text {
  color: var(--text-color);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.processing-text i {
  color: var(--primary-color);
}

/* Result Container */
.result-container {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--box-shadow);
  animation: fadeIn 0.8s ease-out;
}

.result-title {
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-weight: 600;
}

.transcription-box {
  background-color: rgba(0, 0, 0, 0.03);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primary-color);
}

.transcription-box p {
  line-height: 1.8;
}

.confidence-score {
  margin-top: 1.5rem;
}

.confidence-meter {
  height: 8px;
  background-color: var(--border-color);
  border-radius: 4px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background-color: var(--success-color);
  border-radius: 4px;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Features Section */
.features-section {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--box-shadow);
  animation: slideInUp 1s ease-out;
}

.features-section h3 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--primary-color);
  font-weight: 600;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow);
  border-color: var(--primary-color);
}

.feature-card i {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.feature-card h4 {
  margin-bottom: 0.8rem;
  font-weight: 600;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Premium Section */
.premium-section {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 183, 0, 0.1));
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--box-shadow);
  border: 1px solid rgba(255, 215, 0, 0.3);
  animation: slideInUp 1.2s ease-out;
}

.premium-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.premium-icon {
  font-size: 2rem;
  color: var(--premium-color);
  animation: pulse 2s infinite;
}

.premium-header h3 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(to right, #ffd700, #ffb700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.premium-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.premium-feature {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: var(--border-radius);
}

.premium-feature i {
  color: var(--premium-color);
  font-size: 1.2rem;
}

.premium-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.plan-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--box-shadow);
  position: relative;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.plan-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.plan-card.popular {
  border: 2px solid var(--premium-color);
  transform: scale(1.05);
}

.plan-card.popular:hover {
  transform: scale(1.05) translateY(-10px);
}

.popular-tag {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--premium-gradient);
  color: #333;
  padding: 0.3rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
}

.plan-card h4 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.plan-price {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.plan-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.savings {
  display: inline-block;
  background-color: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.team-info {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.premium-footer {
  text-align: center;
  margin-top: 1rem;
}

.premium-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  display: block;
  margin: 0.8rem 0;
}

.premium-link:hover {
  text-decoration: underline;
}

.premium-contact {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Premium Modal */
.premium-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.premium-modal-content {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: zoomIn 0.3s ease-out;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  color: var(--primary-color);
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 1.5rem;
}

.activation-input {
  width: 100%;
  padding: 0.8rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  margin: 1rem 0;
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
}

.contact-info {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact-info a {
  color: var(--primary-color);
  text-decoration: none;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Footer */
footer {
  background-color: var(--card-bg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.05);
}

footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Welcome Animation */
.welcome-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: welcomeFadeOut 2s ease-out forwards;
  animation-delay: 2s;
}

.welcome-content {
  text-align: center;
  color: white;
  animation: welcomePulse 2s ease-out;
}

.welcome-logo {
  font-size: 5rem;
  margin-bottom: 1rem;
  animation: welcomeSpin 2s ease-out;
}

.welcome-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.welcome-subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
}

@keyframes welcomeFadeOut {
  from {
    opacity: 1;
    visibility: visible;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes welcomePulse {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes welcomeSpin {
  0% {
    transform: rotate(0deg) scale(0.8);
    opacity: 0;
  }
  100% {
    transform: rotate(360deg) scale(1);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  header {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
  }
  
  .header-controls {
    width: 100%;
    justify-content: space-between;
  }
  
  .container {
    padding: 1rem;
  }
  
  .features-grid,
  .premium-features,
  .premium-plans {
    grid-template-columns: 1fr;
  }
  
  .plan-card.popular {
    transform: scale(1);
  }
  
  .plan-card.popular:hover {
    transform: translateY(-10px);
  }
  
  .action-buttons {
    justify-content: center;
  }
}

/* Accessibility Improvements */
:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

.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;
}

/* Tooltip Styles */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]:before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1rem;
  background-color: var(--dark-color);
  color: white;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

[data-tooltip]:hover:before {
  opacity: 1;
  visibility: visible;
  bottom: calc(100% + 10px);
}