/*
Theme Name: ColdChain Pro
Theme URI: https://coldchainpro.com
Description: A modern WordPress theme for cold chain solutions and transport vehicles with complete admin management features. Fully compatible with WordPress 6.9.4.
Author: ColdChain Pro Team
Author URI: https://coldchainpro.com
Version: 1.2.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: coldchainpro
Tags: responsive-layout, modern-design, translation-ready, custom-background, custom-logo, custom-menu, featured-images, threaded-comments, block-styles, wp-block-styles, editor-style

External Resources (All Free/Open Source for Commercial Use):
- Font Awesome 6.7.2 Free - SIL OFL 1.1 (Icons) + MIT License (Code)
  License: https://fontawesome.com/license/free
  Website: https://fontawesome.com

- Tailwind CSS 3.4.1 - MIT License
  License: https://github.com/tailwindlabs/tailwindcss/blob/master/LICENSE
  Website: https://tailwindcss.com

Note: All external resources are loaded locally from /assets/css/font-awesome/
*/

/* Critical base styles to ensure proper rendering */
:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
  font-weight: 400;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Theme variables for WordPress 6.9+ compatibility */
  --wp--preset--color--primary: #3b82f6;
  --wp--preset--color--secondary: #10b981;
  --wp--preset--color--background: #ffffff;
  --wp--preset--color--foreground: #111827;
  --wp--preset--color--gray-50: #f9fafb;
  --wp--preset--color--gray-100: #f3f4f6;
  --wp--preset--color--gray-200: #e5e7eb;
  --wp--preset--color--gray-300: #d1d5db;
  --wp--preset--color--gray-400: #9ca3af;
  --wp--preset--color--gray-500: #6b7280;
  --wp--preset--color--gray-600: #4b5563;
  --wp--preset--color--gray-700: #374151;
  --wp--preset--color--gray-800: #1f2937;
  --wp--preset--color--gray-900: #111827;
}

 * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Ensure sticky header works properly when enabled */
.site-header.sticky {
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
  transition: all 0.3s ease;
}

/* Disable sticky behavior when not enabled */
.site-header:not(.sticky) {
  position: static !important;
}

html, body {
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  background-color: #ffffff;
  position: relative;
  z-index: 1;
  color: #333333;
}

/* WordPress required classes */
.alignnone {
  margin: 5px 20px 20px 0;
}

.aligncenter,
div.aligncenter {
  display: block;
  margin: 5px auto 5px auto;
}

.alignright {
  float: right;
  margin: 5px 0 20px 20px;
}

.alignleft {
  float: left;
  margin: 5px 20px 20px 0;
}

a img.alignright {
  float: right;
  margin: 5px 0 20px 20px;
}

a img.alignnone {
  margin: 5px 20px 20px 0;
}

a img.alignleft {
  float: left;
  margin: 5px 20px 20px 0;
}

a img.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.wp-caption {
  background: #fff;
  border: 1px solid #f0f0f0;
  max-width: 96%;
  padding: 5px 3px 10px;
  text-align: center;
}

.wp-caption.alignnone {
  margin: 5px 20px 20px 0;
}

.wp-caption.alignleft {
  margin: 5px 20px 20px 0;
}

.wp-caption.alignright {
  margin: 5px 0 20px 20px;
}

.wp-caption img {
  border: 0 none;
  height: auto;
  margin: 0;
  max-width: 98.5%;
  padding: 0;
  width: auto;
}

.wp-caption p.wp-caption-text {
  font-size: 11px;
  line-height: 17px;
  margin: 0;
  padding: 0 4px 5px;
}

/* Tailwind CSS base styles */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Additional theme styles */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Dark mode support - Enhanced with CSS variables for better consistency */
:root {
  --bg-color-light: #ffffff;
  --text-color-light: #333333;
  --bg-color-dark: #111827;
  --text-color-dark: #f3f4f6;
}

/* Base styles for light mode */
body {
  background-color: var(--bg-color-light);
  color: var(--text-color-light);
}

 /* Force dark mode styles when 'dark' class is present */
html.dark {
  background-color: var(--bg-color-dark);
  color: var(--text-color-dark);
}

/* High specificity dark mode styles to ensure they override other styles */
:is(html.dark, .dark) {
  --tw-bg-opacity: 1;
  background-color: var(--bg-color-dark);
  color: var(--text-color-dark);
}

