@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap');

/* Hero Content Styles */
.hero-content h1 {
    font-size: 2.25rem; /* text-4xl */
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-content p {
    font-size: 1.125rem; /* text-lg */
    font-weight: 400;
}

@media (min-width: 768px) {
    .hero-content h1 {
        font-size: 3rem; /* text-5xl */
    }
    
    .hero-content p {
        font-size: 1.25rem; /* text-xl */
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #F9FAFB;
    color: #1F2937;
    line-height: 1.6;
    scroll-behavior: smooth;
}
html[dir="rtl"] body { direction: rtl; }
html[dir="ltr"] body { direction: ltr; }
/* Prevent horizontal overflow on mobile and ensure header matches viewport width */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Offset for fixed header to prevent overlap on mobile and desktop */
:root {
    --header-height: 72px;
}

/* Resources Layout Responsive */
.resources-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .resources-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .resources-layout .sidebar {
        position: static !important;
        order: 2;
    }
    
    .resources-layout .main-content {
        order: 1;
    }
}

@media (min-width: 768px) {
    :root {
        --header-height: 88px;
    }
}

body {
    padding-top: var(--header-height);
}

/* Override Tailwind's font classes to use Vazirmatn */
.font-sans,
.font-serif,
.font-mono,
.font-thin,
.font-extralight,
.font-light,
.font-normal,
.font-medium,
.font-semibold,
.font-bold,
.font-extrabold,
.font-black {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Header Styles */
header {
    background: #FFFFFF;
    border-bottom: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

/* Header layout improvements */
header nav .flex.items-center.justify-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Brand logo and text */
header nav .flex.items-center.gap-2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Desktop navigation */
header nav ul.hidden.md\:flex {
    display: none;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (min-width: 768px) {
    header nav ul.hidden.md\:flex {
        display: flex;
    }
}

/* Language switcher positioning */
header nav .flex.items-center.gap-2.order-3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
header img[alt="PISHRO"] { max-height: 44px; height: auto; width: auto; }
img { max-width: 100%; height: auto; }

/* Mobile Menu Styles */
#mobile-menu {
    transition: all 0.3s ease;
    display: none;
}

#mobile-menu.show {
    display: block !important;
}

#mobile-menu-btn {
    transition: all 0.3s ease;
    cursor: pointer;
}

#mobile-menu-btn:hover {
    transform: scale(1.1);
}

/* Language Switcher Styles */
.language-switcher {
    display: flex;
    align-items: center;
}

/* Desktop language switcher spacing */
@media (min-width: 769px) {
    .language-switcher {
        margin: 0 1rem;
    }
    
    /* Add spacing between language switcher and adjacent elements */
    .language-switcher + *,
    * + .language-switcher {
        margin-left: 1rem;
        margin-right: 0;
    }
    
    /* RTL spacing adjustments */
    .direction-rtl .language-switcher + *,
    .direction-rtl * + .language-switcher {
        margin-right: 1rem;
        margin-left: 0;
    }
    
    /* LTR spacing adjustments */
    .direction-ltr .language-switcher + *,
    .direction-ltr * + .language-switcher {
        margin-left: 1rem;
        margin-right: 0;
    }
}

.language-switcher .lang-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #374151;
    white-space: nowrap;
}

.language-switcher .lang-btn:hover {
    background-color: #e5e7eb;
    color: #f59e0b;
    border-color: #f59e0b;
    transform: translateY(-1px);
}

.language-switcher .lang-btn.active {
    background-color: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.language-switcher .lang-btn.active:hover {
    background-color: #d97706;
    border-color: #d97706;
}

/* Mobile Language Switcher Styles */
@media (max-width: 768px) {
    /* Hide language switcher in main header on mobile */
    .language-switcher.hidden-mobile {
        display: none !important;
    }
    
    /* Style language switcher in mobile menu */
    #mobile-menu .language-switcher {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid #e5e7eb;
    }
    
    #mobile-menu .language-switcher .lang-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 1rem;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        color: #475569;
    }
    
    #mobile-menu .language-switcher .lang-btn:hover {
        background: #f1f5f9;
        border-color: #f59e0b;
        color: #f59e0b;
    }
}

