@import 'tailwindcss';
@import 'tw-animate-css';

@custom-variant dark (&:is(.dark *));

/* Custom theme configuration for Montserrat font */
@theme {
  --font-family-sans:
    'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* Custom breakpoint for extra small screens */
@layer utilities {
  .xs\:inline {
    @media (min-width: 475px) {
      display: inline;
    }
  }

  .xs\:hidden {
    @media (min-width: 475px) {
      display: none;
    }
  }
}

body {
  margin: 0;
  background: #000;
  /* Matches hero overlay */
}

/* Custom Scrollbar Styles */
.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: #3b82f6 #f1f5f9;
}

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

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #3b82f6;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}


@keyframes zoomIn {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.1);
  }
}

@keyframes zoomInMobile {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.05);
    /* Less zoom on mobile for better performance */
  }
}

/* Shimmer animation for loading skeletons */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.animate-shimmer {
  animation: shimmer 2s infinite;
}

/* Optimized loading animations */
@keyframes pulse-slow {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Smooth fade in animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ensure your topbar/navbar has proper z-index */
.navbar {
  z-index: 50 !important;
  /* Higher than hero section */
}

.topbar,
header {
  z-index: 1000 !important;
  /* Higher than hero section */
  position: fixed !important;
}

/* Optional: Add backdrop blur to topbar for better visibility */
.topbar {
  backdrop-filter: blur(10px);
  background-color: rgba(17, 24, 39, 0.95) !important;
}

/* Ensure global font application */
:root {
  font-family: var(--font-family-sans);
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
}

/* Desktop hover for dropdown menus */
@media (min-width: 1024px) {
  .group:hover [role='menu'] {
    display: block;
  }
}

/* Line clamp utilities for consistent text truncation */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hero section zoom animations */
@keyframes zoomIn {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(2.5);
    opacity: 1;
  }
}

@keyframes zoomInMobile {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(1.8);
    opacity: 1;
  }
}

/* Optional: Additional global styles */
body {
  @apply bg-gray-100 text-gray-900;
}

@theme inline {
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
}

@layer base {
  * {
    @apply border-gray-200;
  }

  body {
    @apply bg-background text-foreground;
  }
}

/* Enhanced card animations */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
  }
}

/* Custom card hover effects */
.activity-card {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.activity-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Enhanced button animations */
.btn-shimmer {
  position: relative;
  overflow: hidden;
}

.btn-shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-shimmer:hover::before {
  left: 100%;
}

/* Tawk.to Chat Widget Styles - Ensure it's visible and sticky */
#tawkchat-container,
#tawkchat-minified-wrapper,
iframe[id*="tawk"] {
  z-index: 9999 !important;
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  visibility: visible !important;
  display: block !important;
}

/* CRITICAL: Override ALL Tawk.to styles that might limit icon size - Maximum Priority */
#tawkchat-minified-wrapper,
[id="tawkchat-minified-wrapper"],
body #tawkchat-minified-wrapper,
html body #tawkchat-minified-wrapper,
html body div#tawkchat-minified-wrapper,
html body #tawkchat-minified-wrapper.tawk-min,
[class*="tawk"][id="tawkchat-minified-wrapper"] {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  height: 150px !important;
  min-height: 150px !important;
  max-height: 150px !important;
}

/* Force ALL possible child selectors */
#tawkchat-minified-wrapper *,
#tawkchat-minified-wrapper > *,
#tawkchat-minified-wrapper div,
#tawkchat-minified-wrapper span,
#tawkchat-minified-wrapper button,
#tawkchat-minified-wrapper a,
#tawkchat-minified-wrapper svg,
#tawkchat-minified-wrapper img,
#tawkchat-minified-wrapper i,
#tawkchat-minified-wrapper canvas,
#tawkchat-minified-wrapper iframe {
  width: 150px !important;
  height: 150px !important;
  min-width: 150px !important;
  min-height: 150px !important;
  max-width: 150px !important;
  max-height: 150px !important;
}

/* Desktop - Compact size */
@media (min-width: 769px) {
  #tawkchat-container,
  iframe[id*="tawk"] {
    width: 320px !important;
    max-width: 320px !important;
    height: auto !important;
    max-height: 500px !important;
    bottom: 20px !important;
    right: 20px !important;
  }
  
  /* Minimized state */
  #tawkchat-minified-wrapper {
    width: auto !important;
    min-width: 60px !important;
    min-height: 60px !important;
    max-width: 60px !important;
  }
}

