/* Testimonials Carousel Styles */
.testimonials-wrapper {
    overflow: hidden;
    position: relative;
}

.testimonials-scroll-container {
    display: flex;
    gap: 1.5rem;
    animation: scroll-testimonials 30s linear infinite;
    will-change: transform;
}

.testimonial-card {
    min-width: 350px;
    max-width: 400px;
    min-height: 320px;
    height: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 1.5rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(229, 231, 235, 0.8);
}

.testimonial-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Fix text overflow in testimonial cards */
.testimonial-card p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.6;
    white-space: normal;
    max-width: 100%;
}

.testimonial-card .testimonial-text {
    flex: 1;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.7;
    word-break: break-word;
    overflow-wrap: break-word;
}

.testimonial-card .testimonial-author {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.testimonial-card .testimonial-role {
    color: #6b7280;
    font-size: 0.8rem;
}

@keyframes scroll-testimonials {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-100% - 1.5rem));
    }
}

/* Pause animation on hover */
.testimonials-wrapper:hover .testimonials-scroll-container {
    animation-play-state: paused;
}

#testimonials-carousel {
    will-change: transform;
}

.carousel-dot {
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    transform: scale(1.2);
}

.carousel-dot.bg-accent {
    background-color: #1E40AF !important;
}

/* Navigation arrows */
#prev-testimonial,
#next-testimonial {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

#prev-testimonial:hover,
#next-testimonial:hover {
    transform: scale(1.1);
    background-color: white !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Responsive carousel */
@media (max-width: 1023px) {
    .testimonial-card {
        min-height: 300px;
    }
}

@media (max-width: 767px) {
    .testimonial-card {
        min-height: 280px;
    }
    
    #prev-testimonial,
    #next-testimonial {
        padding: 0.5rem;
    }
    
    .carousel-dot {
        width: 0.625rem;
        height: 0.625rem;
    }
}

/* Smooth animations for carousel */
@media (prefers-reduced-motion: no-preference) {
    #testimonials-carousel {
        transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Pause animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .testimonial-card,
    #testimonials-carousel,
    .carousel-dot,
    #prev-testimonial,
    #next-testimonial {
        transition: none !important;
        animation: none !important;
    }
}

/* Chat Widget Styles */
#chat-widget {
    z-index: 1000;
}

/* Mobile-first chat window styles */
.chat-window {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile full-screen chat */
@media (max-width: 768px) {
    .chat-window {
        transform: translateY(100%) !important;
        opacity: 1 !important;
        border-radius: 0 !important;
        display: flex !important;
        flex-direction: column;
    }
    
    .chat-window.show {
        transform: translateY(0) !important;
    }
    
    #chat-messages {
        flex: 1;
        min-height: calc(100vh - 180px);
    }
}

/* Desktop floating chat */
@media (min-width: 769px) {
    .chat-window.show {
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
    }
}

.message {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 85%;
    word-wrap: break-word;
}

.user-message {
    background-color: #1E40AF;
    color: white;
    margin-left: auto;
    text-align: right;
}

.assistant-message {
    background-color: #f3f4f6;
    color: #374151;
    margin-right: auto;
}

.quick-actions-container {
    margin: 8px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quick-action {
    font-size: 12px;
    background-color: #f3f4f6;
    color: #374151;
    padding: 4px 12px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.quick-action:hover {
    background-color: #e5e7eb;
}

/* Remove extra whitespace */
* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    position: relative;
}

html, body {
    overflow-x: hidden;
}

footer {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Ensure main content doesn't have extra spacing */
main {
    margin: 0;
    padding: 0;
}

/* Fix any potential spacing issues */
section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Custom Animations */m CSS for Eglantin Digital Agency */

/* Smooth scrolling for all browsers */
html {
    scroll-behavior: smooth;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation classes */
.fade-in {
    animation: fadeInUp 0.8s ease-out;
}

.fade-in-delay {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.fade-in-delay-2 {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease-out;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease-out;
}

/* Scroll animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Custom button hover effects */
.btn-primary {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::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;
    z-index: -1;
}

.btn-primary:hover::before {
    left: 100%;
}

/* Custom form styling */
.form-input:focus {
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Navbar backdrop blur support */
.navbar-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #1E40AF;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e3a8a;
}

/* FAQ accordion animations */
.faq-question .fa-plus {
    transition: transform 0.3s ease;
}

.faq-question.active .fa-plus {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-answer.active {
    max-height: 200px;
}

/* Hero section background pattern */
.hero-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(30, 64, 175, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(30, 64, 175, 0.05) 0%, transparent 50%);
}

/* Card hover effects */
.card-hover {
    transition: all 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);
}

/* Loading animation for form submission */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success message styling */
.success-message {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    display: none;
}

.success-message.show {
    display: block;
    animation: fadeInUp 0.5s ease-out;
}

/* Mobile menu animation */
#mobile-menu {
    transition: max-height 0.3s ease-out;
    max-height: 0;
    overflow: hidden;
}

#mobile-menu.active {
    max-height: 300px;
}

/* Responsive image optimization */
img {
    max-width: 100%;
    height: auto;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }
    
    thead {
        display: table-header-group;
    }
    
    tr,
    img {
        page-break-inside: avoid;
    }
    
    img {
        max-width: 100% !important;
    }
    
    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }
    
    h2,
    h3 {
        page-break-after: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .text-gray-600 {
        color: #374151 !important;
    }
    
    .border-gray-200 {
        border-color: #6b7280 !important;
    }
}

/* Reduced motion support */
@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;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .dark-mode-optional {
        background-color: #1f2937;
        color: #f9fafb;
    }
}

