/* Google Fonts loaded via <link> in HTML head for better performance */


body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow-x: hidden;
}

.site-main {
    --content-top: 8rem;
    padding-top: var(--content-top);
}

.profile-sidebar-card {
    position: sticky;
    top: var(--content-top);
}

/* Site Header */
.site-header {
    background: transparent;
    border-bottom: 1px solid transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    /* Avoid 100vw overflow clipping the hamburger on first mobile paint */
    left: 0;
    right: 0;
    width: auto;
    max-width: 100%;
}

.site-header-inner {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.site-header-inner .site-logo {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 1.25rem; /* text-xl */
    line-height: 1.75rem;
    font-weight: 900;
}

@media (min-width: 640px) {
    .site-header-inner .site-logo {
        font-size: 1.5rem; /* text-2xl */
        line-height: 2rem;
    }
}

.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.dark .site-header.is-scrolled {
    background: rgba(29, 37, 49, 0.96);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

@media (min-width: 1024px) {
    .site-header-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(min-content, 1fr);
        align-items: center;
        justify-content: normal;
    }

    .site-header-inner .site-logo {
        justify-self: start;
        max-width: none;
    }

    .site-header-inner .nav-track {
        justify-self: center;
    }

    .site-header-inner .header-actions {
        justify-self: end;
        min-width: max-content;
    }

    html[dir="rtl"] .site-header-inner .header-actions {
        justify-self: start;
    }
}

.nav-track {
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark .nav-track {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.07);
}

.header-icon-btn:hover {
    background: rgba(92, 175, 144, 0.12);
}

.header-actions {
    flex-shrink: 0;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .header-actions {
        gap: 0.625rem;
    }
}

@media (min-width: 1024px) {
    .header-actions {
        min-width: max-content;
        gap: 0.75rem;
    }
}

#lang-toggle {
    padding-inline: 0.75rem;
    font-size: 0.875rem;
    line-height: 1;
}

.header-cta {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Theme toggle: Font Awesome sets display:inline-block and overrides Tailwind hidden */
#theme-toggle > i:first-of-type {
    display: inline-block !important;
}

#theme-toggle > i:last-of-type {
    display: none !important;
}

html.dark #theme-toggle > i:first-of-type {
    display: none !important;
}

html.dark #theme-toggle > i:last-of-type {
    display: inline-block !important;
}

/* Active Navigation Link — compact pill for scroll-spy nav */
nav .nav-link[data-section],
#mobile-drawer .nav-link[data-section] {
    position: relative;
    padding: 0.6rem 1.05rem;
    border-radius: 9999px;
    color: #4b5966;
    transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.dark nav .nav-link[data-section],
.dark #mobile-drawer .nav-link[data-section] {
    color: #dedee0;
}

#mobile-drawer .nav-link[data-section] {
    width: 100%;
    padding: 0.75rem 1.1rem;
}

nav .nav-link[data-section] i,
#mobile-drawer .nav-link[data-section] i {
    transition: color 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

nav .nav-link[data-section]:hover,
#mobile-drawer .nav-link[data-section]:hover {
    color: #5caf90;
    background: rgba(92, 175, 144, 0.1);
}

.dark nav .nav-link[data-section]:hover,
.dark #mobile-drawer .nav-link[data-section]:hover {
    background: rgba(92, 175, 144, 0.14);
}

nav .nav-link[data-section]:hover i,
#mobile-drawer .nav-link[data-section]:hover i {
    opacity: 1 !important;
    color: #5caf90;
}

nav .nav-link[data-section].active,
nav .nav-link[data-section].active:hover,
#mobile-drawer .nav-link[data-section].active,
#mobile-drawer .nav-link[data-section].active:hover {
    color: #fff;
    font-weight: 700;
    background: #5caf90;
    box-shadow: 0 4px 14px rgba(92, 175, 144, 0.28);
}

.dark nav .nav-link[data-section].active,
.dark nav .nav-link[data-section].active:hover,
.dark #mobile-drawer .nav-link[data-section].active,
.dark #mobile-drawer .nav-link[data-section].active:hover {
    color: #fff;
    background: #5caf90;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}

nav .nav-link[data-section].active i,
nav .nav-link[data-section].active:hover i,
#mobile-drawer .nav-link[data-section].active i,
#mobile-drawer .nav-link[data-section].active:hover i {
    opacity: 1 !important;
    color: #fff;
}

nav .nav-link[data-section].active span,
#mobile-drawer .nav-link[data-section].active span {
    color: #fff;
}

nav .nav-link[data-section].active::after,
#mobile-drawer .nav-link[data-section].active::after {
    content: none;
}

