/* 
    Design System for Hazem Masoud Portfolio
    Theme: 60% White / Clean | 40% Blue Accent | Modern Tech
    Primary: #1a56db (Tech Blue)
*/

/* =============================================
   CSS VARIABLES — LIGHT THEME (DEFAULT)
============================================= */
:root {
    --primary-color: #1a56db;
    --primary-dark: #1347c0;
    --primary-light: #eff6ff;
    --primary-mid: #bfdbfe;
    --accent-cyan: #0ea5e9;

    --text-main: #0f172a;
    --text-sub: #1e3a5f;
    --text-muted: #4b6a8a;

    --bg-main: #ffffff;
    --bg-alt: #f0f7ff;
    --bg-card: #ffffff;
    --bg-tech: #e8f3ff;

    --border-color: #ccdcf5;
    --border-light: #e4eef9;
    --white: #ffffff;

    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --shadow-sm: 0 2px 12px rgba(26, 86, 219, 0.08);
    --shadow-md: 0 8px 30px rgba(26, 86, 219, 0.12);
    --shadow-lg: 0 20px 60px rgba(26, 86, 219, 0.18);
    --container-width: 1200px;

    --font-en: 'Inter', sans-serif;
    --font-ar: 'Alexandria', sans-serif;

    --glow-primary: rgba(26, 86, 219, 0.06);
}

/* =============================================
   ANIMATED PARTICLE CANVAS
============================================= */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* =============================================
   DARK THEME VARIABLES
============================================= */
.dark-theme {
    --bg-main: #060d1a;
    --bg-alt: #0d1a30;
    --bg-card: #0a1628;
    --bg-tech: #0d1e35;

    --text-main: #e8f2ff;
    --text-sub: #a8c8f0;
    --text-muted: #6b8fba;

    --border-color: rgba(100, 160, 230, 0.12);
    --border-light: rgba(100, 160, 230, 0.07);

    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 25px 80px rgba(0, 0, 0, 0.6);
    --glow-primary: rgba(26, 86, 219, 0.2);
}

/* =============================================
   BASE RESET
============================================= */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-en);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.7;
    transition: background-color 0.5s ease, color 0.3s ease;
    overflow-x: hidden;
    position: relative;
    -webkit-text-size-adjust: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-alt);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-mid);
}

/* Prevent any element from causing horizontal overflow */
img,
video,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
}

/* =============================================
   ANIMATED BACKGROUND BLOBS — Light Mode
============================================= */
.glow-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
    animation: float 28s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

.blob-1 {
    width: 750px;
    height: 750px;
    background: radial-gradient(circle, rgba(26, 86, 219, 0.22) 0%, transparent 70%);
    top: -15%;
    right: -8%;
}

.blob-2 {
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.18) 0%, transparent 70%);
    bottom: -15%;
    left: -8%;
    animation-delay: -9s;
}

.blob-3 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(99, 179, 237, 0.14) 0%, transparent 70%);
    top: 40%;
    left: 20%;
    animation-duration: 38s;
    animation-direction: alternate-reverse;
}

.dark-theme .blob-1 {
    background: radial-gradient(circle, rgba(26, 86, 219, 0.35) 0%, transparent 70%);
}

.dark-theme .blob-2 {
    background: radial-gradient(circle, rgba(14, 165, 233, 0.28) 0%, transparent 70%);
}

.dark-theme .blob-3 {
    background: radial-gradient(circle, rgba(99, 179, 237, 0.2) 0%, transparent 70%);
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    33% {
        transform: translate(60px, 40px) scale(1.1) rotate(5deg);
    }

    66% {
        transform: translate(-30px, 80px) scale(0.92) rotate(-5deg);
    }

    100% {
        transform: translate(40px, -20px) scale(1.06) rotate(3deg);
    }
}

/* =============================================
   RTL SUPPORT
============================================= */
[dir="rtl"] {
    font-family: var(--font-ar);
    letter-spacing: -0.02em;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3 {
    line-height: 1.5;
    font-weight: 600;
}

[dir="rtl"] p {
    line-height: 1.9;
    font-size: 1.05rem;
}

/* =============================================
   LAYOUT UTILITIES
============================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.section-padding {
    padding: 8rem 0;
}

.center {
    text-align: center;
}

.gray-bg {
    background-color: var(--bg-alt);
}

/* =============================================
   NAVBAR
============================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.dark-theme .navbar {
    background-color: rgba(6, 13, 26, 0.92);
    border-bottom-color: var(--border-color);
}

.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(26, 86, 219, 0.1);
}

.nav-container {
    height: 75px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.logo-text span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
    padding-bottom: 4px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.lang-text {
    font-size: 0.88rem;
    font-weight: 700;
    font-family: var(--font-ar);
}

/* =============================================
   BUTTONS
============================================= */
.btn {
    display: inline-block;
    padding: 0.85rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-cyan));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(26, 86, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 86, 219, 0.4);
}

