/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #e91e63;
  --primary-dark: #c2185b;
  --primary-light: #f8bbd0;
  --secondary-color: #673ab7;
  --success-color: #4caf50;
  --error-color: #f44336;
  --warning-color: #ff9800;
  --text-primary: #212121;
  --text-secondary: #757575;
  --bg-color: #fafafa;
  --card-bg: #ffffff;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
}

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

/* Header */
header {
  text-align: center;
  color: white;
  padding: 40px 20px;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-logo {
  margin-bottom: 20px;
}

.logo {
  max-width: 300px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@media (max-width: 600px) {
  .logo {
    max-width: 200px;
  }
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-top: 10px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card h2, .card h3 {
  margin-bottom: 20px;
  color: var(--primary-color);
}

/* Profile Bar */
.profile-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
  gap: 15px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tier-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 600;
}

.tier-badge.tier-premium {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #333;
}

.credits-info {
  font-weight: 600;
  color: var(--primary-color);
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
}

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

textarea.form-control::placeholder {
  font-style: italic;
}

.char-count {
  text-align: right;
  margin-top: 5px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(233, 30, 99, 0.4);
}

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

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

.btn-large {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
}

.btn-text {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}

.btn-text:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}

/* Auth Card */
.auth-card {
  text-align: center;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 10px;
}

.auth-card p {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Auth Buttons */
.auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-icon {
  flex-shrink: 0;
}

.auth-btn:first-child {
  background: linear-gradient(135deg, #4285f4, #34a853);
}

.auth-btn:first-child:hover {
  box-shadow: 0 6px 16px rgba(66, 133, 244, 0.4);
}

.auth-btn:last-child {
  background: linear-gradient(135deg, #1877f2, #42a5f5);
}

.auth-btn:last-child:hover {
  box-shadow: 0 6px 16px rgba(24, 119, 242, 0.4);
}

/* Result Section */
.result-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-left: 4px solid var(--success-color);
}

.result-content {
  margin: 20px 0;
}

.result-label {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.result-label span {
  color: var(--primary-color);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.result-header h3 {
  margin: 0;
}

.result-input-summary {
  background: rgba(0, 0, 0, 0.03);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  font-size: 0.9rem;
}

.summary-item {
  display: flex;
  flex-direction: column;
}

.summary-item.full-width {
  grid-column: 1 / -1;
}

.summary-label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.input-text-summary {
  font-style: italic;
  color: #666;
}

.result-text {
  background: white;
  padding: 25px;
  border-radius: 8px;
  font-size: 1.05rem;
  line-height: 1.8;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.translation-section {
  margin-bottom: 25px;
}

.translation-section h4 {
  color: var(--primary-color);
  font-size: 1.1rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.translation-section p {
  margin: 0;
  line-height: 1.6;
}

.adjustment-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.adjustment-level {
  padding: 12px;
  background: rgba(0, 0, 0, 0.03);
  border-left: 3px solid var(--primary-color);
  border-radius: 4px;
}

.adjustment-level strong {
  color: var(--primary-color);
  margin-right: 8px;
}

.result-feedback {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.feedback-btn {
  background: transparent;
  border: 2px solid #ddd;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.2s;
}

.feedback-btn:hover:not(:disabled) {
  transform: scale(1.1);
  border-color: var(--primary-color);
}

.feedback-btn.selected {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.feedback-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Upgrade Card */
.upgrade-card {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  border: none;
}

.upgrade-card h3 {
  color: #333;
}

.upgrade-benefits ul {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.upgrade-benefits li {
  padding: 10px 0;
  padding-left: 30px;
  position: relative;
}

.upgrade-benefits li:before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success-color);
  font-weight: bold;
  font-size: 1.2rem;
}

/* Alerts */
.alert {
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
}

.alert-error {
  background: #ffebee;
  color: var(--error-color);
  border: 1px solid var(--error-color);
}

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

.loading-overlay p {
  color: white;
  margin-top: 20px;
  font-size: 1.1rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.hidden {
  display: none !important;
}

.section {
  min-height: 400px;
}

/* Alert Messages */
.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin: 20px 0;
  font-size: 0.95rem;
}

.alert-error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #dc2626;
}

/* Footer */
footer {
  text-align: center;
  color: white;
  padding: 40px 20px;
  opacity: 0.9;
}

footer p {
  margin: 5px 0;
}

.language-selector {
  margin-top: 15px;
}

.language-selector label {
  margin-right: 10px;
  color: white;
}

.language-selector select {
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
}

.language-selector select option {
  background: var(--secondary-color);
  color: white;
}

.clickable {
  cursor: pointer;
  transition: opacity 0.2s;
}

.clickable:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.reset-info {
  color: #666;
  font-size: 0.85rem;
  display: block;
  margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  .container {
    padding: 10px;
  }

  .card {
    padding: 20px;
  }

  .profile-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-meta {
    flex-direction: column;
    gap: 5px;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.5s ease;
}