/* Focus states for accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #1E40AF;
    outline-offset: 2px;
}

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #1E40AF;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-to-content:focus {
    top: 6px;
}

/* Performance optimizations */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Custom utilities */
.text-balance {
    text-wrap: balance;
}

.text-pretty {
    text-wrap: pretty;
}

/* Hyphenation utility for long words (use with min-w-0 containers) */
.hyphens-auto {
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    overflow-wrap: anywhere;
    word-break: normal;
}

/* Container queries support */
@container (min-width: 768px) {
    .container-md\:text-lg {
        font-size: 1.125rem;
        line-height: 1.75rem;
    }
}

/* Modern CSS features */
.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* IE11 fallbacks */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .grid {
        display: -ms-grid;
    }
    
    .flex {
        display: -ms-flexbox;
    }
}

/* Additional Chat Widget Styles */
#chat-widget {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#chat-toggle {
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
    animation: pulse-gentle 2s infinite;
}

@keyframes pulse-gentle {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(30, 64, 175, 0.4);
    }
}

/* Desktop chat window */
@media (min-width: 769px) {
    #chat-window {
        max-height: 80vh;
        animation: slideInUp 0.3s ease-out;
    }
}

/* Mobile chat window - full screen */
@media (max-width: 768px) {
    #chat-window {
        animation: slideInUp 0.3s ease-out;
        height: 100vh !important;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#chat-messages {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f9fafb;
}

#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #f9fafb;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.chat-message {
    animation: fadeInUp 0.3s ease-out;
}

/* Quick action buttons */
.quick-action:hover {
    transform: translateY(-1px);
}

/* Mobile responsiveness for chat */
@media (max-width: 768px) {
    #chat-window {
        width: calc(100vw - 1.5rem);
        right: 0.75rem;
        left: 0.75rem;
        max-width: none;
    }
    
    #chat-toggle {
        width: 56px;
        height: 56px;
        bottom: 1rem;
        right: 1rem;
    }
}

/* Chat form styling */
.chat-form input,
.chat-form select,
.chat-form textarea {
    transition: all 0.2s ease;
}

.chat-form input:focus,
.chat-form select:focus,
.chat-form textarea:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Service selection buttons */
.service-button {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.service-button:hover {
    border-left-color: #1E40AF;
    transform: translateX(4px);
}

/* Chat typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat notification badge */
.chat-notification {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* Online status indicator */
.status-online {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 6px;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Chat window backdrop */
@media (max-width: 768px) {
    .chat-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: 40;
        animation: fadeIn 0.2s ease-out;
    }
}

/* Accessibility improvements */
.chat-message:focus {
    outline: 2px solid #1E40AF;
    outline-offset: 2px;
}

.quick-action:focus {
    outline: 2px solid #1E40AF;
    outline-offset: 1px;
}

/* High contrast mode support for chat */
@media (prefers-contrast: high) {
    #chat-window {
        border: 2px solid #000;
    }
    
    .quick-action {
        border: 1px solid #666;
    }
}

/* Reduced motion for chat animations */
@media (prefers-reduced-motion: reduce) {
    #chat-toggle {
        animation: none;
    }
    
    #chat-window {
        animation: none;
    }
    
    .chat-message {
        animation: none;
    }
}

/* ----------------------------------------------
   Modern Title System — Fresh & Responsive
   Clean design with gradient accents and refined spacing.
   Mobile-first approach with fluid typography.
----------------------------------------------- */

/* H1: Hero & page titles with gradient effect */
main h1,
.title-1 {
    font-size: clamp(2rem, 3vw + 1rem, 3.5rem) !important; /* ~32px → ~56px */
    line-height: 1.1 !important;
    letter-spacing: -0.025em !important;
    font-weight: 900 !important;
    background: linear-gradient(135deg, #1E40AF 0%, #7C3AED 50%, #1E40AF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.25rem !important;
    position: relative;
}

/* Fallback for browsers that don't support background-clip */
@supports not (-webkit-background-clip: text) {
    main h1, .title-1 {
        color: #1E40AF !important;
        background: none !important;
    }
}

/* H2: Section titles with modern accent bar */
main h2,
.title-2 {
    font-size: clamp(1.75rem, 2.2vw + 0.8rem, 2.75rem) !important; /* ~28px → ~44px */
    line-height: 1.15 !important;
    letter-spacing: -0.015em !important;
    font-weight: 800 !important;
    color: #1a1a1a !important;
    position: relative;
    padding-left: 1rem;
    margin-bottom: 1.5rem !important;
    margin-top: 0.5rem !important;
}

/* Modern left accent bar for section titles */
main h2::before,
.title-2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #1E40AF 0%, #7C3AED 100%);
    border-radius: 2px;
}

/* Centered variant (removes left bar, adds bottom accent) */
.title-center {
    padding-left: 0 !important;
    text-align: center;
    padding-bottom: 1rem;
}

.title-center::before {
    display: none;
}

.title-center::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #1E40AF 0%, #7C3AED 100%);
    border-radius: 2px;
}

/* H3: Clean sub-section titles */
main h3,
.title-3 {
    font-size: clamp(1.375rem, 1.4vw + 0.8rem, 1.75rem) !important; /* ~22px → ~28px */
    line-height: 1.3 !important;
    letter-spacing: -0.01em !important;
    font-weight: 700 !important;
    color: #2a2a2a !important;
    margin-bottom: 0.75rem !important;
    margin-top: 0.5rem !important;
}

/* Optional gradient variant for H3 */
.title-3.title-gradient {
    background: linear-gradient(135deg, #1E40AF 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    main h2, .title-2 {
        padding-left: 0.75rem;
    }
    
    main h2::before, .title-2::before {
        width: 3px;
    }
    
    .title-center::after {
        width: 60px;
        height: 2px;
    }
}
