/* ============================================
   PIVOTECH - Main Stylesheet
   ============================================ */

/* Root Variables - Theme System */
:root {
  --bg-primary: #0D1117;
  --bg-secondary: #161B22;
  --bg-card: #161B22;
  --text-primary: #E6EDF3;
  --text-secondary: #8B949E;
  --border-color: #30363D;

  --color-sky: #38BDF8;
  --color-indigo: #6366F1;
  --color-success: #10B981;
  --color-error: #EF4444;
  --color-warning: #F59E0B;
}

[data-theme="light"] {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F6F8FA;
  --bg-card: #FFFFFF;
  --text-primary: #1F2328;
  --text-secondary: #656D76;
  --border-color: #D1D9E0;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

[dir="rtl"] body {
  font-family: 'Cairo', 'Inter', sans-serif;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p {
  margin-bottom: 1rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.3s ease;
}

/* Gradient Text Effects */
.gradient-text {
  background: linear-gradient(to right, var(--color-sky), var(--color-indigo));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Glowing Text Animation */
.glowing-text {
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.5),
               0 0 20px rgba(56, 189, 248, 0.4),
               0 0 30px rgba(56, 189, 248, 0.3),
               0 0 40px rgba(99, 102, 241, 0.2);
  animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% {
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5),
                 0 0 20px rgba(56, 189, 248, 0.4),
                 0 0 30px rgba(56, 189, 248, 0.3),
                 0 0 40px rgba(99, 102, 241, 0.2);
  }
  50% {
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.8),
                 0 0 30px rgba(56, 189, 248, 0.6),
                 0 0 40px rgba(56, 189, 248, 0.5),
                 0 0 50px rgba(99, 102, 241, 0.4),
                 0 0 60px rgba(99, 102, 241, 0.3);
  }
}

/* Logo Styles */
.logo-container {
  background: linear-gradient(135deg, var(--color-sky), var(--color-indigo));
  border-radius: 12px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
  transition: transform 0.3s ease;
}

.logo-container:hover {
  transform: scale(1.05);
}

.logo-text {
  background: linear-gradient(135deg, #FFFFFF, #F0F9FF);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.logo-glow {
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6))
          drop-shadow(0 0 15px rgba(56, 189, 248, 0.4))
          drop-shadow(0 0 25px rgba(99, 102, 241, 0.3));
  animation: logo-glow-pulse 3s ease-in-out infinite;
}

@keyframes logo-glow-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6))
            drop-shadow(0 0 15px rgba(56, 189, 248, 0.4))
            drop-shadow(0 0 25px rgba(99, 102, 241, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.9))
            drop-shadow(0 0 25px rgba(56, 189, 248, 0.7))
            drop-shadow(0 0 35px rgba(99, 102, 241, 0.5))
            drop-shadow(0 0 45px rgba(99, 102, 241, 0.3));
  }
}

/* Card Styles */
.card-bg {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
}

/* Hero Background */
.hero-bg {
  background-image: radial-gradient(circle at top right, rgba(56, 189, 248, 0.1), transparent 40%),
                    radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.1), transparent 40%);
}

[data-theme="light"] .hero-bg {
  background-image: radial-gradient(circle at top right, rgba(56, 189, 248, 0.05), transparent 40%),
                    radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.05), transparent 40%);
}

/* Fade-in Animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Chat Button Glow */
.chat-glow-button {
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.8), 0 0 5px rgba(56, 189, 248, 0.5);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.8), 0 0 5px rgba(56, 189, 248, 0.5);
  }
  50% {
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.9), 0 0 10px rgba(99, 102, 241, 0.6);
  }
}

/* Language Switcher */
.lang-switcher {
  position: relative;
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.lang-option {
  position: relative;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  z-index: 1;
}

.lang-option.active {
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--color-sky), var(--color-indigo));
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

/* Theme Toggle Switch */
.theme-toggle {
  position: relative;
  width: 60px;
  height: 32px;
  background: var(--border-color);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.theme-toggle.active {
  background: linear-gradient(135deg, var(--color-sky), var(--color-indigo));
}

.theme-toggle::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-toggle.active::after {
  transform: translateX(28px);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 32px;
  max-width: 440px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

/* Form Elements */
input,
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-sky);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-secondary);
}

/* Buttons */
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-sky), var(--color-indigo));
  color: white;
  padding: 12px 24px;
}

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 12px 24px;
}

.btn-secondary:hover {
  background: var(--bg-secondary);
}

/* Header Styles */
header {
  transition: all 0.3s ease;
}

header.scrolled {
  background-color: rgba(13, 17, 23, 0.8);
  border-bottom: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
  .logo-text {
    font-size: 1.25rem;
  }

  .logo-container {
    padding: 6px 10px;
  }

  .logo-container svg {
    width: 2rem;
    height: 2rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .modal-content {
    padding: 24px;
    max-width: 90vw;
  }

  input,
  textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Accessibility */
.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;
}

/* Print Styles */
@media print {
  body {
    background: white;
    color: black;
  }

  header,
  footer,
  .chat-modal {
    display: none;
  }
}
