/**
 * Main CSS - SalesCatalog AI Platform
 * Modern dark mode aesthetic with animations
 */

/* 1. Variables (CSS Custom Properties) */
@import './variables.css';

/* 2. Reset & Base Styles */
@import './reset.css';

/* 3. Typography */
@import './typography.css';

/* 4. Layout & Grid */
@import './layout.css';

/* 5. Components */
@import './components.css';

/* ==================== GLOBAL STYLES ==================== */

[v-cloak] {
  display: none !important;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-secondary);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ==================== ANIMATED BACKGROUNDS ==================== */

/* Dot Grid Background */
.bg-dots {
  background-image: radial-gradient(var(--accent-primary) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: center center;
  opacity: 0.2;
}

/* Animated Gradient Background */
.bg-gradient-animated {
  background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
  background-size: 400% 400%;
  animation: gradient-animation 15s ease infinite;
}

@keyframes gradient-animation {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Radial Gradient Overlay */
.bg-gradient-radial {
  position: relative;
}

.bg-gradient-radial::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at top, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

/* Grid Background with Fade */
.bg-grid-fade {
  background-image: 
    linear-gradient(to right, rgba(139, 92, 246, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(139, 92, 246, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(
    ellipse 80% 60% at 50% 50%, 
    #000 60%, 
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 80% 60% at 50% 50%, 
    #000 60%, 
    transparent 100%
  );
}

/* ==================== UTILITY CLASSES ==================== */

/* Background Colors */
.bg-primary {
  background-color: var(--bg-primary);
}

.bg-secondary {
  background-color: var(--bg-secondary);
}

.bg-tertiary {
  background-color: var(--bg-tertiary);
}

.bg-gradient-primary {
  background: var(--gradient-primary);
}

.bg-gradient-hero {
  background: var(--gradient-hero);
}

/* Shadow Utilities */
.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.shadow-xl {
  box-shadow: var(--shadow-xl);
}

.shadow-glow {
  box-shadow: var(--shadow-glow);
}

/* Border Radius */
.rounded-sm {
  border-radius: var(--radius-sm);
}

.rounded-md {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

.rounded-full {
  border-radius: var(--radius-full);
}

/* ==================== SECTION STYLES ==================== */

.section {
  padding: var(--space-4xl) 0;
  position: relative;
}

.section-sm {
  padding: var(--space-3xl) 0;
}

.section-lg {
  padding: 128px 0;
}

@media (max-width: 768px) {
  .section {
    padding: var(--space-3xl) 0;
  }
  
  .section-sm {
    padding: var(--space-2xl) 0;
  }
  
  .section-lg {
    padding: var(--space-4xl) 0;
  }
}

/* ==================== LOADING SCREEN ==================== */

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 9999;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-default);
  border-top: 4px solid var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ==================== SMOOTH SCROLLING ==================== */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ==================== PAGE TRANSITIONS ==================== */

.page-enter-active,
.page-leave-active {
  transition: opacity 0.3s ease;
}

.page-enter-from,
.page-leave-to {
  opacity: 0;
}

/* ==================== 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;
}

/* Focus Visible */
.focus-visible:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ==================== RESPONSIVE IMAGES ==================== */

img {
  max-width: 100%;
  height: auto;
}

/* ==================== SELECTION ==================== */

::selection {
  background-color: var(--accent-primary);
  color: var(--text-primary);
}

::-moz-selection {
  background-color: var(--accent-primary);
  color: var(--text-primary);
}

/* ==================== SCROLLBAR ==================== */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ==================== FOOTER STYLES ==================== */

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-4xl) 0 var(--space-xl);
  margin-top: auto;
}

[data-theme="light"] .footer {
  background: #f8fafc;
  border-top-color: rgba(0, 0, 0, 0.1);
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

[data-theme="light"] .footer-link {
  color: #475569;
}

.footer-link:hover {
  color: var(--accent-primary);
}

.footer-brand-text {
  margin-left: 8px;
  padding-top: 2px;
  font-size: 18px;
  font-weight: var(--font-bold);
  color: #ffffff; /* White in dark mode */
  transition: color var(--transition-normal);
}

/* Light mode - dark text */
[data-theme="light"] .footer-brand-text {
  color: #0f172a; /* Dark in light mode */
}

/* Footer Mobile Optimization */
@media (max-width: 768px) {
  .footer .grid-cols-4 {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer .grid-cols-4 > div {
    text-align: center;
    margin-bottom: var(--space-xl);
  }
  
  .footer .grid-cols-4 > div:last-child {
    margin-bottom: 0;
  }
  
  /* Center logo and company info */
  .footer .grid-cols-4 > div:first-child > div:first-child {
    justify-content: center;
  }
  
  /* Center all lists */
  .footer ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  /* Center headings */
  .footer h4 {
    text-align: center;
  }
  
  /* Center bottom bar content */
  .footer > .container > div:last-child {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  /* Reorder: Social icons appear before copyright in mobile */
  .footer > .container > div:last-child > p:first-child {
    order: 2; /* Copyright appears second (below) */
  }
  
  .footer > .container > div:last-child > div:last-child {
    order: 1; /* Social links appear first (above) */
    justify-content: center;
    margin-bottom: var(--space-md); /* Add spacing between social icons and copyright */
  }
  
  /* Split copyright text into two lines on mobile */
  .footer-copyright {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }
  
  .footer-copyright-line1,
  .footer-copyright-line2 {
    display: block;
  }
}

/* Desktop: Keep copyright text on one line */
.footer-copyright-line1,
.footer-copyright-line2 {
  display: inline;
}

.footer-copyright-line1::after {
  content: ' ';
}

/* ==================== WHATSAPP FLOATING BUTTON ==================== */

.whatsapp-float {
  position: fixed;
  width: 56px;
  height: 56px;
  bottom: 24px;
  right: 24px;
  background-color: #25D366;
  color: #FFF;
  border-radius: 50%;
  text-align: center;
  font-size: 32px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  z-index: var(--z-fixed);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
}

/* ==================== PRINT STYLES ==================== */

@media print {
  .navbar,
  .footer,
  .btn,
  .whatsapp-float {
    display: none !important;
  }
  
  body {
    color: #000;
    background: #fff;
  }
}

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */

/* GPU Acceleration for animations */
.accelerated {
  transform: translateZ(0);
  will-change: transform;
}

/* Prevent FOUC (Flash of Unstyled Content) */
html {
  visibility: visible;
  opacity: 1;
}
