/* ===== Global Styles ===== */
:root {
    --primary-color: #00f2fe; /* Neon Cyan */
    --secondary-color: #4facfe; /* Neon Sky Blue */
    --accent-color: #7f53ac; /* Neon Violet */
    --dark-color: #070714; /* Deep Space Dark */
    --light-color: #f8f9fa;
    --gradient-1: linear-gradient(135deg, #070714 0%, #0c0d24 50%, #15173c 100%);
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);

    /* Premium Glassmorphic System */
    --glass-bg: rgba(255, 255, 255, 0.015);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-glow: 0 0 25px rgba(0, 242, 254, 0.08);
    --glass-glow-hover: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 242, 254, 0.3), 0 0 15px rgba(127, 83, 172, 0.2);
}

/* 3D Canvas and Particle Layering */
#bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    pointer-events: none;
    background: var(--dark-color);
}

#hero-3d-webgl {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130%;
    height: 130%;
    z-index: 1;
    pointer-events: none;
    mix-blend-mode: screen;
}

@media (max-width: 991.98px) {
    #hero-3d-webgl {
        width: 100%;
        height: 100%;
    }
}

/* GPU Accelerated 3D Tilt Glare Overlay */
.tilt-element {
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
}

.tilt-glare-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    border-radius: inherit;
    z-index: 5;
}

.tilt-glare {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
    mix-blend-mode: overlay;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.tilt-element:hover .tilt-glare {
    opacity: 1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Fix icon spacing in RTL and LTR layouts natively using logical margins */
.btn i, 
.btn-submit-modern i,
.navbar-brand i {
    margin-inline-end: 8px !important;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Cairo', sans-serif;
    overflow-x: hidden;
    scroll-behavior: smooth;
    background-color: var(--dark-color);
    color: #fff;
}

section {
    color: #fff;
}

section p,
section .lead {
    color: rgba(255, 255, 255, 0.85) !important;
}

p.lead.text-muted {
    color: rgba(255, 255, 255, 0.65) !important;
}

.bg-light .text-muted,
.contact-section .text-muted,
.feature-box .text-muted,
.skill-card .text-muted,
.project-card .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* ===== Navigation ===== */
.navbar {
    background: rgba(7, 7, 20, 0.75) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    transition: var(--transition);
    padding: 1rem 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
}

.navbar.scrolled {
    background: rgba(7, 7, 20, 0.9) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 242, 254, 0.15);
    border-bottom-color: rgba(0, 242, 254, 0.15) !important;
}

.navbar-brand {
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.nav-link {
    color: #fff !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Mobile Menu Button */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
}

.bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 3px;
    transition: var(--transition);
}

.navbar-toggler[aria-expanded="true"] .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.navbar-toggler[aria-expanded="true"] .bar:nth-child(2) {
    opacity: 0;
}

.navbar-toggler[aria-expanded="true"] .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ===== Hero Section ===== */
.hero-section {
    position: relative;
    background: var(--gradient-1);
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-buttons .btn {
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: var(--transition);
}

.hero-buttons .btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* ===== Custom Button Redesign & Glows ===== */
.btn {
    transition: var(--transition) !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    border: none !important;
    color: var(--dark-color) !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3) !important;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.03) !important;
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.6) !important;
    color: #fff !important;
}

