/**
 * Enterprise Platform Styles
 * Version: 1.0.0
 *
 * Table of Contents:
 * 1. Base Styles & Typography
 * 2. Layout & Grid
 * 3. Components
 * 4. Utilities
 * 5. Animations
 * 6. Dark Mode
 * 7. Media Queries
 */

/* ==========================================================================
   1. Base Styles & Typography
   ========================================================================== */

:root {
  /* Modern beautiful palette */
  --primary-color: #2563eb; /* blue */
  --secondary-color: #06b6d4; /* cyan */
  --accent-color: #f59e42; /* orange */
  --text-color: #1e293b; /* dark slate */
  --text-muted: #64748b; /* muted blue-gray */
  --bg-color: #f8fafc; /* light gray */
  --card-bg: #ffffff; /* white */
  --border-color: rgba(37,99,235,0.08); /* subtle blue border */
  --muted-bg: #e2e8f0; /* very light blue-gray */
  --transition-speed: 0.3s;
  --dark-bg: #0f172a; /* deep navy for dark mode */
}

/* Dark mode colors */
:root.dark {
  --primary-color: #60a5fa; /* soft blue */
  --secondary-color: #22d3ee; /* bright cyan */
  --accent-color: #fbbf24; /* gold */
  --text-color: #e2e8f0; /* light gray */
  --text-muted: #94a3b8; /* muted blue-gray */
  --bg-color: #0f172a; /* deep navy */
  --card-bg: #1e293b; /* dark slate */
  --muted-bg: #1e293b; /* muted dark slate */
  --border-color: rgba(96,165,250,0.10); /* subtle blue border */
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  scroll-behavior: smooth;
  overflow-x: hidden;
  transition: background-color var(--transition-speed) ease,
              color var(--transition-speed) ease;
}

/* Apply theme variables to body when dark-mode class present */
body.dark-mode {
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* Smooth transitions for theme changes */
* {
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

/* Navigation */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  z-index: 1001;
  transition: width 0.1s ease;
}

/* Loading Animation */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  transition: opacity 0.5s;
}

.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  z-index: -1;
}

.loading-spinner {
  text-align: center;
}

.spinner-circle {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0,0,0,0.06);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.spinner-text {
  margin-top: 15px;
  font-size: 1.2rem;
  color: var(--primary-color);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

body.dark-mode .loading-screen {
  background: var(--bg-color);
}

body.dark-mode .spinner-circle {
  border-color: rgba(255,255,255,0.06);
  border-top-color: var(--primary-color);
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  height: 72px;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, rgba(248,250,252,0.96), rgba(255,255,255,0.96));
  backdrop-filter: blur(8px);
  transition: background 0.3s, border-color 0.3s;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 8px rgba(16,24,40,0.04);
  border-bottom: 1px solid var(--border-color);
}

body.dark-mode .navbar {
  background: linear-gradient(90deg, rgba(15,23,42,0.92), rgba(15,23,42,0.98));
  border-bottom: 1px solid var(--border-color);
}

/* Navbar link coloring */
.navbar .nav-link {
  color: var(--text-color);
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: var(--primary-color);
}

body.dark-mode .navbar .nav-link {
  color: var(--text-muted);
}

body.dark-mode .navbar .nav-link:hover,
body.dark-mode .navbar .nav-link:focus {
  color: var(--secondary-color);
}

/* Inputs and forms in dark mode */
body.dark-mode input,
body.dark-mode .form-control,
body.dark-mode .input-group .form-control {
  background: rgba(255,255,255,0.03);
  color: var(--text-color);
  border-color: rgba(255,255,255,0.04);
}

/* Pricing toggle */
body.dark-mode .slider {
  background-color: rgba(255,255,255,0.08);
}

body.dark-mode .slider:before {
  background-color: var(--bg-color);
}

/* Footer link contrast in dark */
body.dark-mode footer a {
  color: var(--text-muted);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-size: 1.15rem;
  letter-spacing: -0.2px;
}