/* Tablet - Smaller */
@media (max-width: 768px) and (min-width: 481px) {
  #tawkchat-container,
  iframe[id*="tawk"] {
    width: 280px !important;
    max-width: 280px !important;
    max-height: 450px !important;
    bottom: 15px !important;
    right: 15px !important;
  }
  
  #tawkchat-minified-wrapper {
    width: auto !important;
    min-width: 58px !important;
    min-height: 58px !important;
    max-width: 58px !important;
  }
}

/* Mobile - Much smaller, compact size, prevent full-page */
@media (max-width: 480px) {
  /* Prevent full-page mode */
  body:has(#max-widget),
  html:has(#max-widget) {
    overflow: visible !important;
  }
  
  #max-widget {
    position: fixed !important;
    width: calc(100vw - 20px) !important;
    max-width: 320px !important;
    max-height: 70vh !important;
    height: auto !important;
    bottom: 10px !important;
    right: 10px !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    overflow: hidden !important;
  }
  
  #tawkchat-container,
  iframe[id*="tawk"] {
    width: calc(100vw - 20px) !important;
    max-width: 320px !important;
    max-height: 70vh !important;
    height: auto !important;
    bottom: 10px !important;
    right: 10px !important;
    left: auto !important;
    transform: none !important;
    transform-origin: bottom right !important;
    border-radius: 16px !important;
    overflow: hidden !important;
  }
  
  #tawkchat-minified-wrapper,
  body #tawkchat-minified-wrapper,
  html body #tawkchat-minified-wrapper {
    width: 150px !important;
    min-width: 150px !important;
    min-height: 150px !important;
    max-width: 150px !important;
    height: 150px !important;
    max-height: 150px !important;
    transform: none !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  
  /* Force all child elements to be large - maximum specificity */
  #tawkchat-minified-wrapper *,
  body #tawkchat-minified-wrapper *,
  html body #tawkchat-minified-wrapper *,
  #tawkchat-minified-wrapper div,
  #tawkchat-minified-wrapper span,
  #tawkchat-minified-wrapper button,
  #tawkchat-minified-wrapper a,
  #tawkchat-minified-wrapper svg,
  #tawkchat-minified-wrapper img,
  #tawkchat-minified-wrapper i,
  #tawkchat-minified-wrapper canvas {
    width: 150px !important;
    height: 150px !important;
    min-width: 150px !important;
    min-height: 150px !important;
    max-width: 150px !important;
    max-height: 150px !important;
    box-sizing: border-box !important;
  }
  
  /* Fix text orientation and readability */
  #tawkchat-container *,
  #max-widget * {
    text-orientation: mixed !important;
    writing-mode: horizontal-tb !important;
    direction: ltr !important;
    text-align: left !important;
  }
}

/* Extra small screens - Even smaller */
@media (max-width: 360px) {
  #max-widget {
    width: calc(100vw - 16px) !important;
    max-width: 300px !important;
    max-height: 65vh !important;
    bottom: 8px !important;
    right: 8px !important;
    transform: none !important;
    border-radius: 14px !important;
  }
  
  #tawkchat-container,
  iframe[id*="tawk"] {
    width: calc(100vw - 16px) !important;
    max-width: 300px !important;
    max-height: 65vh !important;
    bottom: 8px !important;
    right: 8px !important;
    transform: none !important;
    transform-origin: bottom right !important;
    border-radius: 14px !important;
  }
  
  #tawkchat-minified-wrapper,
  body #tawkchat-minified-wrapper,
  html body #tawkchat-minified-wrapper {
    width: 140px !important;
    min-width: 140px !important;
    min-height: 140px !important;
    max-width: 140px !important;
    height: 140px !important;
    max-height: 140px !important;
    transform: none !important;
    border-radius: 50% !important;
    box-sizing: border-box !important;
  }
  
  /* Force all child elements to be large - maximum specificity */
  #tawkchat-minified-wrapper *,
  body #tawkchat-minified-wrapper *,
  html body #tawkchat-minified-wrapper *,
  #tawkchat-minified-wrapper div,
  #tawkchat-minified-wrapper span,
  #tawkchat-minified-wrapper button,
  #tawkchat-minified-wrapper a,
  #tawkchat-minified-wrapper svg,
  #tawkchat-minified-wrapper img,
  #tawkchat-minified-wrapper i,
  #tawkchat-minified-wrapper canvas {
    width: 140px !important;
    height: 140px !important;
    min-width: 140px !important;
    min-height: 140px !important;
    max-width: 140px !important;
    max-height: 140px !important;
    box-sizing: border-box !important;
  }
  
  /* Fix text orientation */
  #tawkchat-container *,
  #max-widget * {
    text-orientation: mixed !important;
    writing-mode: horizontal-tb !important;
    direction: ltr !important;
  }
}

