/* ============================================================================
   T-BOT GLOBAL BASE CSS
   ============================================================================
   Variables, typography, animations and common styles used across all pages
   
   Files that depend on this:
   - auth.css (login, register, reset-password)
   - dashboard.css (dashboard, account)
   - landing.css (index.html)
   - chat-widget.css (chat, full, widget, icon)
   - admin-panel.css (admin/admin.html)
============================================================================ */

:root {
  /* Brand Colors */
  --primary-color: #0878e8;
  --secondary-color: #58697d;
  --success-color: #7b2bbf;
  --ink: #13233a;
  --brand-blue: #0878e8;
  --brand-magenta: #7b2bbf;
  --brand-ink: #13233a;
  
  /* Dashboard Colors */
  --db-primary: #0878e8;
  --db-secondary: #58697d;
  --db-accent: #7b2bbf;
  --db-text: #13233a;
  --db-page: #edf4ff;
  --db-surface: #ffffff;
  --db-text-muted: #58697d;
  --db-success: #7b2bbf;
  
  /* Neutral Colors */
  --color-light: #f8f9fa;
  --color-border: #e7edf5;
  --color-text-light: rgba(255, 255, 255, 0.9);
  --color-text-muted: #98a2b3;
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 20px;
  --spacing-2xl: 28px;
  --spacing-3xl: 36px;
  --spacing-4xl: 48px;
  
  /* Typography */
  --font-family-base: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Segoe UI Emoji', sans-serif;
  --font-family-display: 'Space Grotesk', sans-serif;
  --font-family-heading: 'Poppins', sans-serif;
  --font-family-emoji: 'Noto Color Emoji', -apple-system, BlinkMacSystemFont, 'Segoe UI Emoji', 'Segoe Color Emoji', sans-serif;
  
  --font-size-xs: 0.65rem;
  --font-size-sm: 0.75rem;
  --font-size-base: 0.95rem;
  --font-size-lg: 1.1rem;
  --font-size-xl: 1.3rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;
  
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --radius-full: 999px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.16);
  --shadow-xl: 0 12px 28px rgba(0, 0, 0, 0.20);
  
  /* Z-index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-tooltip: 600;
  --z-notification: 700;
  --z-top: 999;
}

/* ============================================================================
   GLOBAL RESET & BASE STYLES
============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--ink);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.i18n-loading {
  opacity: 0.95;
}

/* ============================================================================
   TYPOGRAPHY
============================================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
  margin-bottom: var(--spacing-lg);
}

h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-extrabold);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-xl);
}

h4 {
  font-size: var(--font-size-lg);
}

p {
  margin-bottom: var(--spacing-lg);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--brand-magenta);
}

/* ============================================================================
   COMMON COMPONENTS
============================================================================ */

.container {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding-left: var(--spacing-xl);
  padding-right: var(--spacing-xl);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md) var(--spacing-xl);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: inherit;
  font-weight: var(--font-weight-bold);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-color);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
  background: #0563c0;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary-color);
  color: #ffffff;
}

.btn-secondary:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-light {
  background: #ffffff;
  color: var(--ink);
  border-color: #ffffff;
}

.btn-light:hover:not(:disabled) {
  background: var(--color-light);
}

.btn-outline-primary {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-outline-primary:hover:not(:disabled) {
  background: rgba(8, 120, 232, 0.1);
}

/* ============================================================================
   FORM ELEMENTS
============================================================================ */

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-lg);
  border: 1px solid #667085;
  border-radius: var(--radius-md);
  font-size: inherit;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

input::placeholder,
textarea::placeholder {
  color: #667085;
  opacity: 1;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(8, 120, 232, 0.1);
}

input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="password"]:disabled,
textarea:disabled,
select:disabled {
  background: var(--color-light);
  cursor: not-allowed;
}

/* ============================================================================
   UTILITY CLASSES
============================================================================ */

.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;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }
.mb-5 { margin-bottom: var(--spacing-2xl); }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }
.mt-5 { margin-top: var(--spacing-2xl); }

.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }
.p-4 { padding: var(--spacing-xl); }
.p-5 { padding: var(--spacing-2xl); }

/* ============================================================================
   LOADING ANIMATION
============================================================================ */

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================================================
   RESPONSIVE UTILITIES
============================================================================ */

@media (max-width: 768px) {
  .container {
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
  }
  
  h1 {
    font-size: var(--font-size-3xl);
  }
  
  h2 {
    font-size: var(--font-size-2xl);
  }
}

@media (max-width: 576px) {
  .container {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }
  
  h1 {
    font-size: var(--font-size-2xl);
  }
  
  h2 {
    font-size: var(--font-size-xl);
  }
  
  .btn {
    width: 100%;
  }
}

/* ============================================================================
   PREFERS-REDUCED-MOTION
============================================================================ */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