.btn-outline {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

.dark-theme .btn-outline {
    border-color: var(--primary-color);
    color: #93c5fd;
}

.dark-theme .btn-outline:hover {
    background-color: rgba(26, 86, 219, 0.15);
}

.btn-text {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-text:hover i {
    transform: translateX(5px);
}

[dir="rtl"] .btn-text:hover i {
    transform: translateX(-5px);
}

.btn-sm {
    padding: 0.55rem 1.2rem;
    font-size: 0.85rem;
}

/* =============================================
   HERO SECTION
============================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 75px;
    background: linear-gradient(160deg, #f0f7ff 0%, #ffffff 45%, #dbeafe 100%);
    background-size: 300% 300%;
    animation: heroGradient 18s ease infinite;
    position: relative;
    overflow: hidden;
}

/* Animated shimmer orb inside hero */
.hero::after {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(26, 86, 219, 0.10) 0%, rgba(14, 165, 233, 0.07) 40%, transparent 70%);
    filter: blur(80px);
    top: -30%;
    right: -15%;
    animation: orbFloat 20s ease-in-out infinite alternate;
    pointer-events: none;
}

/* Tech grid overlay */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(26, 86, 219, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 86, 219, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

.dark-theme .hero {
    background: linear-gradient(160deg, #030912 0%, #060d1a 45%, #0d1a30 100%);
    background-size: 300% 300%;
    animation: heroGradientDark 18s ease infinite;
}

.dark-theme .hero::after {
    background: radial-gradient(circle, rgba(26, 86, 219, 0.25) 0%, rgba(14, 165, 233, 0.15) 40%, transparent 70%);
}

.dark-theme .hero::before {
    background-image:
        linear-gradient(rgba(26, 86, 219, 0.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26, 86, 219, 0.09) 1px, transparent 1px);
}

@keyframes heroGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes heroGradientDark {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes orbFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-60px, 80px) scale(1.15);
    }

    100% {
        transform: translate(40px, -40px) scale(0.9);
    }
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.8rem;
    margin-bottom: 1.2rem;
    color: var(--text-main);
}

.hero-title small {
    display: block;
    font-size: 1.15rem;
    color: var(--primary-color);
    margin-top: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.dark-theme .hero-title small {
    color: #60a5fa;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 500px;
    line-height: 1.8;
}

.hero-btns {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.hero-image {
    position: relative;
}

.image-wrapper {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(26, 86, 219, 0.2);
    border: 3px solid rgba(26, 86, 219, 0.1);
}

.dark-theme .image-wrapper {
    border-color: rgba(26, 86, 219, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.experience-badge {
    position: absolute;
    bottom: 30px;
    right: -18px;
    background: #ffffff;
    padding: 1.2rem 1.6rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(26, 86, 219, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid var(--primary-mid);
}

.dark-theme .experience-badge {
    background: #0d1a30;
    border-color: rgba(26, 86, 219, 0.4);
}

[dir="rtl"] .experience-badge {
    right: auto;
    left: -18px;
}

.experience-badge .number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

.experience-badge .text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* =============================================
   SECTION TITLE
============================================= */
.section-title {
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 1rem;
    color: var(--text-main);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-cyan));
    border-radius: 3px;
}

[dir="rtl"] .section-title::after {
    left: auto;
    right: 0;
}

.section-title.center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* =============================================
   ABOUT SECTION
============================================= */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.9;
}

.quote-card {
    background: linear-gradient(135deg, var(--primary-light) 0%, #dbeafe 100%);
    padding: 3.5rem 3rem;
    border-radius: 28px;
    position: relative;
    border: 1px solid var(--primary-mid);
}

.dark-theme .quote-card {
    background: linear-gradient(135deg, #0d1a30 0%, #0a1628 100%);
    border-color: rgba(26, 86, 219, 0.25);
}

.quote-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    opacity: 0.25;
    position: absolute;
    top: 28px;
    left: 28px;
}

[dir="rtl"] .quote-card i {
    left: auto;
    right: 28px;
}

.quote-card p {
    font-size: 1.3rem;
    font-weight: 500;
    font-style: italic;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: var(--text-sub);
}

.dark-theme .quote-card p {
    color: var(--text-main);
}

.quote-author {
    display: block;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* =============================================
   STATS SECTION
============================================= */
.stats {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0ea5e9 100%);
    position: relative;
    overflow: hidden;
}

.stats::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    position: relative;
    z-index: 1;
}

.stat-item {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(5px);
    border-radius: 0;
    transition: var(--transition);
}

.stat-item:first-child {
    border-radius: 20px 0 0 20px;
}

.stat-item:last-child {
    border-radius: 0 20px 20px 0;
}

[dir="rtl"] .stat-item:first-child {
    border-radius: 0 20px 20px 0;
}

[dir="rtl"] .stat-item:last-child {
    border-radius: 20px 0 0 20px;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-5px);
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
}

/* =============================================
   SKILLS SECTION
============================================= */
.skills-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 4rem;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 2.5rem;
    transition: var(--transition);
}

.skill-category:hover {
    border-color: var(--primary-mid);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.dark-theme .skill-category {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.skill-category h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.skill-category h3::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.skill-tags span {
    padding: 0.55rem 1.1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border-light);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-sub);
    transition: var(--transition);
}

.dark-theme .skill-tags span {
    background: rgba(26, 86, 219, 0.1);
    border-color: rgba(26, 86, 219, 0.2);
    color: #93c5fd;
}

.skill-tags span:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* =============================================
   COURSES SECTION
============================================= */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-top: 4rem;
}

