/* ==========================================================================
   GLOBAL ANIMATIONS & TYPOGRAPHY ENHANCEMENTS
   Professional styles for Al-Sareeh Theme
   ========================================================================== */

/* ============================================
   IMPROVED TYPOGRAPHY - READABLE FONT SIZES
   Following WCAG 2.1 accessibility guidelines
   ============================================ */

/* Base Font Sizes - Larger and More Readable */
:root {
    /* Enhanced Font Sizes for Better Readability */
    --text-xs: 0.8125rem;
    /* 13px */
    --text-sm: 0.9375rem;
    /* 15px */
    --text-base: 1.0625rem;
    /* 17px - Increased base */
    --text-lg: 1.1875rem;
    /* 19px */
    --text-xl: 1.375rem;
    /* 22px */
    --text-2xl: 1.625rem;
    /* 26px */
    --text-3xl: 2rem;
    /* 32px */
    --text-4xl: 2.5rem;
    /* 40px */
    --text-5xl: 3.125rem;
    /* 50px */
    --text-6xl: 3.75rem;
    /* 60px */

    /* Line Heights for Readability */
    --leading-tight: 1.3;
    --leading-normal: 1.6;
    --leading-relaxed: 1.8;
    --leading-loose: 2;
}

/* Global Body Text */
body {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
}

/* Headings - Clear Hierarchy */
h1,
.h1 {
    font-size: var(--text-5xl);
    font-weight: 800;
    line-height: var(--leading-tight);
    margin-bottom: 1rem;
}

h2,
.h2 {
    font-size: var(--text-4xl);
    font-weight: 700;
    line-height: var(--leading-tight);
    margin-bottom: 0.875rem;
}

h3,
.h3 {
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: var(--leading-normal);
    margin-bottom: 0.75rem;
}

h4,
.h4 {
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: var(--leading-normal);
    margin-bottom: 0.5rem;
}

h5,
.h5 {
    font-size: var(--text-lg);
    font-weight: 600;
    line-height: var(--leading-normal);
}

h6,
.h6 {
    font-size: var(--text-base);
    font-weight: 600;
    line-height: var(--leading-normal);
}

/* Paragraphs */
p {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    margin-bottom: 1.25rem;
}

/* Section Headers */
.section-header__title {
    font-size: var(--text-3xl);
    font-weight: 800;
}

