/* ===========================================
   Menu Language Sync - UI Styles
   Clean, modern design for IdoSell App
   =========================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
}

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

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--gray-900);
}

.logo svg {
  color: var(--primary);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--gray-100);
  border-radius: 9999px;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-400);
}

.status-badge.connected .dot {
  background: var(--success);
}

.status-badge.error .dot {
  background: var(--error);
}

/* Main Content */
.main {
  flex: 1;
  padding: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.card h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-700);
}

.card h3 svg {
  color: var(--primary);
}

.subtitle {
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

input[type="text"],
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="text"]:disabled,
select:disabled {
  background: var(--gray-100);
  cursor: not-allowed;
}

.hint {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.375rem;
}

.help-text {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 1rem;
  text-align: center;
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}

.checkbox-item:hover {
  background: var(--gray-100);
}

.checkbox-item.selected {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--primary);
}

.checkbox-item input {
  accent-color: var(--primary);
}

.checkbox-item span {
  font-size: 0.875rem;
}

.empty-state {
  color: var(--gray-400);
  font-size: 0.875rem;
  font-style: italic;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
}

.btn-text {
  background: transparent;
  color: var(--gray-500);
  padding: 0.5rem;
}

.btn-text:hover:not(:disabled) {
  color: var(--gray-700);
}

.btn-large {
  width: 100%;
  padding: 1rem;
  font-size: 1.125rem;
}

.btn-large svg {
  width: 24px;
  height: 24px;
}

/* Auth Card */
.auth-card {
  text-align: center;
  max-width: 400px;
  margin: 2rem auto;
}

.auth-card .form-group {
  text-align: left;
}

.auth-card .btn {
  width: 100%;
  margin-top: 0.5rem;
}

/* Sync Card */
.sync-card {
  text-align: center;
}

.sync-info {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
}

.sync-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sync-stat .label {
  font-size: 0.75rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sync-stat .value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.sync-card .btn-secondary {
  width: 100%;
  margin-top: 0.75rem;
}

/* Results Card */
.results-card .results-content {
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.results-content.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.results-content.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.results-content ul {
  margin-top: 0.5rem;
  padding-left: 1.25rem;
}

/* Disconnect Section */
.disconnect-section {
  text-align: center;
  margin-top: 1rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-200);
  background: var(--white);
}

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

.footer a:hover {
  text-decoration: underline;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--gray-800);
  color: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--error);
}

.toast.warning {
  background: var(--warning);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Loading State */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn.loading {
  color: transparent;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-primary.loading::after {
  border-top-color: var(--white);
}

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

/* Responsive */
@media (max-width: 640px) {
  .header {
    padding: 1rem;
  }

  .main {
    padding: 1rem;
  }

  .sync-info {
    flex-direction: column;
  }

  .checkbox-group {
    flex-direction: column;
  }

  .checkbox-item {
    width: 100%;
  }
}
