/* ============================================
   NexaStack IT - Premium B2B Website Theme
   Design System & Global Stylesheet
   ============================================ */

/* ============== CSS VARIABLES (DESIGN SYSTEM) ============== */
:root {
  /* Colors */
  --primary: #2563EB;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --accent: #22C55E;
  --accent-dark: #16a34a;
  --accent-light: #4ade80;
  --warning: #eab308;
  --danger: #ef4444;
  --purple: #8b5cf6;
  --cyan: #06b6d4;

  /* Neutrals */
  --bg-dark: #0B1220;
  --bg-darker: #050a15;
  --bg-light: #F8FAFC;
  --text-dark: #0f172a;
  --text-light: #f8fafc;
  --text-muted: #64748b;
  --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;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
  --shadow-elevation: 0 25px 50px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.2);

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-secondary: 'Poppins', sans-serif;
  --fs-12: 0.75rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;
  --fs-32: 2rem;
  --fs-40: 2.5rem;
  --fs-48: 3rem;
  --fs-56: 3.5rem;

  --fw-400: 400;
  --fw-500: 500;
  --fw-600: 600;
  --fw-700: 700;
  --fw-800: 800;

  --lh-1: 1;
  --lh-1-2: 1.2;
  --lh-1-5: 1.5;
  --lh-1-75: 1.75;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-bg: 400;
  --z-modal: 500;
  --z-notification: 600;
}

/* ============== GLOBAL RESETS & BASE STYLES ============== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  font-size: var(--fs-16);
  line-height: var(--lh-1-75);
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--bg-light) 0%, #f1f5f9 100%);
  overflow-x: hidden;
}

/* ============== TYPOGRAPHY ============== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-secondary);
  font-weight: var(--fw-700);
  line-height: var(--lh-1-2);
  color: var(--text-dark);
}

h1 {
  font-size: var(--fs-56);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--fs-48);
  letter-spacing: -0.015em;
}

h3 {
  font-size: var(--fs-32);
  letter-spacing: -0.01em;
}

h4 {
  font-size: var(--fs-24);
  letter-spacing: -0.005em;
}

h5 {
  font-size: var(--fs-20);
}

h6 {
  font-size: var(--fs-18);
}

p {
  color: var(--text-muted);
  line-height: var(--lh-1-75);
  margin-bottom: var(--space-md);
}

small {
  font-size: var(--fs-14);
}

em {
  font-family: var(--font-secondary);
  font-style: italic;
  font-weight: var(--fw-600);
  color: var(--primary);
}

strong {
  font-weight: var(--fw-700);
  color: var(--text-dark);
}

/* ============== LINKS & BUTTONS ============== */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

a:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Button Base Styles */
button,
.btn,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  font-family: var(--font-secondary);
  font-size: var(--fs-16);
  font-weight: var(--fw-600);
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  white-space: nowrap;
  text-decoration: none;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

button:focus,
.btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary Button */
.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

/* Accent Button */
.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-accent:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-dark);
  padding: var(--space-sm) var(--space-md);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--gray-100);
}

/* Small Button */
.btn-sm {
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--fs-14);
}

/* Large Button */
.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--fs-18);
}

/* Full Width Button */
.btn-block {
  width: 100%;
}

/* ============== FORMS ============== */
input,
textarea,
select {
  font-family: var(--font-primary);
  font-size: var(--fs-16);
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  background: white;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

label {
  display: block;
  font-weight: var(--fw-600);
  margin-bottom: var(--space-sm);
  color: var(--text-dark);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-error {
  color: var(--danger);
  font-size: var(--fs-14);
  margin-top: var(--space-sm);
  display: none;
}

.form-error.active {
  display: block;
}

input.error,
textarea.error {
  border-color: var(--danger);
}

/* ============== UTILITY CLASSES ============== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.row {
  display: grid;
  gap: var(--space-xl);
}

.col-2 {
  grid-template-columns: repeat(2, 1fr);
}

.col-3 {
  grid-template-columns: repeat(3, 1fr);
}

.col-4 {
  grid-template-columns: repeat(4, 1fr);
}

.col-6 {
  grid-template-columns: repeat(6, 1fr);
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-align {
  display: flex;
  align-items: center;
}

.flex-col {
  flex-direction: column;
}

.gap-xs {
  gap: var(--space-xs);
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.gap-xl {
  gap: var(--space-xl);
}

.gap-2xl {
  gap: var(--space-2xl);
}

.p-0 { padding: 0; }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.p-2xl { padding: var(--space-2xl); }
.p-3xl { padding: var(--space-3xl); }

.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.px-xl { padding-left: var(--space-xl); padding-right: var(--space-xl); }

.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }
.py-2xl { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }
.py-3xl { padding-top: var(--space-3xl); padding-bottom: var(--space-3xl); }
.py-4xl { padding-top: var(--space-4xl); padding-bottom: var(--space-4xl); }

.m-0 { margin: 0; }
.m-sm { margin: var(--space-sm); }
.m-md { margin: var(--space-md); }
.m-lg { margin: var(--space-lg); }
.m-xl { margin: var(--space-xl); }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-md { margin-top: var(--space-md); margin-bottom: var(--space-md); }
.my-lg { margin-top: var(--space-lg); margin-bottom: var(--space-lg); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }

.fw-400 { font-weight: var(--fw-400); }
.fw-500 { font-weight: var(--fw-500); }
.fw-600 { font-weight: var(--fw-600); }
.fw-700 { font-weight: var(--fw-700); }

.hidden { display: none !important; }
.visible { display: block !important; }
.invisible { visibility: hidden; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }

/* ============== COMPONENTS: CARDS ============== */
.card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-sm {
  padding: var(--space-lg);
}

.card-compact {
  padding: var(--space-md);
}

.card-glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.card-dark {
  background: var(--bg-dark);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============== COMPONENTS: BADGES ============== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--fs-12);
  font-weight: var(--fw-600);
  white-space: nowrap;
}

.badge-primary {
  background: rgba(37, 99, 235, 0.15);
  color: var(--primary-dark);
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-dark);
}