.course-card {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.dark-theme .course-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.course-card:hover {
    transform: translateY(-8px);
    border-color: rgba(26, 86, 219, 0.3);
    box-shadow: 0 15px 40px rgba(26, 86, 219, 0.15), 0 0 20px rgba(14, 165, 233, 0.2);
}

/* Blue top accent line on hover */
.course-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-cyan));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.course-card:hover::after {
    transform: scaleX(1);
}

.course-img {
    width: 100%;
    height: 230px;
    overflow: hidden;
    background: linear-gradient(145deg, #eef5ff 0%, #dbeafe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
}

.dark-theme .course-img {
    background: linear-gradient(145deg, #0a1628 0%, #0d1f3e 100%);
}

.course-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
    transition: transform 0.5s ease, filter 0.3s ease;
    border-radius: 10px;
    filter: drop-shadow(0 4px 12px rgba(26, 86, 219, 0.15));
}

.course-card:hover .course-img img {
    transform: scale(1.04) translateY(-3px);
    filter: drop-shadow(0 8px 20px rgba(26, 86, 219, 0.25));
}

.course-content {
    padding: 1.8rem 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.course-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
    color: var(--text-main);
}

.course-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    flex-grow: 1;
    line-height: 1.7;
}

.course-actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

/* =============================================
   SERVICES SECTION
============================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 4rem;
}

.service-item {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dark-theme .service-item {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.service-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(to top, var(--primary-light), transparent);
    transition: height 0.4s ease;
}

.dark-theme .service-item::before {
    background: linear-gradient(to top, rgba(26, 86, 219, 0.1), transparent);
}

.service-item:hover::before {
    height: 100%;
}

.service-item:hover {
    transform: translateY(-8px);
    border-color: var(--primary-mid);
    box-shadow: var(--shadow-md);
}

.service-item i {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 1.2rem;
    display: block;
    position: relative;
    z-index: 1;
}

.service-item h3 {
    font-size: 1rem;
    margin-bottom: 0.6rem;
    color: var(--text-main);
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.service-item p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* =============================================
   TESTIMONIALS SECTION
============================================= */
.testimonials {
    background: var(--bg-main);
    position: relative;
    overflow: hidden;
}

.testi-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    margin-top: 4rem;
}

.testi-img-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 12px;
    position: relative;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    max-width: 380px;
    margin: 0 auto;
}