/* Language-specific styles */
.lang-fa {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.lang-en {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.direction-rtl {
    direction: rtl;
    text-align: right;
}

.direction-ltr {
    direction: ltr;
    text-align: left;
}

/* RTL/LTR spacing handled explicitly for header nav below; avoid overriding Tailwind's space utilities globally */

/* RTL Header Layout - Keep logo centered on mobile */
.direction-rtl header nav .flex.justify-between { display: flex; }

/* RTL Logo and Brand positioning - Right side on mobile, center on desktop */
.direction-rtl header nav .flex.items-center.flex-shrink-0.md\\:mx-auto { align-items: center; }

.direction-rtl header nav .flex.items-center.flex-shrink-0.mx-auto.md\\:mx-0 img {
    margin-left: 0;
    margin-right: 0.75rem;
}

/* LTR Logo and Brand positioning - Logo after text */
.direction-ltr header nav .flex.items-center.flex-shrink-0.md\\:mx-auto img {
    margin-left: 0.75rem;
    margin-right: 0;
}

/* Order classes for logo positioning */
.rtl\\:order-1.ltr\\:order-2 {
    order: 1; /* Default for RTL */
}

.direction-ltr .rtl\\:order-1.ltr\\:order-2 {
    order: 2; /* Logo after text in LTR */
}

.rtl\\:order-2.ltr\\:order-1 {
    order: 2; /* Default for RTL */
}

.direction-ltr .rtl\\:order-2.ltr\\:order-1 {
    order: 1; /* Text before logo in LTR */
}

/* RTL Navigation spacing */
.direction-rtl header nav ul.hidden.md\:flex {
    flex-direction: row;
}

.direction-rtl header nav ul.hidden.md\:flex > li + li {
    margin-right: 0;
    margin-left: 2rem;
}

/* RTL Right side elements */
.direction-rtl header nav .flex.items-center.space-x-4.space-x-reverse {
    flex-direction: row-reverse;
}

.direction-rtl header nav .flex.items-center.space-x-4.space-x-reverse > * + * {
    margin-right: 0;
    margin-left: 1rem;
}

/* Desktop navigation spacing - Add space between nav items */
@media (min-width: 769px) {
    /* Explicit spacing for both directions to avoid conflicts */
    header nav ul.hidden.md\:flex > li + li {
        margin-left: 1rem;
    }
    .direction-rtl header nav ul.hidden.md\:flex > li + li {
        margin-left: 0;
        margin-right: 1rem;
    }
    
    /* Better spacing for CTA button */
    header nav ul.hidden.md\:flex > li:has(a[href="contact.php"]) {
        margin-left: 1.5rem;
    }
    .direction-rtl header nav ul.hidden.md\:flex > li:has(a[href="contact.php"]) {
        margin-left: 0;
        margin-right: 1.5rem;
    }

    /* Add spacing between language switcher and navigation items */
    .language-switcher + nav ul.hidden.md\:flex,
    nav ul.hidden.md\:flex + .language-switcher {
        margin-left: 1.5rem;
        margin-right: 0;
    }
    
    /* RTL spacing between language switcher and navigation */
    .direction-rtl .language-switcher + nav ul.hidden.md\:flex,
    .direction-rtl nav ul.hidden.md\:flex + .language-switcher {
        margin-right: 1.5rem;
        margin-left: 0;
    }
    
    /* LTR spacing between language switcher and navigation */
    .direction-ltr .language-switcher + nav ul.hidden.md\:flex,
    .direction-ltr nav ul.hidden.md\:flex + .language-switcher {
        margin-left: 1.5rem;
        margin-right: 0;
    }
}

/* Fallback layout if Tailwind fails to load (ensures header/nav usable) */
/* Container centering */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Header nav list baseline */
nav ul.hidden.md\:flex {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Hide on mobile, show as flex on desktop */
@media (max-width: 768px) {
    nav ul.hidden.md\:flex {
        display: none;
    }
}

@media (min-width: 769px) {
    nav ul.hidden.md\:flex {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
}

/* Ensure mobile menu list has no bullets */
#mobile-menu ul {
    list-style: none;
}

/* --- Utility fallbacks (minimal Tailwind emulation) --- */
.fixed { position: fixed !important; }
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.top-0 { top: 0 !important; }
.inset-0 { top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; }
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.h-screen { height: 100vh !important; }
.z-50 { z-index: 50 !important; }
.flex { display: flex !important; }
.items-center { align-items: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.text-center { text-align: center !important; }
.gap-8 { gap: 2rem !important; }
.gap-4 { gap: 1rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.hidden { display: none !important; }
.block { display: block !important; }

/* Order utilities */
.order-1 { order: 1 !important; }
.order-2 { order: 2 !important; }
.order-3 { order: 3 !important; }

/* Space between flex children (space-x-4) */
.space-x-4 > * + * { margin-left: 1rem !important; }
.space-x-reverse > * + * { margin-left: 0 !important; margin-right: 1rem !important; }

/* Responsive visibility fallbacks */
@media (min-width: 769px) {
  .md\:flex { display: flex !important; }
  .md\:hidden { display: none !important; }
}

/* Typography quick fixes */
.text-white { color: #ffffff !important; }
.text-gray-700 { color: #374151 !important; }
.bg-white { background-color: #ffffff !important; }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05) !important; }

/* Mobile responsive styles */
@media (max-width: 768px) {
    /* Header mobile styles */
    header nav {
        padding: 0.5rem 1rem;
    }
    
    header nav .container {
        padding: 0;
    }
    
    /* Logo and brand - right side on mobile, center on desktop */
    header nav .flex.items-center.flex-shrink-0.md\:mx-auto {
        flex-shrink: 0;
        margin: 0;
        min-width: 0;
        flex: 0 0 auto;
    }
    
    header nav .flex.items-center.flex-shrink-0.mx-auto.md\:mx-0 img {
        height: 2rem;
        width: auto;
        flex-shrink: 0;
    }
    
    header nav .flex.items-center.flex-shrink-0.mx-auto.md\:mx-0 a {
        font-size: 1.5rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Mobile menu button - left side */
    header nav .flex.items-center.md\:hidden {
        flex-shrink: 0;
        flex: 0 0 auto;
        min-width: 0;
    }
    
    /* Mobile menu button styling */
    #mobile-menu-btn {
        display: block !important;
        padding: 0.5rem;
        border: none;
        background: transparent;
        cursor: pointer;
        flex-shrink: 0;
        z-index: 60;
        width: auto;
        height: auto;
        min-width: 44px; /* Touch target size */
        min-height: 44px;
    }
    
    /* Mobile menu container */
    #mobile-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 50;
        max-height: calc(100vh - 100%);
        overflow-y: auto;
    }
    
    #mobile-menu.show {
        display: block !important;
    }
    
    /* Hide language switcher in main header on mobile */
    .language-switcher.hidden-mobile {
        display: none !important;
    }
    
    /* Language switcher mobile */
    .language-switcher-compact {
        flex-shrink: 0;
        margin: 0 0.5rem;
    }
    
    .language-switcher-compact .current-lang {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .language-switcher-compact .dropdown {
        right: auto;
        left: 0;
        min-width: 100px;
    }
    
    /* CTA button mobile */
    .bg-custom-orange, .bg-orange-500 {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    /* Hide desktop navigation */
    nav ul.hidden.md\:flex {
        display: none !important;
    }
    
    /* Mobile menu */
    #mobile-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 50;
    }
    
    #mobile-menu ul {
        padding: 1rem;
    }
    
    #mobile-menu ul li {
        margin: 0.5rem 0;
    }
    
    #mobile-menu ul li a {
        display: block;
        padding: 0.75rem 1rem;
        border-radius: 0.375rem;
        transition: all 0.2s ease;
    }
    
    #mobile-menu ul li a:hover {
        background-color: #f3f4f6;
    }
    
    /* Fix mobile header layout */
    header nav .flex.items-center.space-x-4.space-x-reverse.flex-shrink-0 {
        gap: 0.5rem;
        flex-wrap: nowrap;
        align-items: center;
    }
    
    /* Ensure proper spacing between elements */
    header nav .flex.items-center.space-x-4.space-x-reverse.flex-shrink-0 > * {
        margin: 0;
    }
    
    /* Prevent text wrapping */
    header nav .flex.items-center.space-x-4.space-x-reverse.flex-shrink-0 > * {
        white-space: nowrap;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    header nav {
        padding: 0.25rem 0.5rem;
    }
    
    header nav .flex.items-center a {
        font-size: 1.25rem;
    }
    
    .language-switcher-compact .current-lang {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .bg-custom-orange, .bg-orange-500 {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    /* Even tighter spacing for very small screens */
    header nav .flex.items-center.space-x-4.space-x-reverse > * {
        margin: 0.15rem;
    }
}

/* Force button visibility on mobile */
@media (max-width: 768px) {
    #mobile-menu-btn {
        display: block !important;
    }
    
    .language-switcher {
        margin: 0 0.5rem;
    }
    
    .language-switcher .lang-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    /* Add some spacing between logo and language switcher */
    header nav .flex.items-center {
        margin-right: 1rem;
    }
    
    /* Ensure language switcher doesn't overlap with logo */
    .language-switcher {
        margin-left: 0.5rem;
    }
}

@media (min-width: 769px) {
    #mobile-menu-btn {
        display: none !important;
    }
    
    #mobile-menu {
        display: none !important;
    }
}

nav ul li a {
    font-weight: 500;
    color: #374151;
    transition: all 0.3s ease;
    position: relative;
}

/* Ensure library CTA is always visible regardless of theme overrides */
.header-library-cta {
    background-color: #f97316 !important; /* orange-500 */
    color: #ffffff !important;
}
.header-library-cta:hover {
    background-color: #ea580c !important; /* orange-600 */
    color: #ffffff !important;
}

/* Catalog & Training button styles */
a[href="resources.php"] {
    background: linear-gradient(135deg, #f97316, #dc2626) !important;
    color: #ffffff !important;
    transition: all 0.3s ease !important;
}

a[href="resources.php"]:hover {
    background: linear-gradient(135deg, #ea580c, #b91c1c) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4) !important;
}

nav ul li a:hover {
    color: #f37021;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    right: 0;
    background-color: #f37021;
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

/* Hero Slider - Bootstrap Carousel */
.carousel {
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.carousel-inner {
    height: 100%;
}

.carousel-item {
    height: 100%;
    position: relative;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Bootstrap Carousel Controls */
.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
}

.carousel-control-prev {
    left: 20px;
}

.carousel-control-next {
    right: 20px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Bootstrap Carousel Indicators */
.carousel-indicators {
    bottom: 20px;
    z-index: 20;
    margin-bottom: 0;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    margin: 0 5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.carousel-indicators button.active {
    background: #f37021 !important;
    opacity: 1 !important;
}

.carousel-indicators button:hover {
    background: rgba(255, 255, 255, 0.8);
    opacity: 1 !important;
}

/* Fix for custom indicator classes */
#heroSlider .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    margin: 0 5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

#heroSlider .carousel-indicators button.active {
    background: #f37021 !important;
    opacity: 1 !important;
}

#heroSlider .carousel-indicators button:hover {
    background: rgba(255, 255, 255, 0.8);
    opacity: 1 !important;
}

/* Fix for Bootstrap Carousel in our layout */
#heroSlider {
    position: relative;
    height: calc(100vh - 80px) !important;
    overflow: hidden;
}

#heroSlider .carousel-inner {
    height: 100% !important;
}

#heroSlider .carousel-item {
    height: 100% !important;
    position: relative;
}

#heroSlider .carousel-item.active {
    display: block;
}

#heroSlider .carousel-item:not(.active) {
    display: none;
}

/* Ensure background images display properly */
#heroSlider .carousel-item .absolute.inset-0 {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 1;
}

/* Fix z-index for content */
#heroSlider .carousel-item .relative.z-10 {
    position: relative !important;
    z-index: 10 !important;
}