/* Navbar polish: spacing, link styles, and mobile adjustments */
.navbar {
  padding: 0 1rem; /* left/right breathing room */
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links .nav-link {
  color: rgba(51,51,51,0.9);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.nav-links .nav-link:hover,
.nav-links .nav-link:focus {
  background: rgba(37,99,235,0.06); /* subtle primary tint */
  color: var(--primary-color);
  transform: translateY(-1px);
  text-decoration: none;
}

.nav-links .btn {
  padding: 0.45rem 0.75rem;
}

.hamburger {
  display: none; /* default hidden on desktop; shown in media query */
  cursor: pointer;
  padding: 10px; /* larger touch target */
  margin-left: 0.75rem;
  border-radius: 8px;
}

.hamburger:hover {
  background: rgba(0,0,0,0.03);
}

.hamburger-line {
  background: var(--text-color);
}

.nav-links {
  display: flex;
  align-items: center;
}

.hamburger {
  margin-left: 1rem;
}

/* Ensure main content isn't hidden under fixed navbar (do NOT target .container inside navbar) */
main, .hero, .features-section, .pricing-section {
  padding-top: 92px; /* matches navbar height + gap */
}

/* Responsive images */
img.img-fluid, .img-fluid {
  width: 100%;
  height: auto;
  display: block;
}

/* Force hero images to maintain aspect and not overflow */
.hero .hero-main-img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
}

.hero .hero-overlay-img {
  position: absolute;
  bottom: 0;
  right: -2rem;
  width: 60%;
  max-width: 320px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.hero .hero-kpi {
  position: absolute;
  top: -1.5rem;
  right: 2rem;
  z-index: 3;
}

/* Floating feature card (moved from inline styles) */
.feature-card-floating {
  position: absolute;
  bottom: -2rem;
  right: -2rem;
  max-width: 300px;
}

/* Avatar utility for testimonials */
.avatar-sm {
  width: 48px;
  height: 48px;
  object-fit: cover;
}

/* Ensure all images behave nicely on different viewports */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.hamburger {
  display: none;
  cursor: pointer;
  padding: 15px;
}

.hamburger-line {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px 0;
  background: var(--muted-bg);
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Footer */
.footer {
  background: var(--muted-bg);
}

.footer h5 {
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--primary-color);
}

.social-links a {
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: var(--primary-color);
}

.footer .input-group {
  max-width: 300px;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }
  
  .nav-links {
    position: fixed;
    top: 72px; /* match navbar height */
    left: -100%;
    width: 100%;
    height: calc(100vh - 72px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(6px);
    flex-direction: column;
    align-items: center;
    padding-top: 1.5rem;
    gap: 1.25rem;
    transition: left 0.28s cubic-bezier(.2,.9,.2,1);
  }
  
  .nav-links.active {
    left: 0;
  }
}

/* ...existing base styles above are used; removed duplicate body override to prevent conflicts. */

.hero {
  background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)),
              url("https://source.unsplash.com/1600x900/?technology,startup") center/cover no-repeat;
  color: white;
  height: 100vh;
}

.hero h1 {
  font-size: 3rem;
  font-weight: bold;
}

.hero .brand {
  color: var(--primary-color);
}

.section-title {
  font-weight: bold;
  margin-bottom: 2rem;
}

.card-price {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 10px 0;
}

/* Pricing Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.06);
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.pricing-toggle {
  font-size: 1.1rem;
}

footer {
  background: var(--muted-bg);
  color: var(--text-muted);
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer a:hover {
  color: var(--primary-color);
}

/* Testimonials Carousel */
.testimonials-container {
  position: relative;
  overflow: hidden;
  height: 300px;
}

.testimonial-card {
  position: absolute;
  width: 100%;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.5s ease;
}

.testimonial-card.active {
  opacity: 1;
  transform: translateX(0);
}

.testimonial-card .card {
  margin: 0 auto;
  max-width: 600px;
}

/* Card styles for light and dark */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

/* lift cards slightly on hover in light mode */
.card:hover {
  /* small upward motion, but ensure visibility via z-index and stronger shadow */
  transform: translateY(-6px);
  box-shadow: 0 28px 70px rgba(16,24,40,0.14);
  border-color: rgba(37,99,235,0.16);
  position: relative;
  z-index: 12;
}

/* Allow the container to reveal small hover lifts when the user hovers the carousel */
.testimonials-container:hover {
  overflow: visible;
}