.dark-theme .testi-img-wrapper {
    border-color: var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.testi-img-wrapper:hover {
    transform: translateY(-8px);
    border-color: var(--primary-mid);
    box-shadow: var(--shadow-lg);
}

.testi-img-wrapper img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.testi-img-wrapper:hover img {
    transform: scale(1.05);
}

/* =============================================
   CONTACT SECTION
============================================= */
.contact-section {
    background: var(--bg-alt);
}

.contact-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-top: -1rem;
    margin-bottom: 3.5rem;
    font-size: 1.05rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* ensure QR card has enough height for text */
.qr-card .contact-card-body {
    width: 100%;
}

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.dark-theme .contact-card {
    border-color: var(--border-color);
}

.contact-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(26, 86, 219, 0.04), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(26, 86, 219, 0.3);
}

.contact-card:hover::after {
    opacity: 1;
}

.contact-card-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.email-icon {
    background: linear-gradient(135deg, #eff6ff, #bfdbfe);
    color: var(--primary-color);
}

.dark-theme .email-icon {
    background: rgba(26, 86, 219, 0.2);
    color: #93c5fd;
}

.wa-icon {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #16a34a;
}

.dark-theme .wa-icon {
    background: rgba(22, 163, 74, 0.18);
}

.contact-card-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.contact-card-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
    word-break: break-all;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.contact-card-action {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: gap 0.3s ease;
}

.contact-card:hover .contact-card-action {
    gap: 0.7rem;
}

.wa-badge {
    color: #16a34a;
    background: #dcfce7;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.82rem;
}

.dark-theme .wa-badge {
    background: rgba(22, 163, 74, 0.18);
    color: #4ade80;
}

.qr-card {
    flex-direction: column;
    align-items: flex-start;
}

.qr-wrapper {
    align-self: center;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid var(--primary-mid);
    background: #fff;
    padding: 10px;
    margin-bottom: 0.5rem;
}

.qr-wrapper img {
    display: block;
    border-radius: 8px;
}

/* =============================================
   FOOTER
============================================= */
.footer {
    padding: 5rem 0 2rem;
    background: linear-gradient(170deg, #f0f7ff 0%, #dbeafe 100%);
    border-top: 1px solid var(--border-light);
}

.dark-theme .footer {
    background: linear-gradient(170deg, #060d1a 0%, #0d1a30 100%);
    border-top-color: var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-info p {
    margin: 1.2rem 0 1.8rem;
    max-width: 380px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.8;
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-links a {
    width: 42px;
    height: 42px;
    background: var(--bg-main);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.dark-theme .social-links a {
    background: var(--bg-alt);
    border-color: var(--border-color);
}

.social-links a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(26, 86, 219, 0.3);
}

/* Brand Colors on Hover */
.social-links a[aria-label="LinkedIn"]:hover {
    background: #0077B5;
    color: #fff;
    border-color: #0077B5;
}

.social-links a[aria-label="YouTube"]:hover {
    background: #FF0000;
    color: #fff;
    border-color: #FF0000;
}

.social-links a[aria-label="Instagram"]:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    color: #fff;
    border-color: transparent;
}

.social-links a[aria-label="Facebook"]:hover {
    background: #1877F2;
    color: #fff;
    border-color: #1877F2;
}

.social-links a[aria-label="WhatsApp"]:hover {
    background: #25D366;
    color: #fff;
    border-color: #25D366;
}

.social-links a[aria-label="Email"]:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.footer-nav h4,
.footer-contact-info h4 {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 700;
}

.footer-nav ul li,
.footer-contact-info ul li {
    margin-bottom: 0.85rem;
}

.footer-nav ul li a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-nav ul li a:hover {
    color: var(--primary-color);
}

.footer-contact-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: var(--transition);
    word-break: break-all;
}

.footer-contact-link i {
    font-size: 1rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.footer-contact-link:hover {
    color: var(--primary-color);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.dark-theme .footer-bottom {
    border-top-color: var(--border-color);
}

/* =============================================
   SCROLL REVEAL ANIMATIONS
============================================= */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: all 0.75s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* =============================================
   FLOATING SOCIAL SIDEBAR
============================================= */
.social-sidebar {
    position: fixed;
    top: 50%;
    left: 1.5rem;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 999;
}

[dir="rtl"] .social-sidebar {
    left: auto;
    right: 1.5rem;
}

.social-sidebar a {
    width: 45px;
    height: 45px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.dark-theme .social-sidebar a {
    border-color: var(--border-color);
}

.social-sidebar a:hover {
    transform: translateX(5px);
}

[dir="rtl"] .social-sidebar a:hover {
    transform: translateX(-5px);
}

.social-sidebar a[aria-label="LinkedIn"]:hover {
    background: #0077B5;
    color: #fff;
    border-color: #0077B5;
    box-shadow: 0 5px 15px rgba(0, 119, 181, 0.4);
}

.social-sidebar a[aria-label="YouTube"]:hover {
    background: #FF0000;
    color: #fff;
    border-color: #FF0000;
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.4);
}

.social-sidebar a[aria-label="Instagram"]:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(214, 36, 159, 0.4);
}

.social-sidebar a[aria-label="Facebook"]:hover {
    background: #1877F2;
    color: #fff;
    border-color: #1877F2;
    box-shadow: 0 5px 15px rgba(24, 119, 242, 0.4);
}

/* =============================================
   MOBILE MENU
============================================= */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: var(--transition);
}

/* =============================================
   RESPONSIVE — TABLET (≤ 1024px)
============================================= */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    /* Stats: 4 → 2 columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item {
        border-radius: 20px !important;
    }

    /* Grid updates for medium screens */
    .services-grid,
    .testi-grid,
    .skills-container,
    .contact-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Footer: 3 → 2 columns on tablet */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }

    /* Footer info spans full width on tablet */
    .footer-info {
        grid-column: 1 / -1;
    }
}

/* =============================================
   RESPONSIVE — MOBILE (≤ 768px)
============================================= */
@media (max-width: 768px) {
    .section-padding {
        padding: 5rem 0;
    }

    /* Section title margins */
    .section-title {
        font-size: 2rem;
    }

    /* ---- NAVBAR ---- */
    .nav-links {
        position: fixed;
        top: 75px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 75px);
        background-color: var(--bg-main);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 3rem;
        gap: 2rem;
        transition: left 0.3s ease;
        z-index: 999;
        border-top: 1px solid var(--border-light);
        overflow-y: auto;
    }

    .dark-theme .nav-links {
        background-color: var(--bg-main);
        border-top-color: var(--border-color);
    }

    .nav-links a {
        font-size: 1.1rem;
    }

    .nav-links.active {
        left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* ---- HERO ---- */
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .hero {
        text-align: center;
        padding-top: 100px;
        min-height: auto;
        padding-bottom: 4rem;
    }

    .hero-title {
        font-size: 2.6rem;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
        font-size: 1rem;
    }

    .hero-btns {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-image {
        order: -1;
        max-width: 320px;
        margin: 0 auto;
    }

    .experience-badge {
        right: 0;
        bottom: 10px;
    }

    [dir="rtl"] .experience-badge {
        left: 0;
        right: auto;
    }

    /* ---- ABOUT ---- */
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .section-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    [dir="rtl"] .section-title::after {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .section-title:not(.center)::after {
        left: 50%;
        transform: translateX(-50%);
    }

    /* ---- STATS ---- */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Stack grids to 1 column on mobile */
    .courses-grid,
    .skills-container,
    .contact-grid,
    .testi-gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* ---- SERVICES ---- */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }

    .contact-subtitle {
        font-size: 0.95rem;
        padding: 0 1rem;
    }

    /* ---- FOOTER ---- */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .footer-info {
        grid-column: auto;
    }

    .footer-info p {
        max-width: 100%;
    }

    .social-links {
        flex-wrap: wrap;
    }

    /* Hide floating social bar */
    .social-sidebar {
        display: none;
    }
}

/* =============================================
   SMALLER MOBILE (≤ 480px)
============================================= */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 2.1rem;
    }

    .hero-btns {
        flex-direction: column;
        align-items: center;
    }

    .hero-btns .btn {
        width: 100%;
        text-align: center;
    }

    /* Stats: 2 columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-number {
        font-size: 2.2rem;
    }

    /* Services: 1 column on very small */
    .services-grid {
        grid-template-columns: 1fr;
    }

    /* Quote card */
    .quote-card {
        padding: 2.5rem 1.5rem;
    }

    .quote-card p {
        font-size: 1.1rem;
    }

    /* Section title */
    .section-title {
        font-size: 1.8rem;
    }

    /* Course actions wrap */
    .course-actions {
        flex-wrap: wrap;
    }

    /* Contact cards: reduce padding */
    .contact-card {
        padding: 1.8rem 1.5rem;
    }

    /* QR wrapper centered */
    .qr-wrapper {
        align-self: center;
    }

    /* Nav actions */
    .nav-actions {
        gap: 0.5rem;
    }
}