/* TinyMCE Blog Content Styling */
.blog-content {
  @apply text-gray-700 leading-relaxed;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
  @apply font-bold text-gray-900 mt-6 mb-4;
}

.blog-content h1 {
  @apply text-4xl;
}

.blog-content h2 {
  @apply text-3xl;
}

.blog-content h3 {
  @apply text-2xl;
}

.blog-content h4 {
  @apply text-xl;
}

.blog-content p {
  @apply mb-4 leading-relaxed;
}

.blog-content a {
  @apply text-blue-600 font-medium no-underline;
}

.blog-content a:hover {
  @apply text-blue-800 underline;
}

.blog-content img {
  @apply w-full h-auto rounded-lg shadow-md my-6;
  max-width: 100%;
  height: auto;
}

.blog-content table {
  @apply w-full border-collapse my-6;
}

.blog-content table th {
  @apply bg-gray-100 font-semibold text-left p-3 border border-gray-300;
}

.blog-content table td {
  @apply p-3 border border-gray-300;
}

.blog-content ul,
.blog-content ol {
  @apply mb-4 pl-6 space-y-2;
}

.blog-content ul {
  @apply list-disc;
}

.blog-content ol {
  @apply list-decimal;
}

.blog-content li {
  @apply leading-relaxed;
}

.blog-content blockquote {
  @apply border-l-4 border-blue-500 pl-4 italic text-gray-600 my-4;
}

.blog-content code {
  @apply bg-gray-100 px-2 py-1 rounded text-sm font-mono;
}

.blog-content pre {
  @apply bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto my-4;
}

.blog-content pre code {
  @apply bg-transparent text-gray-100 p-0;
}

.blog-content hr {
  @apply border-gray-300 my-8;
}

.blog-content strong {
  @apply font-semibold text-gray-900;
}

.blog-content em {
  @apply italic;
}

/* Responsive images in blog content */
.blog-content img {
  @apply max-w-full h-auto;
}

/* Ensure iframes (videos, embeds) are responsive */
.blog-content iframe {
  @apply w-full max-w-full;
  aspect-ratio: 16 / 9;
}

/* Style TinyMCE media embeds */
.blog-content .mce-preview-object {
  @apply w-full my-6;
}

/* Prevent full-page widget on all mobile devices */
@media (max-width: 768px) {
  #max-widget {
    position: fixed !important;
    width: calc(100vw - 20px) !important;
    max-width: 340px !important;
    max-height: 75vh !important;
    height: auto !important;
    bottom: 10px !important;
    right: 10px !important;
    left: auto !important;
    top: auto !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    overflow: hidden !important;
  }
  
  /* Make minimized icon MUCH bigger on mobile - MAXIMUM SIZE */
  #tawkchat-minified-wrapper,
  body #tawkchat-minified-wrapper,
  html body #tawkchat-minified-wrapper,
  [id="tawkchat-minified-wrapper"] {
    min-width: 150px !important;
    min-height: 150px !important;
    width: 150px !important;
    height: 150px !important;
    max-width: 150px !important;
    max-height: 150px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  
  /* Force ALL child elements to be large - VERY aggressive with high specificity */
  #tawkchat-minified-wrapper *,
  body #tawkchat-minified-wrapper *,
  html body #tawkchat-minified-wrapper *,
  [id="tawkchat-minified-wrapper"] *,
  #tawkchat-minified-wrapper div,
  #tawkchat-minified-wrapper span,
  #tawkchat-minified-wrapper button,
  #tawkchat-minified-wrapper a,
  #tawkchat-minified-wrapper svg,
  #tawkchat-minified-wrapper img,
  #tawkchat-minified-wrapper i,
  #tawkchat-minified-wrapper canvas {
    width: 150px !important;
    height: 150px !important;
    min-width: 150px !important;
    min-height: 150px !important;
    max-width: 150px !important;
    max-height: 150px !important;
    font-size: 70px !important;
    line-height: 150px !important;
    box-sizing: border-box !important;
  }
  
  /* Ensure text is readable and properly oriented */
  #tawkchat-container *,
  #max-widget *,
  iframe[id*="tawk"] * {
    text-orientation: mixed !important;
    writing-mode: horizontal-tb !important;
    direction: ltr !important;
    text-align: left !important;
  }
  
  /* Remove hash-based full-page mode */
  html:has(body > #max-widget),
  body:has(#max-widget) {
    overflow: visible !important;
    height: auto !important;
  }
}