/* Keep testimonial-card overflow visible so inner shadows aren't clipped */
.testimonial-card {
  overflow: visible;
}

body.dark-mode .card {
  background: var(--card-bg);
  border-color: var(--border-color);
}

/* Improve card elevation for dark */
body.dark-mode .card {
  box-shadow: 0 6px 20px rgba(2,6,23,0.6);
}

/* Links and interactive elements */
a {
  color: var(--primary-color);
}

body.dark-mode a {
  color: var(--secondary-color);
}

/* Accessible focus outlines */
* :focus {
  outline: 3px solid rgba(79,140,255,0.18);
  outline-offset: 2px;
}

/* Slightly darken hero overlay for readability */
body.dark-mode .hero h1,
body.dark-mode .hero p {
  color: var(--text-color);
}

/* Toggle visibility and contrast */
body.dark-mode #themeToggle {
  background: rgba(255,255,255,0.06);
  color: var(--text-color);
  border: 1px solid rgba(255,255,255,0.04);
}

/* Buttons in dark mode */
.btn-primary {
  background: linear-gradient(90deg, var(--primary-color), #1e7bf6);
  border-color: transparent;
  color: #fff; /* keep white text on primary */
  box-shadow: 0 10px 30px rgba(37,99,235,0.12);
  padding: 0.58rem 1rem;
  border-radius: 10px;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

/* Outline primary variant */
.btn-outline-primary {
  color: var(--primary-color);
  border-color: rgba(37,99,235,0.12);
  background: transparent;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

body.dark-mode .btn-secondary {
  background: rgba(255,255,255,0.04);
  color: var(--text-color);
  border-color: rgba(255,255,255,0.06);
}

/* Footer dark adjustments */
body.dark-mode .footer,
body.dark-mode footer {
  background: linear-gradient(180deg, rgba(5,12,22,0.95), rgba(7,18,38,0.98));
  color: var(--text-muted);
}

/* Footer links and small text */
footer {
  background: var(--muted-bg);
}

footer p, footer a, footer small {
  color: var(--text-muted);
}

body.dark-mode footer p, body.dark-mode footer a, body.dark-mode footer small {
  color: var(--text-muted);
}

/* Hero adjustments for dark mode */
.hero {
  background-blend-mode: multiply;
}

body.dark-mode .hero {
  background: linear-gradient(rgba(2,6,23,0.6), rgba(2,6,23,0.6)),
              url("https://source.unsplash.com/1600x900/?technology,startup") center/cover no-repeat;
}

.carousel-control {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  padding: 0;
  background-color: rgba(0, 0, 0, 0.06);
  border: 2px solid rgba(37,99,235,0.18);
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
  display: inline-block;
}

.carousel-control.active {
  background-color: var(--primary-color);
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(37,99,235,0.16);
  border-color: rgba(37,99,235,0.36);
}

/* Dark mode styles for carousel controls */
body.dark-mode .carousel-control {
  background-color: rgba(255,255,255,0.06);
  border-color: rgba(34,211,238,0.18); /* secondary tint */
}

body.dark-mode .carousel-control.active {
  background-color: var(--secondary-color);
  box-shadow: 0 6px 18px rgba(34,211,238,0.14);
  border-color: rgba(34,211,238,0.36);
}

/* Dark Mode */
/* Use variables for dark-mode defaults (handled above) */
body.dark-mode {
  background: var(--bg-color);
  color: var(--text-color);
}

body.dark-mode footer {
  background: var(--muted-bg);
  color: var(--text-muted);
}

body.dark-mode .card {
  background: var(--card-bg);
  color: var(--text-color);
}

/* Keep hero dark image handled earlier */

/* Stronger dark-mode text rules */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: var(--text-color);
}

body.dark-mode p,
body.dark-mode .lead,
body.dark-mode li,
body.dark-mode label,
body.dark-mode .card p {
  color: var(--text-muted);
}

/* Ensure Bootstrap utility .text-muted maps to theme */
.text-muted {
  color: var(--text-muted) !important;
}

/* Footer small text */
footer small,
footer p {
  color: var(--text-muted);
}

/* Spinner and loader text */
.spinner-text { color: var(--primary-color); }

/* Navbar brand should remain visible in dark */
.navbar-brand { color: var(--primary-color); }