/* High specificity for dark mode text colors */
:is(html.dark, .dark) body,
:is(html.dark, .dark) p,
:is(html.dark, .dark) span,
:is(html.dark, .dark) div,
:is(html.dark, .dark) h1,
:is(html.dark, .dark) h2,
:is(html.dark, .dark) h3,
:is(html.dark, .dark) h4,
:is(html.dark, .dark) h5,
:is(html.dark, .dark) h6 {
  color: var(--text-color-dark);
}

/* High specificity for dark mode background colors */
:is(html.dark, .dark) .bg-white {
  background-color: #1f2937 !important;
}

:is(html.dark, .dark) .bg-gray-50 {
  background-color: #111827 !important;
}

:is(html.dark, .dark) .bg-gray-100 {
  background-color: #374151 !important;
}

/* Ensure search overlay is properly displayed */
#search-overlay {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 9999; /* Ensure it's always on top */
}

#search-overlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

 /* Additional dark mode styles for all elements when dark class is present */
.dark,
html.dark body {
  color-scheme: dark;
  background-color: var(--bg-color-dark);
  color: var(--text-color-dark);
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  html.system-theme-detection:not(.light) {
    background-color: var(--bg-color-dark);
    color: var(--text-color-dark);
  }
}

/* Ensure proper z-index stacking */
#home-banner {
  position: relative;
  z-index: 1;
}

#home-banner > div:first-child {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Hide WordPress admin bar by default */
#wpadminbar {
  display: none !important;
  height: 0 !important;
}

html {
  margin-top: 0 !important;
}

/* Green checkmark icon styling */
.fa-check-circle.text-green-500 {
  color: #22c55e !important;
  font-size: 1.125rem;
}

/* 高优先级样式确保advantage区域文字始终可见 */
.about-preview-advantages span {
  color: inherit !important;
  font-weight: 500 !important;
  font-size: 1rem !important;
  z-index: 10 !important;
  position: relative !important;
  display: inline-block !important;
}

/* 确保advantage容器在所有主题下都清晰可见 */
.about-preview-advantages {
  z-index: 10;
  position: relative;
}

/* Animation classes for all pages */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  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);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.8s ease forwards;
  opacity: 0;
}

/* Contact Form Styles - Matching React Version */
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#contact-form .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  #contact-form .grid.md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

#contact-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  color: theme('colors.gray.700');
}

.dark #contact-form label {
  color: theme('colors.gray.300');
}

#contact-form input:not([type="hidden"]),
#contact-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid theme('colors.gray.300');
  background-color: theme('colors.white');
  color: theme('colors.gray.900');
  font-size: 1rem;
  line-height: 1.5rem;
  transition: all 0.3s ease;
}

.dark #contact-form input:not([type="hidden"]),
.dark #contact-form textarea {
  background-color: theme('colors.gray.800');
  border-color: theme('colors.gray.700');
  color: theme('colors.white');
}

#contact-form input:focus:not([type="hidden"]),
#contact-form textarea:focus {
  outline: none;
  border-color: theme('colors.blue.500');
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dark #contact-form input:focus:not([type="hidden"]),
.dark #contact-form textarea:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

#contact-form textarea {
  resize: none;
  min-height: 120px;
}

#contact-submit {
  width: 100%;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  background-color: theme('colors.blue.500');
  color: theme('colors.white');
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  transform: scale(1);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

#contact-submit:hover:not(:disabled) {
  background-color: theme('colors.blue.600');
  transform: scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

#contact-submit:active:not(:disabled) {
  transform: scale(0.98);
}

#contact-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: scale(1);
}

/* Form message styles */
.form-message {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 50;
  transition: opacity 0.3s ease;
}

.form-message.bg-green-100 {
  background-color: theme('colors.green.100');
  border: 1px solid theme('colors.green.200');
  color: theme('colors.green.700');
}

.form-message.bg-red-100 {
  background-color: theme('colors.red.100');
  border: 1px solid theme('colors.red.200');
  color: theme('colors.red.700');
}

.dark .form-message.bg-green-100 {
  background-color: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.2);
  color: theme('colors.green.400');
}

.dark .form-message.bg-red-100 {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: theme('colors.red.400');
}

/* Ensure form styles are applied to the homepage contact form as well */
section#contact #contact-form {
  background-color: theme('colors.white');
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.dark section#contact #contact-form {
  background-color: theme('colors.gray.900');
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.animate-slideInLeft {
  animation: slideInLeft 0.8s ease forwards;
  opacity: 0;
}

.animate-slideInRight {
  animation: slideInRight 0.8s ease forwards;
  opacity: 0;
}