.section-header__subtitle {
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.section-header__description {
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
}

/* Page Hero Titles */
.page-hero h1,
.page-hero__content h1 {
    font-size: var(--text-5xl);
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.page-hero p,
.page-hero__content p {
    font-size: var(--text-xl);
    opacity: 0.95;
}

/* Card Titles */
.service-card h3,
.product-card h3,
.news-card__title,
.project-card h3 {
    font-size: var(--text-xl);
    font-weight: 700;
}

/* Card Descriptions */
.service-card p,
.product-card p,
.news-card__excerpt,
.project-card p {
    font-size: var(--text-base);
    color: var(--text-secondary);
}

/* Button Text */
.btn {
    font-size: var(--text-base);
    font-weight: 600;
    padding: 0.875rem 1.75rem;
}

.btn--sm {
    font-size: var(--text-sm);
    padding: 0.625rem 1.25rem;
}

.btn--lg {
    font-size: var(--text-lg);
    padding: 1rem 2.25rem;
}

/* Navigation */
.nav__link {
    font-size: var(--text-base);
    font-weight: 600;
}

/* Footer */
.footer {
    font-size: var(--text-base);
}

.footer h4 {
    font-size: var(--text-xl);
    font-weight: 700;
}

/* Sidebar */
.sidebar-block h4 {
    font-size: var(--text-lg);
    font-weight: 700;
}

.sidebar-categories a {
    font-size: var(--text-base);
}

/* Mobile Typography */
@media (max-width: 768px) {
    :root {
        --text-base: 1rem;
        --text-lg: 1.125rem;
        --text-xl: 1.25rem;
        --text-2xl: 1.5rem;
        --text-3xl: 1.75rem;
        --text-4xl: 2rem;
        --text-5xl: 2.5rem;
    }

    h1,
    .h1 {
        font-size: var(--text-4xl);
    }

    h2,
    .h2 {
        font-size: var(--text-3xl);
    }

    .page-hero h1,
    .page-hero__content h1 {
        font-size: var(--text-4xl);
    }

    .section-header__title {
        font-size: var(--text-2xl);
    }
}

/* ============================================
   ENHANCED AOS ANIMATIONS
   Professional scroll-triggered animations
   ============================================ */

/* Custom Animation Timing */
[data-aos] {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Fade Animations */
[data-aos="fade-up"] {
    transform: translate3d(0, 40px, 0);
}

[data-aos="fade-down"] {
    transform: translate3d(0, -40px, 0);
}

[data-aos="fade-right"] {
    transform: translate3d(-40px, 0, 0);
}

[data-aos="fade-left"] {
    transform: translate3d(40px, 0, 0);
}

/* Zoom Animations */
[data-aos="zoom-in"] {
    transform: scale(0.9);
}

[data-aos="zoom-in-up"] {
    transform: translate3d(0, 30px, 0) scale(0.9);
}

/* Slide Animations */
[data-aos="slide-up"] {
    transform: translate3d(0, 100%, 0);
}

/* Flip Animations */
[data-aos="flip-up"] {
    transform: perspective(2500px) rotateX(-100deg);
}

[data-aos="flip-left"] {
    transform: perspective(2500px) rotateY(-100deg);
}

/* Custom Professional Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -30px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(30px, 0, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(-30px, 0, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Mobile Animation Adjustments */
@media (max-width: 768px) {

    [data-aos="fade-right"],
    [data-aos="fade-left"],
    .animate-fadeInLeft,
    .animate-fadeInRight {
        transform: translate3d(0, 20px, 0) !important;
    }

    @keyframes fadeInLeft {
        from {
            opacity: 0;
            transform: translate3d(0, 20px, 0);
        }

        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }

    @keyframes fadeInRight {
        from {
            opacity: 0;
            transform: translate3d(0, 20px, 0);
        }

        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 50px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Animation Classes */
.animate-fadeIn {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.6s ease-out forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease-out forwards;
}

.animate-scaleIn {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-slideUp {
    animation: slideInUp 0.7s ease-out forwards;
}

.animate-bounceIn {
    animation: bounceIn 0.8s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Staggered Animation Delays for Lists/Grids */
.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

.stagger-4 {
    animation-delay: 0.4s;
}

.stagger-5 {
    animation-delay: 0.5s;
}

.stagger-6 {
    animation-delay: 0.6s;
}

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(15, 94, 168, 0.3);
}

/* Button Hover Effects */
.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::after {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 94, 168, 0.3);
}

/* Card Hover Effects */
.service-card,
.product-card,
.news-card,
.project-card,
.testimonial-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover,
.product-card:hover,
.news-card:hover,
.project-card:hover,
.testimonial-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

/* Image Hover Zoom */
.service-card__image img,
.product-card__image img,
.news-card__image img,
.project-card__image img {
    transition: transform 0.5s ease;
}

.service-card:hover .service-card__image img,
.product-card:hover .product-card__image img,
.news-card:hover .news-card__image img,
.project-card:hover .project-card__image img {
    transform: scale(1.1);
}

/* Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.counter-animate {
    animation: countUp 0.8s ease-out forwards;
}

/* Loading Skeleton Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Page Transition */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s ease;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================
   SPECIFIC COMPONENT ANIMATIONS
   ============================================ */

/* Hero Section Animation */
.page-hero__content {
    animation: fadeInDown 0.8s ease-out;
}

/* Section Headers */
.section-header {
    animation: fadeInUp 0.6s ease-out;
}

/* Grid Items Stagger Effect */
.services-grid>*:nth-child(1),
.products-grid>*:nth-child(1),
.news-grid>*:nth-child(1) {
    animation-delay: 0.1s;
}

.services-grid>*:nth-child(2),
.products-grid>*:nth-child(2),
.news-grid>*:nth-child(2) {
    animation-delay: 0.2s;
}

.services-grid>*:nth-child(3),
.products-grid>*:nth-child(3),
.news-grid>*:nth-child(3) {
    animation-delay: 0.3s;
}

/* Stats Counter */
.stats-section .stat-item {
    opacity: 0;
    transform: translateY(30px);
}

.stats-section .stat-item.animated {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* FAQ Accordion */
.faq-item {
    transition: all 0.3s ease;
}

.faq-item:hover {
    background: var(--bg-secondary);
}

.faq-item.active .faq-answer {
    animation: slideInUp 0.3s ease-out;
}

/* Floating Elements */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Scroll Indicator */
@keyframes scrollDown {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateY(10px);
    }
}

.scroll-indicator {
    animation: scrollDown 2s ease-in-out infinite;
}