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

:root {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-light: #a78bfa;
  --secondary: #f3f4f6;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --success: #10b981;
  --error: #ef4444;
  --bg: #f9fafb;
}

html {
  background-color: var(--bg);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  color: var(--text-primary);
  background-color: var(--bg);
  line-height: 1.6;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  gap: 8px;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  background-color: white;
  padding: 8px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile: Position switcher at top center */
@media (max-width: 640px) {
  .lang-switcher {
    position: static;
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--border);
  }
}

.lang-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background-color: white;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.lang-btn:hover {
  background-color: var(--secondary);
}

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

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

/* Header */
.header {
  text-align: center;
  margin-bottom: 48px;
}

.header h1 {
  font-size: 40px;
  font-weight: bold;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header p {
  font-size: 18px;
  color: var(--text-secondary);
}

/* Card */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 32px;
}

/* Tabs */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
  background-color: var(--secondary);
}

.tab-button {
  padding: 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
}

.tab-button:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.tab-button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Section */
.section {
  padding: 32px;
}

.section h2 {
  font-size: 24px;
  margin-bottom: 24px;
  color: var(--text-primary);
}

/* Form Group */
.form-group {
  margin-bottom: 24px;
}

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

.form-group textarea,
.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.2s;
}

.form-group textarea:focus,
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-group textarea {
  min-height: 150px;
  font-family: 'Courier New', monospace;
}

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

.expiration-input {
  display: flex;
  align-items: center;
  gap: 12px;
}

.expiration-input-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.expiration-input input {
  flex: 0 0 70px;
  width: 70px;
  padding: 8px 10px;
  font-size: 14px;
}

.expiration-unit {
  font-size: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.expiration-info {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  background-color: var(--bg-secondary);
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  margin-left: auto;
}

/* Button */
.btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

.btn-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  background-color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-copy {
  padding: 8px 12px;
  background-color: var(--secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

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

/* Result */
.share-result,
.receive-result {
  margin-top: 24px;
  animation: slideIn 0.3s ease;
}

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

.result-box {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(167, 139, 250, 0.05));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.result-box h3 {
  margin-bottom: 16px;
  color: var(--primary);
  font-size: 18px;
}

.result-item {
  margin-bottom: 16px;
}

.result-item label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.code-display,
.url-display {
  display: flex;
  gap: 8px;
  align-items: center;
}

.code {
  flex: 1;
  padding: 10px 12px;
  background-color: white;
  border: 2px solid var(--primary);
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
  text-align: center;
  letter-spacing: 2px;
}

.url-display input {
  flex: 1;
  padding: 10px 12px;
  background-color: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.qr-display {
  display: flex;
  justify-content: center;
  padding: 12px;
  background-color: white;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.qr-display canvas {
  width: 90px;
  height: 90px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: white;
}

.qr-display img {
  width: 90px;
  height: 90px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: white;
}

.info-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 12px;
  text-align: center;
  font-style: italic;
}

.text-display-wrapper {
  position: relative;
  margin-top: 12px;
}

.text-display-wrapper textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  resize: vertical;
  min-height: 150px;
  background-color: white;
}

.text-display-wrapper .btn-copy {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* Error Message */
.error-message {
  margin-top: 16px;
  padding: 12px;
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: var(--error);
  font-size: 14px;
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.info-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  backdrop-filter: blur(10px);
}

.info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.info-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--primary);
}

.info-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.info-card p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .header h1 {
    font-size: 28px;
  }

  .header p {
    font-size: 14px;
  }

  .section {
    padding: 20px;
  }

  .section h2 {
    font-size: 18px;
    margin-bottom: 16px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .code-display {
    flex-direction: column;
  }

  .code-display .code {
    width: 100%;
  }

  .url-display {
    flex-direction: column;
    gap: 8px;
  }

  .url-display input {
    width: 100%;
    font-size: 11px;
  }

  .btn-copy {
    width: 100%;
  }

  .url-display .btn-copy {
    width: 100%;
  }

  .text-display-wrapper .btn-copy {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .expiration-input {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .expiration-input-wrapper {
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }

  .expiration-input input {
    width: 60px;
    flex: 0 0 60px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .expiration-unit {
    font-size: 13px;
  }

  .expiration-info {
    margin-left: auto;
    padding: 6px 8px;
    font-size: 12px;
    white-space: nowrap;
  }
}

/* Success Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px 16px;
  border-top: 1px solid var(--border);
  margin-top: 48px;
  background-color: var(--secondary);
}

.footer p {
  color: var(--text-secondary);
  font-size: 14px;
}

.success {
  animation: pulse 0.3s ease;
}