.btn-outline-light {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-outline-light:hover {
    background: rgba(0, 242, 254, 0.08) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
    transform: translateY(-3px) scale(1.03) !important;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.2) !important;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 50%;
    color: #fff !important;
    font-size: 1.4rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.social-link:hover {
    background: var(--primary-color) !important;
    color: var(--dark-color) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 20px var(--primary-color) !important;
    transform: translateY(-5px) rotate(360deg) !important;
}

/* Typewriter Effect Styles */
.typing-text {
    color: var(--primary-color);
    font-weight: 700;
    position: relative;
}

.cursor {
    display: inline-block;
    width: 3px;
    background-color: #fff;
    animation: blink 1s infinite;
    margin-right: 5px;
    vertical-align: middle;
}

/* ===== Hero Image & Profile ===== */
.hero-image {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.hero-profile-image {
    position: relative;
    width: clamp(200px, 42vw, 320px);
    aspect-ratio: 1 / 1;
    margin: 0 auto 2rem;
    z-index: 3;
    flex-shrink: 0;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: profileFloat 3s ease-in-out infinite;
    aspect-ratio: 1 / 1;
    /* تثبيت النسبة لمنع الـ CLS */
    background: #1a1a2e;
    /* خلفية مؤقتة */
}

.profile-img:hover {
    transform: scale(1.08) translateY(-5px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(74, 144, 226, 0.5);
}

.profile-border {
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border-radius: 50%;
    background: var(--gradient-1);
    z-index: -1;
    opacity: 0.6;
    animation: rotate 10s linear infinite;
}

.profile-glow {
    position: absolute;
    top: -25px;
    left: -25px;
    right: -25px;
    bottom: -25px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.4) 0%, transparent 70%);
    z-index: -2;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes profileFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Code Window */
.code-window {
    width: 100%;
    max-width: 450px;
    background: rgba(8, 8, 17, 0.8);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-lg), var(--glass-glow);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.code-window:hover {
    box-shadow: var(--shadow-lg), var(--glass-glow-hover);
}

.code-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red {
    background: #ff5f56;
}

.dot-yellow {
    background: #ffbd2e;
}

.dot-green {
    background: #27c93f;
}

.code-content {
    padding: 2rem;
    color: #fff;
    font-family: 'Courier New', monospace;
}

.code-content pre {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.8;
}

.code-keyword {
    color: #c792ea;
}

.code-variable {
    color: #82aaff;
}

.code-property {
    color: #7fdbca;
}

.code-string {
    color: #c3e88d;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-indicator a {
    color: #fff;
    font-size: 2rem;
    animation: bounce 2s infinite;
    display: block;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ===== Section Styles ===== */
section {
    padding: 5rem 0;
    width: 100%;
    overflow-x: hidden;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    background: linear-gradient(135deg, #fff 40%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.bg-light {
    background: rgba(255, 255, 255, 0.01) !important;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.bg-light .section-title,
.contact-section .section-title {
    color: #fff !important;
}

.bg-light p,
.contact-section p.lead {
    color: rgba(255, 255, 255, 0.8) !important;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 4px;
    box-shadow: 0 0 10px var(--primary-color);
    transition: width 0.4s ease;
}

.section-title:hover::after {
    width: 90px;
}

/* ===== About Section ===== */
.about-image {
    position: relative;
    padding: 25px;
}

.about-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-1);
    border-radius: 25px;
    z-index: -1;
    opacity: 0.25;
    transform: rotate(-4deg);
    transition: var(--transition);
}

.about-image:hover::before {
    transform: rotate(0deg) scale(1.02);
    opacity: 0.3;
}

.about-profile-img {
    border-radius: 20px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 6px solid #fff;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.about-image:hover .about-profile-img {
    transform: scale(1.06) rotate(1deg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 50px rgba(74, 144, 226, 0.4);
}

.feature-box {
    padding: 2rem;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s ease;
    height: 100%;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.feature-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.feature-box:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-md), var(--glass-glow-hover);
    border-color: rgba(0, 242, 254, 0.3);
}

.feature-box:hover::before {
    transform: scaleX(1);
}

.feature-icon-wrapper {
    width: 65px;
    height: 65px;
    background: rgba(0, 242, 254, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.2rem;
    transition: all 0.4s ease;
    color: var(--primary-color);
    font-size: 1.6rem;
}

.feature-box:hover .feature-icon-wrapper {
    background: var(--primary-color);
    color: var(--dark-color);
    transform: rotateY(180deg);
}

.feature-box h5 {
    font-weight: 700;
    margin-bottom: 0.8rem;
    font-size: 1.15rem;
    color: #fff;
}

.feature-box p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.75);
}

/* ===== Skills Section ===== */
.skill-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
    height: 100%;
    border: 1px solid var(--glass-border);
}

.skill-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-md), var(--glass-glow-hover);
    border-color: rgba(0, 242, 254, 0.3);
}