/* Legacy Swiper styles for backward compatibility */
.swiper-container {
    position: relative;
    height: 100vh;
    overflow: hidden;
    background: #4c4b4c;
}

/* Ensure all slides are visible */
.swiper-slide {
    position: relative;
    overflow: hidden;
    opacity: 1 !important;
    visibility: visible !important;
}

.swiper-slide {
    position: relative;
    overflow: hidden;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1 !important;
}

/* Fix slider image display in English mode */
.direction-ltr .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.direction-rtl .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Ensure slider works properly in both languages */
.lang-en .swiper-container,
.lang-fa .swiper-container {
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.lang-en .swiper-slide,
.lang-fa .swiper-slide {
    position: relative;
    overflow: hidden;
}

.lang-en .swiper-slide img,
.lang-fa .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1 !important;
}

.swiper-slide:hover img {
    transform: scale(1.05);
}

.swiper-button-prev, .swiper-button-next {
    color: #FFFFFF;
    background: rgba(243, 112, 33, 0.8);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

/* Fix navigation buttons in both language modes */
.direction-ltr .swiper-button-prev,
.direction-ltr .swiper-button-next,
.direction-rtl .swiper-button-prev,
.direction-rtl .swiper-button-next {
    color: #FFFFFF;
    background: rgba(243, 112, 33, 0.8);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.lang-en .swiper-button-prev,
.lang-en .swiper-button-next,
.lang-fa .swiper-button-prev,
.lang-fa .swiper-button-next {
    color: #FFFFFF;
    background: rgba(243, 112, 33, 0.8);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.swiper-button-prev:hover, .swiper-button-next:hover {
    background: #f37021;
    transform: scale(1.1);
}

/* Fix pagination in both language modes */
.direction-ltr .swiper-pagination,
.direction-rtl .swiper-pagination,
.lang-en .swiper-pagination,
.lang-fa .swiper-pagination {
    z-index: 10;
}

/* Fix slider content display in both language modes */
.direction-ltr .swiper-slide .text-center,
.direction-rtl .swiper-slide .text-center,
.lang-en .swiper-slide .text-center,
.lang-fa .swiper-slide .text-center {
    z-index: 5;
    position: relative;
}

/* Ensure slider text is visible in both languages */
.direction-ltr .swiper-slide h1,
.direction-ltr .swiper-slide p,
.direction-rtl .swiper-slide h1,
.direction-rtl .swiper-slide p,
.lang-en .swiper-slide h1,
.lang-en .swiper-slide p,
.lang-fa .swiper-slide h1,
.lang-fa .swiper-slide p {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    position: relative;
    z-index: 5;
}

/* Fix slider overlay in both languages */
.direction-ltr .swiper-slide .absolute.inset-0,
.direction-rtl .swiper-slide .absolute.inset-0,
.lang-en .swiper-slide .absolute.inset-0,
.lang-fa .swiper-slide .absolute.inset-0 {
    z-index: 1;
}

/* Ensure slider buttons work in both languages */
.direction-ltr .swiper-slide .bg-custom-orange,
.direction-rtl .swiper-slide .bg-custom-orange,
.lang-en .swiper-slide .bg-custom-orange,
.lang-fa .swiper-slide .bg-custom-orange {
    position: relative;
    z-index: 5;
    display: inline-block;
}

/* Final fixes for slider in both language modes */
.direction-ltr .swiper-container,
.direction-rtl .swiper-container,
.lang-en .swiper-container,
.lang-fa .swiper-container {
    width: 100% !important;
    height: 100vh !important;
    position: relative !important;
    overflow: hidden !important;
    background: #4c4b4c !important;
}

.direction-ltr .swiper-wrapper,
.direction-rtl .swiper-wrapper {
    width: 100% !important;
    height: 100% !important;
}

.direction-ltr .swiper-slide,
.direction-rtl .swiper-slide,
.lang-en .swiper-slide,
.lang-fa .swiper-slide {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Force proper image sizing in both languages */
.direction-ltr .swiper-slide img,
.direction-rtl .swiper-slide img,
.lang-en .swiper-slide img,
.lang-fa .swiper-slide img,
.swiper-slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1 !important;
    position: relative !important;
}

.swiper-pagination-bullet {
    background: #FFFFFF;
    opacity: 0.7;
    width: 12px;
    height: 12px;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background: #f37021;
}

/* Additional fixes for slider visibility in both languages */
.swiper-container .swiper-slide {
    opacity: 1 !important;
    visibility: visible !important;
}

.swiper-container .swiper-slide img {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Ensure slider works in both RTL and LTR */
[dir="rtl"] .swiper-slide img,
[dir="ltr"] .swiper-slide img {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Section Styles */
section {
    scroll-margin-top: 80px;
    padding: 5rem 0;
}

/* Remove default section padding for the homepage hero */
.hero-section {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1F2937;
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #f37021, #e55a1a);
    border-radius: 2px;
}

/* Card Styles */
.card {
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Admin dashboard cards */
.admin-dashboard .card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.admin-dashboard .card .text-center {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.5rem;
}

.admin-dashboard .card h3 {
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

.admin-dashboard .card p {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.admin-dashboard .card a {
    margin-top: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

/* General admin cards styling */
.admin-page .card,
.admin-page .bg-white.p-6.rounded-lg.shadow {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.admin-page .card .text-center,
.admin-page .bg-white.p-6.rounded-lg.shadow .text-center {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.5rem;
}

.admin-page .card h3,
.admin-page .bg-white.p-6.rounded-lg.shadow h3 {
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}

.admin-page .card p,
.admin-page .bg-white.p-6.rounded-lg.shadow p {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.admin-page .card a,
.admin-page .bg-white.p-6.rounded-lg.shadow a {
    margin-top: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

.card:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.4s ease;
    flex-shrink: 0;
}

/* Ensure product listing images show fully without cropping */
.products-grid .card .product-image,
.products-grid .card picture .product-image,
.products-grid .card img.product-image {
    height: 14rem; /* matches h-56 */
    object-fit: contain;
    background-color: #f3f4f6; /* subtle gray letterbox */
}

/* Consistent 4:3 aspect ratio container for product thumbnails */
.products-grid .card .aspect-4-3,
.aspect-4-3 {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 ratio */
    background-color: #f7f7f7;
    overflow: hidden;
}
.products-grid .card .aspect-4-3 > *,
.aspect-4-3 > * {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}
.products-grid .card .aspect-4-3 img.product-image,
.aspect-4-3 img.thumb-image,
.aspect-4-3 picture img,
.aspect-4-3 .product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Disable hover zoom for product list thumbnails to avoid perceived crop */
.products-grid .card:hover img.product-image,
.card:hover img.thumb-image {
    transform: none;
}

/* Guard: prevent unintended rotations on hero cover images */
.hero-cover-image {
    transform: none !important;
}

.card:hover img {
    transform: scale(1.08);
}

.card .p-6 {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.5rem;
}

.card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.card p {
    font-size: 1rem;
    color: #6B7280;
    line-height: 1.7;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.card .flex.space-x-4.space-x-reverse {
    margin-top: auto;
    flex-shrink: 0;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, #f37021, #e55a1a);
    color: #FFFFFF;
    padding: 0.875rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(243, 112, 33, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(243, 112, 33, 0.4);
    background: linear-gradient(135deg, #e55a1a, #f37021);
}

.btn-secondary {
    background: transparent;
    color: #f37021;
    padding: 0.875rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #f37021;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: #f37021;
    color: #FFFFFF;
    transform: translateY(-2px);
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: #F8FAFC;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f37021;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: #6B7280;
    font-weight: 500;
}

/* Product Cards */
.product-card {
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.product-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(76, 75, 76, 0.7), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-icon {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    color: #FFFFFF;
    font-size: 2rem;
    z-index: 2;
}

.product-content {
    padding: 2rem;
}

.product-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 1rem;
}

.product-description {
    color: #6B7280;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.product-features {
    list-style: none;
    margin-bottom: 1.5rem;
}

.product-features li {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #6B7280;
    font-size: 0.875rem;
}

.product-features li i {
    color: #10B981;
    margin-left: 0.5rem;
    font-size: 0.75rem;
}

/* Project Gallery */
.project-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
}

.project-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.project-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-item:hover .project-image {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(76, 75, 76, 0.8), rgba(76, 75, 76, 0.4), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
}

.project-item:hover .project-overlay {
    opacity: 1;
}

.project-info {
    padding: 1.5rem;
    color: #FFFFFF;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-description {
    font-size: 0.875rem;
    color: #E5E7EB;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #1E40AF, #3B82F6);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.cta-content {
    position: relative;
    z-index: 2;
}

/* Contact Section */
.contact-section {
    background: linear-gradient(135deg, rgba(76, 75, 76, 0.8), rgba(76, 75, 76, 0.8)), url('../images/contact-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 6rem 0;
    position: relative;
}

.contact-section h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #FFFFFF;
    text-align: center;
    margin-bottom: 1rem;
}

.contact-section p {
    font-size: 1.25rem;
    color: #E2E8F0;
    text-align: center;
    margin-bottom: 3rem;
}

.contact-form {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #F9FAFB;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
    background: #FFFFFF;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Footer Styles */
footer {
    background: #4c4b4c;
    color: #F9FAFB;
    padding: 4rem 0 2rem;
}

footer h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #FFFFFF;
}

footer p {
    color: #D1D5DB;
    line-height: 1.7;
    margin-bottom: 1rem;
}

footer a {
    color: #9CA3AF;
    transition: color 0.3s ease;
    text-decoration: none;
}

footer a:hover {
    color: #FFFFFF;
}

footer .social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

footer .social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #374151;
    transition: all 0.3s ease;
    font-size: 1.125rem;
}

footer .social-icons a:hover {
    background: #2563EB;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    margin-top: 3rem;
    text-align: center;
    color: #9CA3AF;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-content h1 {
        font-size: 3.5rem;
    }
    
    section h2 {
        font-size: 2.25rem;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    section h2 {
        font-size: 2rem;
    }

    .product-title {
        font-size: 1.25rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-form {
        padding: 2rem;
        margin: 0 1rem;
    }
}

@media (max-width: 640px) {
    nav ul {
        flex-direction: column;
        align-items: flex-end;
        gap: 1rem;
    }

    .swiper-slide img {
        height: 80vh;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 0.875rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .product-content {
        padding: 1.5rem;
    }
    
    .contact-section h1 {
        font-size: 2rem;
    }
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: #2563EB;
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: #1D4ED8;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

/* Modern Software Company Colors */
.bg-custom-blue { background-color: #2563eb !important; }
.hover-bg-custom-blue:hover { background-color: #1d4ed8 !important; }
.text-custom-blue { color: #2563eb !important; }
.hover-text-custom-blue:hover { color: #2563eb !important; }

.bg-custom-purple { background-color: #7c3aed !important; }
.hover-bg-custom-purple:hover { background-color: #6d28d9 !important; }
.text-custom-purple { color: #7c3aed !important; }
.hover-text-custom-purple:hover { color: #7c3aed !important; }

/* Legacy orange colors for backward compatibility */
.bg-custom-orange { background-color: #2563eb !important; }
.hover-bg-custom-orange:hover { background-color: #1d4ed8 !important; }
.text-custom-orange { color: #2563eb !important; }
.hover-text-custom-orange:hover { color: #2563eb !important; }

/* Custom gray utilities */
.bg-custom-gray { background-color: #4c4b4c !important; }
.hover-bg-custom-gray:hover { background-color: #3e3d3e !important; }

/* Admin Button Styles */
.btn-admin {
    background: linear-gradient(135deg, #f37021, #e55a1a) !important;
    color: #FFFFFF !important;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(243, 112, 33, 0.3);
}

.btn-admin:hover {
    background: linear-gradient(135deg, #e55a1a, #f37021) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(243, 112, 33, 0.4);
}

.btn-admin-secondary {
    background: transparent !important;
    color: #f37021 !important;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #f37021 !important;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-admin-secondary:hover {
    background: #f37021 !important;
    color: #FFFFFF !important;
    transform: translateY(-2px);
}

/* Custom styles for PISHRO website */

/* Grid layout improvements for equal height cards */
.grid.grid-cols-1.md\\:grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
    align-items: stretch;
}

@media (min-width: 768px) {
    .grid.grid-cols-1.md\\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Button text wrapping fixes */
.bg-custom-orange,
.bg-orange-600,
.bg-gray-600 {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: fit-content;
}

/* Ensure buttons in cards don't wrap text and fit properly */
.card .flex.space-x-4.space-x-reverse {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    margin-top: auto;
    padding-top: 1rem;
}

.card .flex.space-x-4.space-x-reverse a {
    white-space: nowrap !important;
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Specific adjustments for project cards */
.projects-page .card .flex.space-x-4.space-x-reverse a {
    font-size: 0.75rem;
    padding: 0.6rem 0.4rem;
    line-height: 1.2;
}

/* Responsive button adjustments */
@media (max-width: 768px) {
    .card .flex.space-x-4.space-x-reverse {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: auto;
        padding-top: 1rem;
    }
    
    .card .flex.space-x-4.space-x-reverse a {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        max-width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Chat Popup Enhancements */
.chat-popup-enter {
    animation: chatSlideIn 0.5s ease-out forwards;
}

.chat-popup-exit {
    animation: chatSlideOut 0.5s ease-in forwards;
}

@keyframes chatSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes chatSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

/* Message animations */
.message-enter {
    animation: messageSlideIn 0.3s ease-out forwards;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing indicator */
.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #6b7280;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Custom scrollbar for chat */
.chat-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.chat-scrollbar::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 3px;
}

.chat-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.chat-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Chat button glow effect */
.chat-button-glow {
    position: relative;
    overflow: hidden;
}

.chat-button-glow::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;
}

.chat-button-glow:hover::before {
    left: 100%;
}

/* Responsive chat adjustments */
@media (max-width: 640px) {
    #chatPopup {
        width: calc(100vw - 2rem);
        right: 1rem;
        left: 1rem;
        bottom: 5rem;
    }
    
    #chatButton {
        bottom: 1rem;
        right: 1rem;
        padding: 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    #chatPopup {
        background-color: #1f2937;
        border-color: #374151;
    }
    
    #chatMessages {
        background: linear-gradient(to bottom, #111827, #1f2937);
    }
    
    #chatInput {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    #chatInput::placeholder {
        color: #9ca3af;
    }
}

/* Focus states */
#chatInput:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Button hover effects */
.chat-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Orange button styles */
.bg-orange-600 {
    background-color: #ea580c !important;
}

.hover\:bg-orange-700:hover {
    background-color: #c2410c !important;
}

/* Quick action buttons */
.quick-action-btn {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Message bubble shadows */
.message-bubble {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.message-bubble:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Loading states */
.chat-loading {
    opacity: 0.7;
    pointer-events: none;
}

.chat-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Article and text content link styles (accessible defaults) */
.prose a,
.text-gray-700 a {
    color: #2563EB;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1.5px;
}

.prose a:hover,
.text-gray-700 a:hover {
    color: #1D4ED8;
    text-decoration-thickness: 2px;
}

.prose a:visited,
.text-gray-700 a:visited {
    color: #7C3AED;
}

.prose a:focus-visible,
.text-gray-700 a:focus-visible {
    outline: 2px dashed #2563EB;
    outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
    .prose a,
    .text-gray-700 a {
        color: #60A5FA;
    }
    .prose a:hover,
    .text-gray-700 a:hover {
        color: #93C5FD;
    }
    .prose a:visited,
    .text-gray-700 a:visited {
        color: #A78BFA;
    }
}