/**
 * ULMEX Theme - Main Stylesheet
 * Version: 1.0.0
 *
 * This file contains all custom CSS for the ULMEX WordPress theme.
 * The theme uses Tailwind CSS utility classes via CDN for layout and styling.
 *
 * NOTE: Add Tailwind CDN to header.php before wp_head():
 * <script src="https://cdn.tailwindcss.com"></script>
 * <script>
 *   tailwind.config = {
 *     theme: {
 *       extend: {
 *         screens: { xs: '475px' },
 *         colors: {
 *           primary: '#0f172a',
 *           secondary: '#1e3a8a',
 *           secondaryLight: '#2563eb',
 *           accent: '#ca8a04',
 *           accentHover: '#a16207',
 *           light: '#f8fafc'
 *         },
 *         fontFamily: {
 *           sans: ['Inter', 'sans-serif'],
 *           serif: ['Playfair Display', 'serif']
 *         }
 *       }
 *     }
 *   }
 * </script>
 */

/* ============================================
   ROOT VARIABLES
   ============================================ */
:root {
  /* Colors */
  --color-primary: #0f172a;
  --color-secondary: #1e3a8a;
  --color-secondary-light: #2563eb;
  --color-accent: #ca8a04;
  --color-accent-hover: #a16207;
  --color-light: #f8fafc;

  /* Fonts */
  --font-sans: 'Inter', sans-serif;
  --font-serif: 'Playfair Display', serif;
}

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

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Better focus states */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Screen reader only utility */
.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;
}

.sr-only:not(:focus):not(:active) {
  clip: rect(0, 0, 0, 0);
}

/* ============================================
   HERO SECTION
   ============================================ */

/* Hero background image effect */
.hero-bg {
  background-image: linear-gradient(rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.7)),
                    url('https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* ============================================
   CURRENCY FALLING ANIMATION
   ============================================ */

.currency-fall {
  position: absolute;
  top: -50px;
  font-size: 24px;
  font-weight: bold;
  color: rgba(202, 138, 4, 0.15);
  pointer-events: none;
  animation: fall linear infinite;
}

/* Individual currency positions and delays */
.currency-1 { left: 5%; animation-duration: 12s; animation-delay: 0s; }
.currency-2 { left: 15%; animation-duration: 15s; animation-delay: 2s; font-size: 20px; }
.currency-3 { left: 25%; animation-duration: 11s; animation-delay: 4s; }
.currency-4 { left: 35%; animation-duration: 13s; animation-delay: 1s; font-size: 28px; }
.currency-5 { left: 45%; animation-duration: 14s; animation-delay: 3s; }
.currency-6 { left: 55%; animation-duration: 12s; animation-delay: 5s; font-size: 22px; }
.currency-7 { left: 65%; animation-duration: 16s; animation-delay: 2.5s; }
.currency-8 { left: 75%; animation-duration: 13s; animation-delay: 4.5s; font-size: 26px; }
.currency-9 { left: 85%; animation-duration: 11s; animation-delay: 1.5s; }
.currency-10 { left: 10%; animation-duration: 14s; animation-delay: 3.5s; font-size: 20px; }
.currency-11 { left: 20%; animation-duration: 15s; animation-delay: 0.5s; }
.currency-12 { left: 40%; animation-duration: 12s; animation-delay: 4.8s; font-size: 24px; }
.currency-13 { left: 60%; animation-duration: 13s; animation-delay: 2.2s; }
.currency-14 { left: 70%; animation-duration: 11s; animation-delay: 3.8s; font-size: 22px; }
.currency-15 { left: 90%; animation-duration: 14s; animation-delay: 1.2s; }

@keyframes fall {
  0% {
    top: -50px;
    opacity: 0;
    transform: translateX(0) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    top: 100vh;
    opacity: 0;
    transform: translateX(100px) rotate(360deg);
  }
}

/* ============================================
   CARD EFFECTS
   ============================================ */

/* Card hover effect */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ============================================
   WAVE DIVIDERS
   ============================================ */

.custom-shape-divider-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  transform: rotate(180deg);
}

.custom-shape-divider-bottom svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 60px;
}

.custom-shape-divider-bottom .shape-fill {
  fill: #FFFFFF;
}

/* Fix sub-pixel gap between hero wave SVG and next section */
section > .absolute:last-child svg,
section > .wave-bottom svg {
  display: block;
  margin-bottom: -1px;
}
section > .absolute:last-child,
section > .wave-bottom {
  bottom: -1px;
}

/* ============================================
   CUSTOM LIST STYLES
   ============================================ */

.custom-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.custom-list li::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 0.2rem;
  color: var(--color-accent);
  font-size: 0.9rem;
}

/* ============================================
   PHONE WIDGET
   ============================================ */

/* Phone widget pulse animation */
.phone-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.7;
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
  z-index: -1;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* ============================================
   RESPONSIVE TYPOGRAPHY
   ============================================ */

