/**
 * TopFast Custom CSS - Professional Design System
 *
 * @package TopFast
 * @since 1.0.0
 */

/* ==========================================================================
   Hero Section
   ========================================================================== */
.tf-hero-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='20' cy='20' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
}

.tf-hero {
    position: relative;
}

.tf-hero::after {
    display: none;
}

.tf-hero__shape-1 {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(70,83,164,0.3) 0%, transparent 70%);
    top: -200px;
    right: -150px;
    animation: tf-morph 15s ease-in-out infinite;
}

.tf-hero__shape-2 {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 100%);
    bottom: -100px;
    left: -100px;
    animation: tf-morph 12s ease-in-out infinite reverse;
}

.tf-hero__shape-3 {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    top: 20%;
    left: 15%;
    animation: tf-rotate 20s linear infinite;
}

.tf-hero__floating-card {
    position: absolute;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 20px 24px;
    color: #fff;
    animation: tf-float 6s ease-in-out infinite;
    z-index: 5;
}

.tf-hero__floating-card--1 {
    bottom: 20%;
    left: 8%;
    animation-delay: 0s;
}

.tf-hero__floating-card--2 {
    top: 25%;
    left: 5%;
    animation-delay: -2s;
}

/* ==========================================================================
   Watad Font (وتد)
   ========================================================================== */
@font-face {
    font-family: 'Watad';
    src: url('../fonts/watad.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   Header CTA Button
   ========================================================================== */
.tf-btn-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Watad', 'Tajawal', sans-serif;
    color: #fff;
    background: linear-gradient(135deg, #4653a4, #200747);
    border-radius: 50px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 12px rgba(70, 83, 164, 0.3);
}

.tf-btn-header:hover {
    box-shadow: 0 6px 20px rgba(70, 83, 164, 0.45);
    transform: translateY(-1px);
}

.tf-btn-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.tf-btn-header:hover::before {
    left: 120%;
}

/* ==========================================================================
   Buttons - Professional Effects
   ========================================================================== */

/* Shine sweep on primary */
.tf-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%
    );
    transition: left 0.6s ease;
}

.tf-btn-primary:hover::before {
    left: 120%;
}

/* Shine sweep on secondary */
.tf-btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    transition: left 0.6s ease;
}

.tf-btn-secondary:hover::before {
    left: 120%;
}

/* Outline icon arrow animation */
.tf-btn-outline .fa-arrow-left,
.tf-btn-primary .fa-arrow-left {
    transition: transform 0.3s ease;
}

.tf-btn-outline:hover .fa-arrow-left,
.tf-btn-primary:hover .fa-arrow-left {
    transform: translateX(-4px);
}

/* White button subtle lift */
.tf-btn-white::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, transparent 0%, rgba(70, 83, 164, 0.04) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.tf-btn-white:hover::before {
    opacity: 1;
}

/* Focus ring for accessibility */
.tf-btn:focus-visible {
    outline: 3px solid rgba(70, 83, 164, 0.5);
    outline-offset: 2px;
}

/* ==========================================================================
   Preloader
   ========================================================================== */
.tf-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #200747, #4653a4);
    transition: opacity 0.6s, visibility 0.6s;
}

.tf-preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

.tf-preloader__spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tf-spin 0.7s linear infinite;
}

/* ==========================================================================
   Header
   ========================================================================== */
.tf-header {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tf-header.is-sticky {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(32, 7, 71, 0.08);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    top: -40px;
}

.tf-nav__link {
    position: relative;
}

.tf-nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4653a4, #200747);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.tf-nav__link:hover::after,
.tf-nav__link.text-primary::after {
    width: 100%;
}

/* ==========================================================================
   Stat Cards
   ========================================================================== */
.tf-stat-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s;
}

.tf-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    border-radius: 0 0 4px 4px;
    transition: height 0.4s;
}

.tf-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(32, 7, 71, 0.12);
}

.tf-stat-card:hover::before {
    height: 100%;
    opacity: 0.05;
}