.skill-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--dark-color);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.2);
}

.skill-card h4 {
    margin-bottom: 1rem;
    color: #fff;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.skill-list {
    text-align: right;
    margin-top: 1.5rem;
}

.skill-bar-item {
    margin-bottom: 1.2rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.progress {
    height: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color)) !important;
    border-radius: 10px;
    box-shadow: 0 0 10px var(--primary-color);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 8px;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.tool-badge i {
    margin-left: 0.5rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.tool-badge:hover {
    background: rgba(0, 242, 254, 0.08) !important;
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.25) !important;
}

.tool-badge:hover i {
    color: var(--dark-color);
}

/* ===== Projects Section ===== */
.project-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--glass-border);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.4s ease;
    z-index: 1;
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02) !important;
    box-shadow: var(--shadow-lg), var(--glass-glow-hover) !important;
    border-color: rgba(0, 242, 254, 0.3) !important;
}

.project-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 180px;
    /* استخدام خاصية حديثة بدلاً من padding-top لدعم أفضل للمتصفحات */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.project-link-wrapper {
    display: block;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
}

.project-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(74, 144, 226, 0.85) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-overlay .btn {
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.project-overlay .btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.project-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-content h4 {
    margin-bottom: 0.75rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    transition: color 0.3s ease;
    line-height: 1.4;
}

.project-card:hover .project-content h4 {
    color: var(--primary-color);
}

.project-content p {
    margin-bottom: 1rem;
    flex-grow: 1;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

/* Project Tags Styles */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.badge-tech {
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50px;
    background: rgba(53, 122, 189, 0.1);
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.project-card:hover .badge-tech {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.project-card:hover .project-tags .badge {
    transform: scale(1.05);
}

/* ===== Contact Section ===== */
.contact-section {
    background: var(--gradient-1);
    position: relative;
    overflow: hidden;
}

.contact-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(0,242,254,0.03)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.contact-section .container {
    position: relative;
    z-index: 1;
}

/* Contact Info Wrapper */
.contact-info-wrapper {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    height: 100%;
}

.contact-info-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid var(--glass-border);
}

.contact-info-card:hover {
    transform: translateX(-10px);
    box-shadow: var(--shadow-md), var(--glass-glow);
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
}

.contact-info-icon {
    width: 60px;
    height: 60px;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: #fff;
    font-size: 1.75rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.contact-info-card:hover .contact-info-icon {
    transform: rotate(10deg) scale(1.1);
}

.phone-icon {
    background: linear-gradient(135deg, #50c878 0%, #2ecc71 100%);
    box-shadow: 0 4px 15px rgba(80, 200, 120, 0.3);
}

.email-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.contact-info-content h5 {
    margin-bottom: 0.5rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

.contact-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
}

.contact-link:hover {
    color: #357abd;
    transform: translateX(-5px);
}

/* Social Media Section */
.social-media-section h5 {
    color: var(--dark-color);
    font-weight: 700;
}

.social-links-contact {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-link-contact {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #fff;
    font-size: 1.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.social-link-contact::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.social-link-contact:hover::before {
    width: 100px;
    height: 100px;
}

.social-link-contact:hover {
    transform: translateY(-5px) scale(1.1);
}

.github-link {
    background: linear-gradient(135deg, #333 0%, #000 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.linkedin-link {
    background: linear-gradient(135deg, #0077b5 0%, #00a0dc 100%);
    box-shadow: 0 4px 15px rgba(0, 119, 181, 0.3);
}

.twitter-link {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
    box-shadow: 0 4px 15px rgba(29, 161, 242, 0.3);
}

.facebook-link {
    background: linear-gradient(135deg, #1877f2 0%, #0d65d9 100%);
    box-shadow: 0 4px 15px rgba(24, 119, 242, 0.3);
}

/* Contact Form Card */
.contact-form-card {
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    height: 100%;
}

.contact-form-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.contact-form-header h3 {
    color: var(--dark-color);
    font-weight: 700;
    font-size: 1.75rem;
}

/* Modern Form Groups */
.form-group-modern {
    position: relative;
}

.form-icon {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.25rem;
    z-index: 2;
    transition: var(--transition);
}

.form-control-modern {
    width: 100%;
    padding-block: 1rem;
    padding-inline-start: 1.5rem;
    padding-inline-end: 1.5rem;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.01) !important;
    color: #fff !important;
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    background: rgba(255, 255, 255, 0.03) !important;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.2) !important;
}

.form-control-modern:focus+.form-label-modern {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.form-control-modern:focus~.form-icon {
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

/* Validation Styles */
.form-control-modern.is-invalid {
    border-color: #dc3545;
    background: #fff5f5;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.1);
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.form-control-modern.is-valid {
    border-color: #28a745;
    background: #f0fff4;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
}

.invalid-feedback {
    display: none;
    color: #d32f2f;
    font-size: 0.9rem;
    margin-top: 0.8rem;
    padding: 0.8rem 1.2rem;
    background: #ffebee;
    border-radius: 12px;
    border: 1px solid #ffcdd2;
    border-right: 5px solid #d32f2f;
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.15);
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
    position: relative;
}

/* سهم صغير للأعلى */
.invalid-feedback::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 25px;
    width: 14px;
    height: 14px;
    background: #ffebee;
    border-top: 1px solid #ffcdd2;
    border-left: 1px solid #ffcdd2;
    transform: rotate(45deg);
}

.form-control-modern.is-invalid~.invalid-feedback {
    display: block;
}

.form-control-modern.is-invalid~.form-icon {
    color: #dc3545;
}

.form-control-modern.is-valid~.form-icon {
    color: #28a745;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    10%,
    90% {
        transform: translateX(-1px);
    }

    20%,
    80% {
        transform: translateX(2px);
    }

    30%,
    50%,
    70% {
        transform: translateX(-4px);
    }

    40%,
    60% {
        transform: translateX(4px);
    }
}

.form-label-modern {
    position: absolute;
    top: -10px;
    right: 15px;
    background: #0d0f2b;
    padding: 0 8px;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    transition: var(--transition);
    pointer-events: none;
    border-radius: 4px;
}

textarea.form-control-modern {
    resize: vertical;
    min-height: 150px;
    padding-top: 1.5rem;
}

textarea.form-control-modern~.form-icon {
    top: 30px;
    transform: translateY(0);
}

textarea.form-control-modern:focus~.form-icon {
    transform: scale(1.1);
}

/* Submit Button */
.btn-submit-modern {
    width: 100%;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%) !important;
    color: #fff !important;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.25) !important;
}

.btn-submit-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn-submit-modern:hover::before {
    left: 100%;
}

.btn-submit-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(37, 211, 102, 0.5) !important;
}

.btn-submit-modern:active {
    transform: translateY(-1px);
}

.btn-text,
.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spin Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin-animation {
    animation: spin 1s linear infinite;
}

/* Old Contact Styles - Keep for compatibility */
.contact-card {
    background: #fff;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

.contact-info {
    padding: 2rem;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    height: 100%;
}

.contact-info:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.contact-info i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.contact-info h5 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

/* ===== Footer ===== */
footer {
    background: var(--dark-color) !important;
}

footer a {
    font-size: 1.5rem;
    transition: var(--transition);
}

footer a:hover {
    color: var(--primary-color) !important;
    transform: translateY(-3px);
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    animation: whatsappPulse 2s infinite;
}

.whatsapp-float:hover {
    background-color: #128c7e;
    color: #fff;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

@keyframes whatsappPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}


/* ===== Responsive Design ===== */

/* Large Tablets and Small Laptops (992px - 1199px) */
@media (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }

    section {
        padding: 4rem 0;
    }

    .hero-profile-image {
        width: clamp(220px, 35vw, 300px);
    }
}

/* Tablets (768px - 991px) */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(26, 26, 46, 0.98);
        padding: 1.5rem;
        border-radius: 12px;
        margin-top: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: var(--shadow-lg);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }

    .nav-item {
        margin: 0.5rem 0;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        text-align: center;
    }

    .nav-link:hover {
        background: rgba(74, 144, 226, 0.2);
    }

    .nav-link::after {
        display: none;
    }

    section {
        padding: 3.5rem 0;
    }

    .hero-section {
        min-height: auto;
        padding: 100px 0 50px;
    }

    .hero-content {
        text-align: center;
        margin-bottom: 3rem;
    }

    .hero-buttons {
        justify-content: center;
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .social-links {
        justify-content: center;
    }

    .hero-profile-image {
        width: clamp(200px, 45vw, 260px);
        margin: 0 auto 2rem;
    }

    .code-window {
        max-width: 500px;
        margin: 0 auto;
        width: 100%;
    }

    .about-image {
        margin-bottom: 2rem;
        text-align: center;
    }

    /* Project cards overlay optimization for mobile */
    .project-overlay {
        opacity: 1 !important;
        background: linear-gradient(135deg, rgba(26, 26, 46, 0.7) 0%, rgba(74, 144, 226, 0.8) 100%) !important;
    }
    .project-card:hover .project-image img {
        transform: none !important;
    }
    .project-overlay .btn {
        transform: none !important;
        box-shadow: var(--shadow-sm) !important;
    }
}

/* Mobile Landscape and Small Tablets (576px - 767px) */
@media (max-width: 767.98px) {
    html {
        font-size: 15px;
    }

    .navbar-brand {
        font-size: 1.3rem;
    }

    .navbar {
        padding: 0.75rem 0;
    }

    section {
        padding: 3rem 0;
    }

    .hero-section {
        padding: 80px 0 40px;
        text-align: center;
    }

    .hero-content h1 {
        font-size: clamp(1.6rem, 5vw, 2rem);
        margin-bottom: 1.5rem;
        line-height: 1.3;
    }

    .hero-content .lead {
        font-size: 1rem;
    }

    .section-title::after {
        width: 50px;
        height: 3px;
    }

    .hero-profile-image {
        width: clamp(170px, 48vw, 220px);
        margin-bottom: 1.5rem;
    }

    .profile-img {
        border-width: 4px;
    }

    .profile-border {
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
    }

    .profile-glow {
        top: -15px;
        left: -15px;
        right: -15px;
        bottom: -15px;
    }

    .code-window {
        margin-top: 1rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .code-content {
        padding: 1.25rem;
        overflow-x: auto;
    }

    .code-content pre {
        font-size: 0.78rem;
        white-space: pre-wrap;
        word-break: break-word;
    }

    .about-image {
        padding: 15px;
        margin-bottom: 2rem;
    }

    .about-profile-img {
        border-width: 4px;
    }

    .feature-box {
        padding: 1.25rem;
    }

    .feature-box i {
        font-size: 1.75rem;
    }

    .skill-card {
        padding: 1.5rem;
    }

    .skill-icon {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }

    /* project-image uses aspect-ratio - no height override */

    .project-content {
        padding: 1.25rem;
    }

    .project-content h4 {
        font-size: 1.1rem;
    }

    .project-content p {
        font-size: 0.9rem;
    }

    .project-overlay {
        flex-direction: column;
        gap: 0.75rem;
    }

    .project-overlay .btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
    }

    .contact-card {
        padding: 2rem 1.5rem;
    }

    .contact-info {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .contact-info i {
        font-size: 2rem;
    }

    .back-to-top {
        bottom: 20px;
        left: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 25px;
        bottom: 20px;
        right: 20px;
    }
}

/* Mobile Portrait (320px - 575px) */
@media (max-width: 575.98px) {
    html {
        font-size: 14px;
    }

    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .navbar-brand {
        font-size: 1.15rem;
    }

    section {
        padding: 3rem 0;
    }

    .hero-section {
        padding: 80px 0 2rem;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.25;
    }

    .hero-buttons {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 12px;
        margin-top: 20px;
        width: 100%;
    }

    .hero-buttons .btn {
        flex: 1;
        max-width: 160px;
        width: auto !important;
        margin: 0 !important;
        padding: 0.6rem 1rem;
        font-size: 0.92rem;
        border-radius: 50px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    .hero-profile-image {
        width: clamp(160px, 55vw, 220px);
        margin: 20px auto;
    }

    .section-title {
        margin-bottom: 2.5rem;
    }

    .project-card {
        margin-bottom: 1rem;
    }

    /* project-image uses aspect-ratio - no height override */

    .contact-form-card {
        padding: 1.5rem 1rem !important;
    }

    .btn-submit-modern {
        font-size: 1rem;
        padding: 1rem;
    }

    .back-to-top,
    .whatsapp-float {
        width: 45px;
        height: 45px;
        bottom: 15px;
    }

    /* Testimonials cards mobile adjustments */
    .testimonial-card {
        padding: 1.5rem !important;
        border-radius: 16px !important;
    }
    .testimonial-text {
        font-size: 0.9rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1rem !important;
    }
}

/* حل نهائي لمشكلة الهوامش الجانبية */
body {
    overflow-x: hidden !important;
    max-width: 100vw;
}

/* Fix Bootstrap Row Overflow safely */
.row {
    margin-right: calc(-.5 * var(--bs-gutter-x));
    margin-left: calc(-.5 * var(--bs-gutter-x));
    max-width: 100%;
}

/* Ensure proper container padding on mobile */
@media (max-width: 575.98px) {
    .container,
    .container-fluid {
        padding-right: 1rem;
        padding-left: 1rem;
    }
}

/* ===== Desktop sizes (992px+) ===== */
@media (min-width: 992px) {
    .hero-profile-image {
        width: clamp(280px, 28vw, 350px);
    }
}


/* ===== Performance Optimizations ===== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Use contain for better rendering performance */
.project-card,
.skill-card,
.feature-box,
.contact-info {
    contain: layout style;
}

/* Reduce paint areas for animated elements */
.hero-profile-image,
.about-image,
.project-image {
    contain: layout;
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

input,
textarea,
button,
select {
    font-size: 16px !important;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

a,
button,
.btn,
.nav-link {
    -webkit-tap-highlight-color: transparent;
}

/* ===== Contact Section Responsive ===== */
@media (max-width: 991.98px) {

    .contact-info-wrapper,
    .contact-form-card {
        margin-bottom: 2rem;
    }

    .social-links-contact {
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .contact-info-wrapper {
        padding: 2rem;
    }

    .contact-form-card {
        padding: 2rem;
    }

    .contact-info-card {
        padding: 1.25rem;
        gap: 1rem;
    }

    .contact-info-icon {
        width: 50px;
        height: 50px;
        min-width: 50px;
        font-size: 1.5rem;
    }

    .contact-form-header h3 {
        font-size: 1.5rem;
    }

    .social-link-contact {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .contact-section {
        padding: 3rem 0 !important;
    }

    .contact-info-wrapper {
        padding: 1.5rem;
    }

    .contact-form-card {
        padding: 1.5rem;
    }

    .contact-info-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
        padding: 1.5rem 1rem;
    }

    .contact-info-card:hover {
        transform: translateY(-5px);
    }

    .contact-info-icon {
        margin-bottom: 0.5rem;
    }

    .form-control-modern {
        padding: 1rem 3rem 1rem 1rem;
        font-size: 0.95rem;
    }

    .form-icon {
        right: 15px;
        font-size: 1.1rem;
    }

    .btn-submit-modern {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .social-links-contact {
        justify-content: center;
    }
}
/* ===== Mobile Hero Order Fix =====
   On mobile: image (order-1) shows first, text (order-2) shows second */
@media (max-width: 991.98px) {
    .hero-image {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-bottom: 1rem;
    }

    .col-lg-6.order-1 {
        padding-top: 1rem;
    }

    .code-window pre,
    .code-window code {
        white-space: pre-wrap !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .hero-section .row {
        overflow-x: hidden;
    }
}

/* ===== Ultra-small devices (up to 360px) ===== */
@media (max-width: 360px) {
    .hero-profile-image {
        width: 150px;
    }

    .hero-buttons .btn {
        font-size: 0.85rem;
        padding: 0.65rem 0.85rem;
    }

    .social-link {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.4rem;
    }
}

/* ===================================================
   ✨ MODERN FEATURES — Reading Progress, Back-to-Top,
      Language Toggle, Testimonials
   =================================================== */

/* ===== Reading Progress Bar ===== */
#reading-progress-bar {
    position: fixed;
    top: 0;
    right: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    z-index: 9999;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.7);
}

/* ===== Back to Top Button with Circular SVG Progress ===== */
.back-to-top {
    position: fixed;
    bottom: 100px;
    left: 25px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(7, 7, 20, 0.85);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 242, 254, 0.15);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 242, 254, 0.35), 0 0 25px rgba(0, 242, 254, 0.2);
}

.back-to-top i {
    font-size: 1.1rem;
    color: #fff;
    position: absolute;
    z-index: 2;
    transition: transform 0.3s ease;
}

#backToTop:hover i {
    transform: translateY(-2px);
}

/* SVG Ring */
.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 52px;
    height: 52px;
    transform: rotate(-90deg);
}

.progress-ring__bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 3;
}

.progress-ring__fill {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 113.1;
    stroke-dashoffset: 113.1;
    transition: stroke-dashoffset 0.2s linear;
    filter: drop-shadow(0 0 4px rgba(0, 242, 254, 0.8));
}

/* ===== Language Toggle Button ===== */
.lang-btn {
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid rgba(0, 242, 254, 0.25);
    border-radius: 8px;
    color: var(--primary-color);
    font-family: 'Cairo', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.3rem 0.7rem;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 0.5rem;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    white-space: nowrap;
}

.lang-btn:hover {
    background: var(--primary-color);
    color: var(--dark-color);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
    transform: scale(1.05);
}

/* ===== Testimonials Section ===== */
.testimonials-section {
    background: linear-gradient(180deg, rgba(7,7,20,0) 0%, rgba(0, 242, 254, 0.03) 50%, rgba(7,7,20,0) 100%);
    overflow: hidden;
}

.testimonials-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}

.testimonials-track {
    display: flex;
    gap: 1.5rem;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
}

.testimonial-card {
    min-width: calc(100% / 1);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    transition: var(--transition);
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .testimonial-card {
        min-width: calc(50% - 0.75rem);
    }
}

@media (min-width: 1024px) {
    .testimonial-card {
        min-width: calc(33.333% - 1rem);
    }
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 8rem;
    color: rgba(0, 242, 254, 0.06);
    font-family: Georgia, serif;
    line-height: 1;
    pointer-events: none;
}

.testimonial-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.testimonial-card:hover::after {
    opacity: 1;
}

.testimonial-card:hover {
    border-color: rgba(0, 242, 254, 0.3) !important;
    box-shadow: var(--glass-glow-hover) !important;
    transform: translateY(-6px) scale(1.02) !important;
}

.testimonial-stars {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.testimonial-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.8) !important;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark-color);
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.testimonial-author strong {
    display: block;
    font-size: 0.95rem;
    color: #fff;
    font-weight: 700;
}

.testimonial-author span {
    font-size: 0.8rem;
    color: var(--primary-color);
    opacity: 0.8;
}

/* Dots Navigation */
.testimonials-dots {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 2rem;
}

.testimonials-dots .dot-nav {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.testimonials-dots .dot-nav.active {
    background: var(--primary-color);
    width: 24px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
}

/* Language transition for body */
body.lang-switching * {
    transition: opacity 0.2s ease !important;
    opacity: 0.7;
}