.badge-warning {
  background: rgba(234, 179, 8, 0.15);
  color: #b8860b;
}

/* ============== COMPONENTS: ALERTS ============== */
.alert {
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border-left: 4px solid;
  margin-bottom: var(--space-lg);
}

.alert-info {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.alert-warning {
  background: rgba(234, 179, 8, 0.1);
  border-color: var(--warning);
  color: #b8860b;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
  color: #991b1b;
}

/* ============== COMPONENTS: TABS ============== */
.tabs {
  display: flex;
  gap: var(--space-md);
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
}

.tab-item {
  padding: var(--space-md) 0;
  font-weight: var(--fw-600);
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-item:hover {
  color: var(--text-dark);
}

/* ============== COMPONENTS: ACCORDION ============== */
.accordion {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid var(--gray-200);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  padding: var(--space-lg);
  background: white;
  cursor: pointer;
  font-weight: var(--fw-600);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-fast);
  user-select: none;
  color: var(--text-dark);
}

.accordion-header:hover {
  background: var(--gray-50);
}

.accordion-header.active {
  background: rgba(37, 99, 235, 0.05);
  color: var(--primary);
}

.accordion-icon {
  width: 24px;
  height: 24px;
  transition: transform var(--transition-fast);
  font-weight: var(--fw-700);
}

.accordion-header.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 0 var(--space-lg) var(--space-lg);
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-muted);
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.accordion-body.active {
  max-height: 500px;
}

/* ============== UTILITIES: NAVIGATION ============== */
nav a {
  position: relative;
  padding: var(--space-md) 0;
  display: inline-block;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition-fast);
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

/* ============== ANIMATIONS ============== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: var(--shadow-glow);
  }
  50% {
    box-shadow: 0 0 50px rgba(34, 197, 94, 0.3);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease-out;
}

.animate-slideDown {
  animation: slideDown 0.4s ease-out;
}

.animate-slideUp {
  animation: slideUp 0.4s ease-out;
}

.animate-slideInLeft {
  animation: slideInLeft 0.5s ease-out;
}

.animate-slideInRight {
  animation: slideInRight 0.5s ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-glow {
  animation: glow 3s ease-in-out infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* ============== RESPONSIVE DESIGN ============== */
@media (max-width: 1024px) {
  :root {
    --fs-56: 2.5rem;
    --fs-48: 2rem;
    --fs-40: 2rem;
  }

  .col-6 {
    grid-template-columns: repeat(3, 1fr);
  }

  .col-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  h1 {
    font-size: var(--fs-40);
  }

  h2 {
    font-size: var(--fs-32);
  }
}

@media (max-width: 768px) {
  :root {
    --fs-56: 2rem;
    --fs-48: 1.75rem;
    --fs-40: 1.5rem;
    --fs-32: 1.5rem;
    --space-2xl: 2rem;
    --space-3xl: 2.5rem;
  }

  body {
    font-size: var(--fs-16);
  }

  .container {
    padding: 0 var(--space-md);
  }

  .col-6,
  .col-4,
  .col-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .col-2 {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: var(--fs-32);
  }

  h2 {
    font-size: var(--fs-24);
  }

  h3 {
    font-size: var(--fs-20);
  }

  .card {
    padding: var(--space-lg);
  }

  button,
  .btn {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--fs-16);
  }

  .tabs {
    gap: var(--space-sm);
  }

  .tab-item {
    padding: var(--space-md) var(--space-sm);
    font-size: var(--fs-14);
  }
}

@media (max-width: 640px) {
  :root {
    --fs-32: 1.25rem;
    --fs-24: 1.125rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --radius-xl: 16px;
  }

  .col-6,
  .col-4,
  .col-3,
  .col-2 {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 var(--space-md);
  }

  h1 {
    font-size: var(--fs-24);
  }

  h2 {
    font-size: var(--fs-20);
  }

  h3 {
    font-size: var(--fs-18);
  }

  .card {
    padding: var(--space-lg);
  }

  button,
  .btn {
    width: 100%;
  }

  .p-3xl {
    padding: var(--space-2xl);
  }

  .py-4xl {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
  }

  .tabs {
    flex-wrap: wrap;
  }

  label {
    font-size: var(--fs-14);
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }
}

/* ============== ACCESSIBILITY ============== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #0f1729 100%);
    color: var(--text-light);
  }

  .card {
    background: var(--bg-darker);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  input,
  textarea,
  select {
    background: var(--gray-900);
    border-color: var(--gray-700);
    color: var(--text-light);
  }

  input:focus,
  textarea:focus,
  select:focus {
    border-color: var(--primary);
  }

  .accordion-header {
    background: var(--gray-900);
    color: var(--text-light);
  }

  .accordion-header:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .tabs {
    border-color: var(--gray-700);
  }

  .accordion {
    border-color: var(--gray-700);
  }

  .accordion-item {
    border-color: var(--gray-700);
  }
}

/* ============== PRINT STYLES ============== */
@media print {
  body {
    background: white;
    color: black;
  }

  .no-print {
    display: none !important;
  }

  a {
    color: var(--primary);
    text-decoration: underline;
  }
}