.nav-link.active:not([data-section]) {
    color: #5caf90;
    font-weight: 700;
    position: relative;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #5caf90;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4ba080;
}

/* Pulsing dot for online status */
.pulse-dot {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(92, 175, 144, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(92, 175, 144, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(92, 175, 144, 0);
    }
}

/* Timeline Custom styles */
.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #5caf90;
    border: 3px solid #1d2531;
    z-index: 10;
}

.light .timeline-item::before {
    border-color: #ffffff;
}

.timeline-line {
    position: absolute;
    left: -18px;
    top: 15px;
    bottom: -15px;
    width: 2px;
    background: rgba(92, 175, 144, 0.3);
}

.timeline-item:last-child .timeline-line {
    display: none;
}

/* ===========================
   Trueman Timeline (trm-timeline)
   =========================== */
.trm-timeline {
    position: relative;
}

/* Default (LTR) Styles */
.trm-timeline::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    height: calc(100% - 20px);
    width: 3px;
    background: rgba(92, 175, 144, 0.2);
    border-radius: 2px;
}

.trm-timeline .trm-timeline-item {
    position: relative;
    padding-left: 45px;
    margin-bottom: 30px;
}

/* Outer glow ring — LTR */
.trm-timeline .trm-timeline-item .trm-timeline-mark-light {
    background: rgba(92, 175, 144, 0.35);
    position: absolute;
    top: 12px;
    left: -13px;
    width: 29px;
    height: 29px;
    opacity: 0;
    border-radius: 50%;
    transition: 0.4s ease-in-out;
}

/* Inner dot — LTR */
.trm-timeline .trm-timeline-item .trm-timeline-mark {
    position: absolute;
    top: 16px;
    left: -9px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    border: 3px solid #5caf90;
    background: #f3f4f6;
    z-index: 2;
}

.dark .trm-timeline .trm-timeline-item .trm-timeline-mark {
    background: #17181c;
}

/* Hover: animate the glow ring */
.trm-timeline .trm-timeline-item:hover .trm-timeline-mark-light {
    opacity: 1;
    animation: puls 1s infinite;
}

/* Content card — LTR */
.trm-timeline .trm-timeline-content {
    border-radius: 14px;
    position: relative;
    background: #ffffff;
    padding: 24px 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.dark .trm-timeline .trm-timeline-content {
    background: #1d2531;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Arrow pointer — LTR */
.trm-timeline .trm-timeline-content::after {
    content: '';
    position: absolute;
    top: 20px;
    left: -6px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    transform: rotate(45deg);
}

.dark .trm-timeline .trm-timeline-content::after {
    background: #1d2531;
}

/* ===================================================
   RTL Overrides (when html has dir="rtl" attribute)
   =================================================== */
html[dir="rtl"] .trm-timeline::before {
    left: auto;
    right: 0;
}

html[dir="rtl"] .trm-timeline .trm-timeline-item {
    padding-left: 0;
    padding-right: 45px;
}

html[dir="rtl"] .trm-timeline .trm-timeline-item .trm-timeline-mark-light {
    left: auto;
    right: -13px;
}

html[dir="rtl"] .trm-timeline .trm-timeline-item .trm-timeline-mark {
    left: auto;
    right: -9px;
}

html[dir="rtl"] .trm-timeline .trm-timeline-content::after {
    left: auto;
    right: -6px;
}

@keyframes puls {
    0% {
        transform: scale(0.9);
        opacity: 1;
    }

    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Skill progress bar animation */
.skill-progress {
    transition: width 1.5s ease-in-out;
}

/* Preloader */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.loader-circle {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(92, 175, 144, 0.3);
    border-top-color: #5caf90;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* ===========================
   Tech Badge — hover expand
   =========================== */
.tech-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 4px 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    color: #374151;
    cursor: default;
    transition: padding 0.5s ease, gap 0.5s ease, border-color 0.4s ease;
    white-space: nowrap;
    overflow: hidden;
}

.dark .tech-badge {
    background: #17181c;
    border-color: #1f2937;
    color: #d1d5db;
}

.tech-badge:hover {
    padding: 4px 10px 4px 6px;
    gap: 5px;
    border-color: #5caf90;
}

.tech-badge .tech-label {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width 0.5s ease, opacity 0.4s ease;
    font-size: 0.72rem;
}

.tech-badge:hover .tech-label {
    max-width: 80px;
    opacity: 1;
}

/* ===================================================
   Mobile Navigation Drawer (Opaque Background Fix)
   =================================================== */
#mobile-drawer {
    background-color: #ffffff !important;
}

html.dark #mobile-drawer {
    background-color: #1d2531 !important;
}
/* ===================================================
   Contact Form Fields (index)
   =================================================== */
        .form-field-wrapper,
        .phone-input-wrapper {
            transition: box-shadow 0.2s ease, border-color 0.2s ease;
            min-width: 0;
            max-width: 100%;
        }

        #contact form,
        #contact form .grid,
        .form-field,
        #phone-field-group {
            min-width: 0;
            max-width: 100%;
        }

        .form-field-input,
        .form-field-textarea {
            box-sizing: border-box;
            max-width: 100%;
        }

        .form-field-label,
        .phone-field-label {
            line-height: 1;
        }

        html[dir="rtl"] .form-field-label,
        html[dir="rtl"] .phone-field-label {
            left: auto;
            right: 1rem;
        }

        html[dir="rtl"] .form-field-counter {
            right: auto;
            left: 1rem;
        }

        .form-field-input {
            padding-right: 4.5rem;
        }

        html[dir="rtl"] .form-field-input {
            padding-right: 1rem;
            padding-left: 4.5rem;
        }

        .form-field-textarea {
            padding-top: 1.75rem;
            padding-right: 4.5rem;
        }

        html[dir="rtl"] .form-field-textarea {
            padding-right: 1rem;
            padding-left: 4.5rem;
        }

        .review-file-input::file-selector-button {
            margin-right: 1rem;
            margin-left: 0;
            padding: 0.5rem 1rem;
            border: 0;
            border-radius: 0.5rem;
            background: #5caf90;
            color: #fff;
            font-weight: 600;
            cursor: pointer;
        }

        html[dir="rtl"] .review-file-input::file-selector-button {
            margin-right: 0;
            margin-left: 1rem;
        }

        #country-panel {
            min-width: 16rem;
        }

        @media (max-width: 639px) {
            .form-field-input {
                padding-right: 1rem;
                padding-bottom: 1.25rem;
            }

            .form-field-counter {
                top: auto;
                bottom: 0.375rem;
                right: 0.75rem;
                transform: none;
            }

            html[dir="rtl"] .form-field-counter {
                right: auto;
                left: 0.75rem;
            }

            .form-field-textarea {
                padding-right: 1rem;
            }

            #country-panel {
                min-width: 0;
                width: min(18rem, calc(100vw - 2.5rem));
            }
        }
