:root {
  --primary-color: #2563eb;
  --secondary-color: #10b981;
  --bg-color: #f9fafb;
  --card-bg: #ffffff;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --border-color: #e5e7eb;
  --error-color: #ef4444;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* Header */
header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.logo h2 {
  color: var(--primary-color);
  font-size: 1.5rem;
}

.lang-selector {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 0.95rem;
}

/* Main Content */
main {
  flex: 1;
  padding: 2rem 0;
}

.main-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  text-align: center;
}

.subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid var(--border-color);
}

.card h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.exercise-desc {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

/* Video */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Forms */
input[type="text"],
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 1rem;
  font-family: inherit;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-color);
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.btn-small:hover {
  background: var(--border-color);
}

/* Suggestions */
.suggestions {
  margin-bottom: 1rem;
}

.suggestions p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

/* Results */
.result {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-color);
  border-radius: 8px;
  border-left: 4px solid var(--secondary-color);
}

.result img {
  max-width: 100%;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.result p {
  line-height: 1.8;
  white-space: pre-wrap;
}

/* Info & Error Boxes */
.info-box,
.error-box {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.info-box {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #1e40af;
}

.error-box {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

/* Loading */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer */
footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-light);
  margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .main-title {
    font-size: 2rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  header .container {
    flex-direction: column;
    gap: 1rem;
  }
}