.tf-stat-card:nth-child(1)::before { background: linear-gradient(135deg, #4653a4, #6366f1); }
.tf-stat-card:nth-child(2)::before { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.tf-stat-card:nth-child(3)::before { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tf-stat-card:nth-child(4)::before { background: linear-gradient(135deg, #10b981, #14b8a6); }

.tf-stat-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 24px;
    position: relative;
    overflow: hidden;
}

.tf-stat-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tf-stat-card:nth-child(1) .tf-stat-icon { background: linear-gradient(135deg, #4653a4, #6366f1); color: #fff; }
.tf-stat-card:nth-child(2) .tf-stat-icon { background: linear-gradient(135deg, #0ea5e9, #06b6d4); color: #fff; }
.tf-stat-card:nth-child(3) .tf-stat-icon { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; }
.tf-stat-card:nth-child(4) .tf-stat-icon { background: linear-gradient(135deg, #10b981, #14b8a6); color: #fff; }

.tf-counter {
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #200747, #4653a4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================================================
   Service Cards
   ========================================================================== */
.tf-service-card {
    position: relative;
    border: 1px solid transparent;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.tf-service-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(70,83,164,0.08) 0%, transparent 100%);
    border-radius: 0 0 0 80px;
    transition: all 0.5s;
}

.tf-service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(32, 7, 71, 0.15);
    border-color: rgba(70, 83, 164, 0.15);
}

.tf-service-card:hover::before {
    width: 100%;
    height: 100%;
    border-radius: 0;
    opacity: 0.5;
}

.tf-service-card__icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-size: 28px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}

.tf-service-card:hover .tf-service-card__icon {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 10px 30px rgba(70, 83, 164, 0.3);
}

.tf-service-card:nth-child(even) .tf-service-card__icon {
    border-radius: 20px 20px 4px 20px;
}

.tf-service-card:nth-child(3n+1) .tf-service-card__icon {
    border-radius: 20px 4px 20px 20px;
}

/* ==========================================================================
   About Section
   ========================================================================== */
.tf-about-image-wrap {
    position: relative;
}

.tf-about-image-wrap::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    bottom: 20px;
    left: 20px;
    border: 3px solid rgba(70, 83, 164, 0.15);
    border-radius: 20px;
    z-index: -1;
}

.tf-about-image-wrap::after {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    bottom: -10px;
    left: -10px;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(70, 83, 164, 0.07) 5px,
        rgba(70, 83, 164, 0.07) 10px
    );
    border-radius: 12px;
    z-index: -1;
}

.tf-about-badge {
    animation: tf-float 4s ease-in-out infinite;
}

.tf-feature-item {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #f3f4f6;
    transition: all 0.3s;
}

.tf-feature-item:hover {
    background: linear-gradient(135deg, rgba(70,83,164,0.05), rgba(70,83,164,0.02));
    border-color: rgba(70, 83, 164, 0.15);
    transform: translateX(-4px);
}

/* ==========================================================================
   How We Work
   ========================================================================== */
.tf-step-card {
    position: relative;
    padding: 2rem;
    border-radius: 20px;
    background: #fff;
    border: 1px solid #f3f4f6;
    transition: all 0.4s;
}

.tf-step-card:hover {
    border-color: rgba(70, 83, 164, 0.2);
    box-shadow: 0 20px 40px rgba(32, 7, 71, 0.08);
    transform: translateY(-6px);
}

.tf-step-card__number {
    position: absolute;
    top: -14px;
    right: 24px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4653a4, #200747);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(70, 83, 164, 0.4);
}

.tf-step-card__icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 1.5rem;
    position: relative;
    overflow: hidden;
}

.tf-step-card:nth-child(1) .tf-step-card__icon { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #7c3aed; }
.tf-step-card:nth-child(2) .tf-step-card__icon { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #2563eb; }
.tf-step-card:nth-child(3) .tf-step-card__icon { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #059669; }

.tf-step-connector {
    position: absolute;
    top: 50%;
    left: -40px;
    width: 40px;
    height: 2px;
    background: repeating-linear-gradient(90deg, #d1d5db 0px, #d1d5db 6px, transparent 6px, transparent 12px);
}

/* ==========================================================================
   CTA Section
   ========================================================================== */
.tf-cta {
    position: relative;
    overflow: hidden;
}

.tf-cta__glow {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.tf-cta__glow--1 {
    background: #4653a4;
    top: -100px;
    right: -100px;
    animation: tf-float 8s ease-in-out infinite;
}

.tf-cta__glow--2 {
    background: #6366f1;
    bottom: -100px;
    left: -100px;
    animation: tf-float 10s ease-in-out infinite reverse;
}

.tf-cta__benefit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s;
}

.tf-cta__benefit:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* ==========================================================================
   Clients / Partners
   ========================================================================== */
.tf-logo-placeholder {
    width: 140px;
    height: 70px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.tf-logo-placeholder:hover {
    border-color: rgba(70, 83, 164, 0.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* ==========================================================================
   Page Hero (inner pages)
   ========================================================================== */
.tf-page-hero {
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tf-page-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.tf-page-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(32,7,71,0.92) 0%, rgba(45,16,102,0.88) 40%, rgba(70,83,164,0.85) 100%);
}

.tf-page-hero__pattern {
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.tf-page-hero .tf-breadcrumb {
    justify-content: center;
    margin-top: 1rem;
}

/* ==========================================================================
   Section Titles
   ========================================================================== */
.tf-section-title .tf-subtitle {
    display: inline-block;
    padding: 6px 20px;
    background: linear-gradient(135deg, rgba(70,83,164,0.08), rgba(70,83,164,0.04));
    border-radius: 50px;
    border: 1px solid rgba(70,83,164,0.1);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.tf-section-title h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #4653a4, #200747);
    border-radius: 4px;
    margin: 16px auto 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.tf-footer {
    position: relative;
    overflow: hidden;
}

.tf-footer::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(70,83,164,0.15) 0%, transparent 60%);
    top: -300px;
    left: -200px;
}

/* ==========================================================================
   Tracking Result
   ========================================================================== */
.tf-tracking-timeline {
    position: relative;
    padding-right: 2.5rem;
}

.tf-tracking-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 8px;
    width: 3px;
    background: linear-gradient(to bottom, #4653a4, #e5e7eb);
    border-radius: 3px;
}

.tf-tracking-step {
    position: relative;
    padding-bottom: 2rem;
    padding-right: 2rem;
}

.tf-tracking-step__dot {
    position: absolute;
    right: -2.5rem;
    top: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e5e7eb;
    border: 3px solid #fff;
    z-index: 1;
    transition: all 0.3s;
}

.tf-tracking-step.is-active .tf-tracking-step__dot {
    background: #4653a4;
    box-shadow: 0 0 0 4px rgba(70, 83, 164, 0.2);
}

.tf-tracking-step.is-completed .tf-tracking-step__dot {
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

/* ==========================================================================
   Blog Card
   ========================================================================== */
.tf-blog-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tf-blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(32, 7, 71, 0.12);
}

.tf-blog-card .tf-card-body::before {
    content: '';
    position: absolute;
    top: 0;
    right: 24px;
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, #4653a4, #6366f1);
    border-radius: 0 0 4px 4px;
}

/* ==========================================================================
   Scroll to Top
   ========================================================================== */
.tf-scroll-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #4653a4, #200747);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 90;
    box-shadow: 0 8px 24px rgba(70, 83, 164, 0.35);
}

.tf-scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
}

.tf-scroll-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(70, 83, 164, 0.45);
}

/* ==========================================================================
   WhatsApp Float
   ========================================================================== */
.tf-whatsapp-float {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 99;
}

.tf-whatsapp-float__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    font-size: 28px;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s;
    animation: tf-pulse 2s infinite;
}

.tf-whatsapp-float__btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.5);
}

/* ==========================================================================
   Marquee (Clients Slider) - Pure CSS Infinite
   ========================================================================== */
.tf-marquee-wrap {
    overflow: hidden;
    width: 100%;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%);
}

.tf-marquee-row {
    display: flex;
    width: max-content;
    animation: tf-clients-slide 35s linear infinite;
}

.tf-marquee-wrap:hover .tf-marquee-row {
    animation-play-state: paused;
}

.tf-marquee-set {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.tf-marquee-logo {
    flex-shrink: 0;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tf-marquee-logo img {
    height: 55px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s;
}

.tf-marquee-logo:hover img {
    transform: scale(1.15);
}

@media (min-width: 1024px) {
    .tf-marquee-logo img {
        height: 70px;
    }
    .tf-marquee-logo {
        padding: 0 40px;
    }
}

.tf-marquee-row--reverse {
    animation-name: tf-clients-slide-reverse;
}

@keyframes tf-clients-slide-reverse {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes tf-clients-slide {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(50%);
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes tf-spin {
    to { transform: rotate(360deg); }
}

@keyframes tf-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
}

@keyframes tf-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes tf-morph {
    0%, 100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    25% { border-radius: 70% 30% 50% 50% / 30% 60% 40% 70%; }
    50% { border-radius: 50% 50% 30% 70% / 60% 40% 60% 40%; }
    75% { border-radius: 30% 70% 60% 40% / 50% 60% 30% 70%; }
}

@keyframes tf-rotate {
    to { transform: rotate(360deg); }
}

@keyframes tf-gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==========================================================================
   Print
   ========================================================================== */
@media print {
    .tf-header, .tf-footer, .tf-whatsapp-float, .tf-scroll-top { display: none !important; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .tf-hero__floating-card { display: none; }
    .tf-hero__shape-3 { display: none; }
}

@media (max-width: 768px) {
    .tf-about-image-wrap::before,
    .tf-about-image-wrap::after { display: none; }

    .tf-step-connector { display: none; }

    .tf-page-hero { min-height: 250px; }
}