/* =============================================
   COURSE PAGES — LIGHT MODE  (html.lc-light)
============================================= */

/* ── Theme toggle button in course navbar ── */
#course-theme-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#course-theme-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ── Light overrides ── */
html.lc-light body {
    background-color: #f0f7ff !important;
    color: #0f172a !important;
}

html.lc-light .course-hero {
    background: linear-gradient(135deg, #1347c0 0%, #1a56db 50%, #0ea5e9 100%) !important;
}

html.lc-light .stats-bar {
    background: #ffffff !important;
    border-bottom-color: #ccdcf5 !important;
}

html.lc-light .stat-bar-item {
    border-color: #e4eef9 !important;
}

html.lc-light .stat-bar-item .lbl {
    color: #4b6a8a !important;
}

html.lc-light .stat-bar-item .num {
    color: #1a56db !important;
}

html.lc-light .course-body {
    background-color: #f0f7ff;
}

html.lc-light .section-tabs {
    background: #ffffff !important;
    border-color: #ccdcf5 !important;
}

html.lc-light .tab-btn {
    color: #4b6a8a !important;
}

html.lc-light .tab-btn:hover:not(.active) {
    background: rgba(26, 86, 219, 0.06) !important;
    color: #1a56db !important;
}

html.lc-light .section-header {
    border-bottom-color: #ccdcf5 !important;
}

html.lc-light .section-header h2 {
    color: #0f172a !important;
}

html.lc-light .lecture-item {
    background: #ffffff !important;
    border-color: #ccdcf5 !important;
    color: #0f172a !important;
}

html.lc-light .lecture-item:hover {
    background: rgba(26, 86, 219, 0.05) !important;
    border-color: rgba(26, 86, 219, 0.3) !important;
}

html.lc-light .lecture-title {
    color: #0f172a !important;
}

html.lc-light .lecture-duration-badge {
    color: #4b6a8a !important;
}

html.lc-light .lecture-num {
    background: rgba(26, 86, 219, 0.1) !important;
    color: #1a56db !important;
}

html.lc-light .lecture-item.hw-item {
    background: #f0fff4 !important;
    border-color: rgba(34, 197, 94, 0.25) !important;
}

html.lc-light .lecture-item.hw-item .lecture-num {
    background: rgba(34, 197, 94, 0.12) !important;
    color: #16a34a !important;
}

html.lc-light .sidebar-card {
    background: #ffffff !important;
    border-color: #ccdcf5 !important;
}

html.lc-light .sidebar-card-header {
    background: rgba(26, 86, 219, 0.07) !important;
    border-bottom-color: #e4eef9 !important;
    color: #1a56db !important;
}

html.lc-light .sidebar-item {
    border-bottom-color: #e4eef9 !important;
}

html.lc-light .sidebar-item .s-label {
    color: #4b6a8a !important;
}

html.lc-light .sidebar-item .s-val {
    color: #0f172a !important;
}

html.lc-light .topic-item {
    color: #1e3a5f !important;
}

html.lc-light footer {
    background: #e8f3ff !important;
    border-top-color: #ccdcf5 !important;
}

html.lc-light footer p {
    color: #4b6a8a !important;
}

/* Navbar in light mode for course pages */
html.lc-light .navbar.dark-theme {
    background: rgba(240, 247, 255, 0.97) !important;
    border-bottom-color: #ccdcf5 !important;
}

html.lc-light .navbar.dark-theme .logo-text {
    color: #0f172a !important;
}

html.lc-light #course-theme-btn {
    border-color: rgba(26, 86, 219, 0.25);
    color: #1a56db;
}

html.lc-light #course-theme-btn:hover {
    background: rgba(26, 86, 219, 0.08);
}

/* =============================================
   LECTURE DONE BUTTON
============================================= */
.lecture-done-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    margin-right: 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-en);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
}

[dir="rtl"] .lecture-done-btn {
    margin-right: 0;
    margin-left: 0.8rem;
}

.lecture-done-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-2px);
}

.lecture-done-btn.is-done {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #34d399;
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.lecture-done-btn.is-done:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

html.lc-light .lecture-done-btn {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.03);
    color: #4b6a8a;
}

html.lc-light .lecture-done-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #0f172a;
}

html.lc-light .lecture-done-btn.is-done {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #34d399;
    color: #fff;
}

@keyframes sparkle {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.sparkle-anim {
    animation: sparkle 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Confetti Particles for DONE button */
.done-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: particleExplode 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes particleExplode {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0);
        opacity: 0;
    }
}