/* Swiper pagination — compact on desktop, 48px touch targets on mobile */
.hero-pagination .swiper-pagination-bullet,
.testimonials-slider .swiper-pagination-bullet {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1 !important;
}

.hero-pagination .swiper-pagination-bullet::after,
.testimonials-slider .swiper-pagination-bullet::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.hero-pagination .swiper-pagination-bullet::after {
    background: rgba(255, 255, 255, 0.45);
}

.hero-pagination .swiper-pagination-bullet-active::after {
    background: #fff;
}

.testimonials-slider .swiper-pagination-bullet::after {
    background: rgba(92, 175, 144, 0.45);
}

.testimonials-slider .swiper-pagination-bullet-active::after {
    background: #5caf90;
}

@media (max-width: 767px) {
    .hero-pagination.swiper-pagination .swiper-pagination-bullet,
    .testimonials-slider.swiper-pagination .swiper-pagination-bullet,
    .hero-pagination .swiper-pagination-bullet,
    .testimonials-slider .swiper-pagination-bullet,
    .swiper-pagination-bullet {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        margin: 0 2px !important;
        border-radius: 50% !important;
        background: transparent !important;
    }
}

/* Screen-reader only labels (accessibility) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Certificate lightbox: centered, fit viewport, above FAB */
.cert-lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
}

.cert-lightbox-modal.is-open {
    display: flex;
}

.cert-lightbox-modal.is-visible {
    opacity: 1;
}

.cert-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10060;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.75rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cert-lightbox-close:hover {
    color: #fff;
}

.cert-lightbox-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: min(920px, 100%);
    max-height: calc(100vh - 2.5rem);
    max-height: calc(100dvh - 2.5rem);
}

.cert-lightbox-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 6.5rem);
    max-height: calc(100dvh - 6.5rem);
    object-fit: contain;
    border-radius: 1rem;
    border: 1px solid #1f2937;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
    user-select: none;
    background: #111;
}

.cert-lightbox-title {
    margin: 0;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    max-width: 100%;
}

body.cert-lightbox-open {
    overflow: hidden;
}

body.cert-lightbox-open #fab-container {
    visibility: hidden;
    pointer-events: none;
}