.text-responsive-xl {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

.text-responsive-2xl {
  font-size: clamp(1.75rem, 5vw, 3rem);
}

.text-responsive-3xl {
  font-size: clamp(2rem, 6vw, 3.75rem);
}

/* ============================================
   NAVIGATION STYLES
   ============================================ */

/* Logo filter for blue version */
.logo-blue {
  filter: brightness(0) saturate(100%) invert(9%) sepia(27%) saturate(4074%) hue-rotate(201deg) brightness(92%) contrast(100%);
}

/* Active navigation link */
.nav-link {
  position: relative;
}

.active-link {
  color: var(--color-secondary) !important;
  font-weight: 600;
}

.active-link::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent);
}

/* Desktop dropdown menu visible state */
#services-dropdown:hover #services-menu,
#services-menu:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#services-dropdown:hover #services-chevron {
  transform: rotate(180deg);
}

/* ============================================
   PROSE / ARTICLE CONTENT STYLING
   ============================================ */

.prose {
  color: #1e293b;
  max-width: 65ch;
}

.prose p {
  margin-bottom: 1.25em;
  line-height: 1.8;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose h2 {
  margin-top: 2em;
  margin-bottom: 1em;
  font-size: 1.5em;
  font-weight: 700;
  color: #0f172a;
}

.prose h3 {
  margin-top: 1.6em;
  margin-bottom: 0.8em;
  font-size: 1.25em;
  font-weight: 600;
  color: #0f172a;
}

.prose h4 {
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  font-size: 1.1em;
  font-weight: 600;
  color: #0f172a;
}

.prose ul,
.prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

.prose li {
  margin-bottom: 0.5em;
  line-height: 1.7;
}

.prose li p {
  margin-bottom: 0.5em;
}

.prose strong {
  font-weight: 700;
  color: #1e293b;
}

.prose blockquote {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  padding-left: 1.25em;
  border-left: 4px solid var(--color-accent);
  font-style: italic;
  color: #475569;
}

.prose a {
  color: var(--color-secondary);
  text-decoration: underline;
  font-weight: 500;
}

.prose a:hover {
  color: var(--color-accent);
}

.prose img {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  border-radius: 0.75rem;
  max-width: 100%;
  height: auto;
}

.prose hr {
  margin-top: 2em;
  margin-bottom: 2em;
  border: 0;
  border-top: 1px solid #e2e8f0;
}

.prose table {
  width: 100%;
  margin-top: 2em;
  margin-bottom: 2em;
  border-collapse: collapse;
}

.prose thead {
  border-bottom: 2px solid #e2e8f0;
}

.prose th {
  padding: 0.75em;
  text-align: left;
  font-weight: 600;
  color: #0f172a;
}

.prose td {
  padding: 0.75em;
  border-bottom: 1px solid #e2e8f0;
}

.prose code {
  background: #f1f5f9;
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: 'Courier New', monospace;
  color: #e11d48;
}

.prose pre {
  background: #1e293b;
  color: #f1f5f9;
  padding: 1em;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.875em;
}

/* Fix for content without proper paragraph tags */
.prose > br {
  display: block;
  content: "";
  margin-bottom: 0.75em;
}

/* ============================================
   BACKGROUND PATTERNS
   ============================================ */

.bg-pattern-dots {
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239C92AC' fill-opacity='0.05' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

/* ============================================
   CUSTOM ANIMATIONS
   ============================================ */

@keyframes pulse-slow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse-slow {
  animation: pulse-slow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Slide in from left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

/* ============================================
   FORM STYLES
   ============================================ */

/* Custom form input styles */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-input:disabled {
  background-color: #f1f5f9;
  cursor: not-allowed;
}

.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 1rem;
  min-height: 120px;
  resize: vertical;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #1e293b;
}

.form-error {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-success {
  color: #16a34a;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

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

/* Aspect ratio utilities */
.aspect-video {
  aspect-ratio: 16 / 9;
}

.aspect-square {
  aspect-ratio: 1 / 1;
}

/* Object fit utilities */
.object-cover {
  object-fit: cover;
}

.object-contain {
  object-fit: contain;
}

/* Truncate text */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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;
}

/* Container utilities */
.container-custom {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container-custom {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-custom {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* ============================================
   RESPONSIVE UTILITIES (xs breakpoint)
   ============================================ */

@media (min-width: 475px) {
  .xs\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .xs\:flex-row {
    flex-direction: row;
  }

  .xs\:text-base {
    font-size: 1rem;
    line-height: 1.5rem;
  }

  .xs\:gap-4 {
    gap: 1rem;
  }
}

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

@media print {
  .no-print {
    display: none !important;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }

  abbr[title]:after {
    content: " (" attr(title) ")";
  }

  .page-break {
    page-break-after: always;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .currency-fall {
    animation: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .card-hover:hover {
    outline: 2px solid currentColor;
  }
}

/* ============================================
   DARK MODE SUPPORT (future enhancement)
   ============================================ */

@media (prefers-color-scheme: dark) {
  /* Dark mode styles can be added here in the future */
  /* Currently, the theme uses a light color scheme */
}

/* ============================================
   WORDPRESS ADMIN BAR FIX
   ============================================ */

.admin-bar nav {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar nav {
    top: 46px;
  }
}

/* ============================================
   IE11 FALLBACKS (if needed)
   ============================================ */

@supports not (display: grid) {
  .grid {
    display: flex;
    flex-wrap: wrap;
  }

  .grid > * {
    flex: 1 1 auto;
  }
}
