/* ================= VARIABLES ================= */
:root {
    /* Dark Mode (Default) */
    --bg-color: #0f172a;
    /* User: Dark Background */
    --bg-alt: #1e293b;
    /* User: Cards / Sections */
    --primary: #38bdf8;
    /* User: Primary Buttons */
    --primary-hover: #0ea5e9;
    /* User: Button Hover */
    --primary-glow: rgba(56, 189, 248, 0.4);
    --accent: #22c55e;
    /* User: Accent / Highlights */
    --accent-glow: rgba(34, 197, 94, 0.4);
    --text-main: #e5e7eb;
    /* User: Primary Text (White-ish Gray) */
    --text-muted: #94a3b8;
    /* User: Secondary Text (Blue-ish Gray) */

    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-hover: rgba(56, 189, 248, 0.1);
    --card-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --transition-normal: all 0.3s var(--ease-out);
}

/* Light Mode Variables */
body.light-theme {
    --bg-color: #f8fafc;
    /* User: Light Background */
    --bg-alt: #ffffff;
    /* User: Cards / Sections */
    --text-main: #0f172a;
    /* User: Primary Text (Very Dark) */
    --text-muted: #475569;
    /* User: Secondary Text */

    /* Primary & Accent remain similar but can be tweaked if needed, User kept them same/similar */
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --accent: #22c55e;

    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 0, 0, 0.05);
    --card-hover: rgba(56, 189, 248, 0.1);
    --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    /* Softer shadow for light mode */
}

/* ================= RESET & BASE ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Premium Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-normal);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ================= UTILITIES ================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .reveal {
        transform: translateY(20px);
    }
}

.cert-stats {
    margin-top: 25px;
    display: flex;
    justify-content: center;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    background: var(--bg-alt);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-normal);
}

.stat-badge:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px var(--primary-glow);
}

.stat-badge i {
    color: var(--primary);
    font-size: 1.4rem;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.stat-badge .num {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--font-heading);
}

.stat-badge .plus {
    font-size: 1.4rem;
    font-weight: 700;
    margin-left: -5px;
}

.stat-badge .label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .stat-badge {
        padding: 8px 18px;
        gap: 8px;
    }

    .stat-badge .num {
        font-size: 1.5rem;
    }

    .stat-badge .plus {
        font-size: 1.2rem;
    }

    .stat-badge .label {
        font-size: 0.9rem;
    }
}

.highlight {
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary-glow);
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 8px;
    background: var(--primary);
    opacity: 0.2;
    z-index: -1;
    border-radius: 4px;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    transition: var(--transition-normal);
    position: relative;
    will-change: transform, opacity;
}

/* Scroll Animation Classes */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .reveal {
        transform: translateY(20px);
    }
}

/* Particles Background Canvas */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Touch Feedback */
.glass:active,
.project-new-card:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

.glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(400px circle at var(--mouse-x) var(--mouse-y), rgba(56, 189, 248, 0.15), transparent 40%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 1;
}

.glass:hover::before {
    opacity: 1;
}

/* Animated Background Blobs */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: float-blob infinite alternate ease-in-out;
}

.blob-1 {
    background: rgba(56, 189, 248, 0.08);
    top: -10%;
    left: -10%;
    animation-duration: 8s;
}

.blob-2 {
    background: rgba(34, 197, 94, 0.06);
    bottom: -10%;
    right: -10%;
    animation-duration: 12s;
    animation-delay: -2s;
}

.blob-3 {
    background: rgba(56, 189, 248, 0.05);
    top: 40%;
    left: 15%;
    width: 30vw;
    height: 30vw;
    animation-duration: 10s;
    animation-delay: -5s;
}

@keyframes float-blob {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(10%, 15%) scale(1.1);
    }
}

@media (max-width: 768px) {
    .blob {
        width: 60vw;
        height: 60vw;
        opacity: 0.06;
    }
}

/* Theme Toggle Button */
.theme-btn {
    background: var(--bg-alt);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition-normal);
    margin-left: 20px;
}

.theme-btn:hover {
    color: var(--primary);
    transform: rotate(15deg);
    border-color: var(--primary);
}

/* Language Switcher */
.lang-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition-normal);
    margin-left: 10px;
    font-family: inherit;
}

.lang-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(56, 189, 248, 0.1);
}

/* RTL Support */
body.rtl {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    /* Cairo Font for Arabic */
}

body.rtl .nav-links {
    flex-direction: row-reverse;
}

body.rtl .theme-btn,
body.rtl .lang-btn {
    margin-left: 0;
    margin-right: 10px;
    /* Mirror margin */
}

body.rtl .skill-category h3 {
    border-left: none;
    border-right: 4px solid var(--primary);
    padding-left: 0;
    padding-right: 15px;
}

body.rtl .hero-content {
    text-align: right;
}

body.rtl .hero-content h1 {
    background: linear-gradient(to left, var(--text-main), #94a3b8);
    /* Flip gradient direction */
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.rtl .input-group input:focus~label,
body.rtl .input-group input:not(:placeholder-shown)~label,
body.rtl .input-group textarea:focus~label,
body.rtl .input-group textarea:not(:placeholder-shown)~label {
    left: auto;
    right: 0;
}

/* ================= COMPONENT: BUTTONS ================= */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    color: #0f172a;
    border: none;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

/* Button Shimmer */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: all 0.6s;
}

.btn:hover::before {
    left: 100%;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: rgba(56, 189, 248, 0.1);
    transform: translateY(-3px);
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* Ensure headings inherit/use the correct color variable if overriding general white */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-main);
}

/* ================= NAVBAR ================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: padding 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo .dot {
    color: var(--primary);
    font-size: 3rem;
    line-height: 0;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.8;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    opacity: 1;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-main);
    margin: 5px 0;
    transition: 0.3s;
}

/* Scroll Progress Bar */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    z-index: 1002;
    transition: width 0.1s;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-color);
    /* Adaptive: Dark in Dark, Light in Light */
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    opacity: 0.98;
}

.mobile-menu.active {
    transform: translateY(0);
}

.mobile-nav-links {
    text-align: center;
}

.mobile-nav-links li {
    margin: 25px 0;
}

.mobile-nav-links a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    transition: var(--transition-normal);
    display: inline-block;
}

.mobile-nav-links a:hover,
.mobile-nav-links a:active {
    color: var(--primary);
    transform: scale(1.1);
}

/* ================= HERO SECTION ================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
}

.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(34, 197, 94, 0.1) 0%, transparent 40%);
    z-index: -1;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 50px;
    align-items: center;
}

.hero-content .greeting {
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: block;
}

/* Hero Name Styling */
/* Hero Name Shimmer Animation */
.hero-content h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(to right, var(--text-main) 20%, var(--primary) 40%, var(--primary) 60%, var(--text-main) 80%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    animation: gradient-shift 8s linear infinite;
}

@keyframes gradient-shift {
    to {
        background-position: 200% center;
    }
}

/* Typewriter Cursor */
.typing-text::after {
    content: '|';
    margin-left: 2px;
    color: var(--primary);
    animation: blink 0.8s infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Light Mode specific Hero Name - Shiny Black */
body.light-theme .hero-content h1 {
    background: linear-gradient(to bottom, #000000, #434343);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    /* Slight depth */
}

body.light-theme.rtl .hero-content h1 {
    background: linear-gradient(to left, #000000, #434343);
    background-clip: text;
    -webkit-background-clip: text;
}

.hero-content .title {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    font-weight: 400;
}

.hero-content .title .typing-text {
    color: var(--accent);
    font-weight: 600;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 40px;
}

.hero-btns {
    display: flex;
    gap: 20px;
}

.hero-visuals {
    position: relative;
    animation: float 6s ease-in-out infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-profile-img {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--glass-border);
    box-shadow: 0 0 30px var(--primary-glow);
    animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
    from {
        box-shadow: 0 0 20px var(--primary-glow);
    }

    to {
        box-shadow: 0 0 40px var(--primary-glow), 0 0 60px rgba(56, 189, 248, 0.2);
    }
}

.code-card {
    padding: 25px;
    border-radius: 15px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

.card-header {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.red {
    background: #ff5f56;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #27c93f;
}

.keyword {
    color: #c678dd;
}

.var {
    color: #e5c07b;
}

.string {
    color: #98c379;
}

.key {
    color: #e06c75;
}

.bool {
    color: #d19a66;
}

/* ================= FEATURED PROJECTS ================= */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition-normal);
    position: relative;
    background: var(--bg-alt);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-img-wrapper {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img {
    transform: scale(1.1);
}

.project-img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    opacity: 0;
    transition: 0.3s;
    z-index: 2;
}

.project-card:hover .project-img-overlay {
    opacity: 1;
}

.icon-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    color: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: 0.3s;
}

.icon-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.1);
}

.project-info {
    padding: 25px;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tags span {
    font-size: 0.8rem;
    padding: 5px 12px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    border-radius: 20px;
}

/* ================= SKILLS ================= */
.skills-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 60px;
}

.skills-category h3 {
    margin-bottom: 25px;
    font-size: 1.5rem;
    border-left: 4px solid var(--primary);
    padding-left: 15px;
}

.skill-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 30px;
}

.skill-item {
    background: var(--bg-alt);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    transition: 0.3s;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.skill-item:hover {
    border-color: var(--glass-border);
    transform: translateY(-8px);
    background: var(--glass-bg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.skill-item i {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.skill-item:hover i {
    transform: scale(1.1);
}

.skill-item span {
    font-size: 1.1rem;
    font-weight: 500;
}

.skill-progress-container {
    max-width: 800px;
    margin: 0 auto;
}

.skill-bar-item {
    margin-bottom: 25px;
}

.skill-bar-item .info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 500;
}

.skill-bar-item .bar {
    height: 8px;
    background: #334155;
    border-radius: 10px;
    overflow: hidden;
}

.skill-bar-item .fill {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.skill-bar-item .fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* ================= ABOUT ================= */
.about-container {
    display: flex;
    justify-content: center;
}

.about-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 50px;
    padding: 50px;
    border-radius: 30px;
    align-items: center;
    background: var(--glass-bg);
}

.profile-img-container {
    width: 250px;
    height: 250px;
    margin: 0 auto;
}

.profile-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-alt);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: var(--text-muted);
    border: 2px solid var(--glass-border);
}

.about-content h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.about-stats {
    display: flex;
    gap: 40px;
    margin-top: 30px;
}

.stat .num {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat .desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ================= ALL PROJECTS ================= */
.filter-btns {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 8px 25px;
    border-radius: 30px;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: #0f172a;
    border-color: var(--primary);
}

.projects-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.masonry-item {
    display: block;
    /* for animation control in JS */
}

.masonry-item .project-card {
    height: 100%;
    /* align heights */
}

.project-info.small h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

/* ================= SOCIAL SECTION ================= */
.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.social-card {
    background: var(--bg-alt);
    padding: 30px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border: 1px solid transparent;
    transition: 0.4s;
    position: relative;
    overflow: hidden;
}

.social-card::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 60%);
    opacity: 0;
    transition: 0.4s;
}

.social-card:hover::before {
    opacity: 1;
}

.social-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.2);
}

.social-card .icon-box {
    font-size: 3rem;
    color: var(--text-muted);
    transition: 0.3s;
}

.social-card span {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Specific Social Colors */
.whatsapp:hover .icon-box {
    color: #25D366;
}

.linkedin:hover .icon-box {
    color: #0077B5;
}

.github:hover .icon-box {
    color: #fff;
}

.telegram:hover .icon-box {
    color: #0088cc;
}

.discord:hover .icon-box {
    color: #5865F2;
}

.footer-socials a:has(.fa-discord):hover {
    background: #5865F2;
    color: #fff;
}

/* ================= CONTACT ================= */
.contact-container {
    max-width: 800px;
}

.contact-form-wrapper {
    padding: 50px;
    border-radius: 20px;
    background: var(--glass-bg);
}

.contact-form-wrapper h2 {
    text-align: center;
    margin-bottom: 40px;
}

.input-group {
    position: relative;
    margin-bottom: 40px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 10px 0;
    font-size: 1rem;
    color: #fff;
    background: transparent;
    border: none;
    border-bottom: 2px solid #555;
    outline: none;
    transition: 0.3s;
}

.input-group label {
    position: absolute;
    top: 5px;
    left: 0;
    color: #999;
    pointer-events: none;
    transition: 0.3s;
    font-size: 1rem;
}

/* Floating Label Logic */
.input-group input:focus~label,
.input-group input:not(:placeholder-shown)~label,
.input-group textarea:focus~label,
.input-group textarea:not(:placeholder-shown)~label {
    top: -20px;
    font-size: 0.85rem;
    color: var(--primary);
}

/* Light Mode Input Fixes */
body.light-theme .input-group input,
body.light-theme .input-group textarea {
    color: var(--text-main);
    border-bottom-color: #cbd5e1;
    /* Lighter border for light mode */
}

body.light-theme .input-group label {
    color: var(--text-muted);
}

body.light-theme .input-group input:focus,
body.light-theme .input-group textarea:focus {
    border-bottom-color: var(--primary);
}

.input-group input:focus,
.input-group textarea:focus {
    border-bottom-color: var(--primary);
}

/* ================= FOOTER ================= */
footer {
    padding: 40px 0;
    text-align: center;
    background: var(--bg-alt);
    border-top: 1px solid var(--glass-border);
    margin-top: 50px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-socials {
    display: flex;
    gap: 20px;
}

.footer-socials a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.3s;
}

.footer-socials a:hover {
    background: var(--primary);
    color: var(--bg-color);
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: #0f172a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px var(--primary-glow);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 99;
}

.back-to-top.active {
    opacity: 1;
    pointer-events: all;
    bottom: 30px;
}

/* ================= ANIMATIONS ================= */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes glow {
    0% {
        text-shadow: 0 0 10px rgba(56, 189, 248, 0);
    }

    50% {
        text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
    }

    100% {
        text-shadow: 0 0 10px rgba(56, 189, 248, 0);
    }
}

.glow-text {
    animation: glow 3s infinite;
}

/* ================= CERTIFICATIONS ================= */

.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    width: 100%;
    margin-top: 20px;
}

.cert-card {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    background: var(--bg-alt);
    border: 1px solid var(--glass-border);
    height: 100%;
    /* Ensure equal heights in grid */
}

.cert-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--primary);
    background: var(--glass-bg);
}

.cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.1), transparent 60%);
    opacity: 0;
    transition: 0.4s;
}

.cert-card:hover::before {
    opacity: 1;
}

.cert-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
    gap: 10px;
}

.platform-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.1rem;
}

.platform-logo i {
    font-size: 1.8rem;
    color: var(--primary);
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

/* Light Mode: Platform logo inherits text-main or uses variable */

.cert-logo-img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 50%;
}

.cert-badge {
    font-size: 0.75rem;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(var(--primary-glow-rgb, 56, 189, 248), 0.05);
    /* Use a subtle primary-based bg */
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

/* Specific Badge Colors */
.cert-badge.design {
    color: #ff7675;
    border-color: rgba(255, 118, 117, 0.3);
    background: rgba(255, 118, 117, 0.1);
}

.cert-badge.marketing {
    color: #fdcb6e;
    border-color: rgba(253, 203, 110, 0.3);
    background: rgba(253, 203, 110, 0.1);
}

.cert-badge.programming {
    color: #74b9ff;
    border-color: rgba(116, 185, 255, 0.3);
    background: rgba(116, 185, 255, 0.1);
}

.cert-badge.ai {
    color: #a29bfe;
    border-color: rgba(162, 155, 254, 0.3);
    background: rgba(162, 155, 254, 0.1);
}

.cert-badge.game {
    color: #55efc4;
    border-color: rgba(85, 239, 196, 0.3);
    background: rgba(85, 239, 196, 0.1);
}

.cert-body {
    z-index: 1;
}

.cert-body h3 {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 10px;
    transition: 0.3s;
    text-align: start;
}

.cert-card:hover .cert-body h3 {
    color: var(--primary);
}

.issue-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cert-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    z-index: 1;
}

.cert-link {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    width: fit-content;
}

.cert-link:hover {
    color: var(--primary);
    gap: 12px;
    text-shadow: 0 0 10px var(--primary-glow);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 50px;
    }

    .hero-content h1 {
        font-size: 3.5rem;
    }

    .hero-btns {
        justify-content: center;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .about-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 30px;
    }

    .about-stats {
        justify-content: center;
    }

    .skills-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .contact-form-wrapper {
        padding: 30px;
    }

    /* Projects Mobile Optimization */
    .projects-grid {
        grid-template-columns: 1fr !important;
        gap: 25px;
        padding: 0 5px;
    }

    .project-img-container {
        height: 220px !important;
        /* Slightly taller for mobile clarity */
    }

    .project-content {
        padding: 25px !important;
    }

    .project-content h3 {
        font-size: 1.6rem !important;
    }

    .project-overlay {
        display: none !important;
        /* Hide overlay on mobile to keep images crisp */
    }

    .project-img-container {
        height: auto !important;
        aspect-ratio: 16 / 10;
        border-bottom: 3px solid var(--primary);
        /* Stylish accent instead of overlay */
    }

    .project-img-container img {
        image-rendering: -webkit-optimize-contrast;
        /* Enhance clarity on some mobile browsers */
        object-position: top center;
        /* Focus on the top part of the site screenshot */
    }
}

/* ================= PROJECTS SECTION ================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.project-new-card {
    border-radius: 24px;
    padding: 0;
    /* Remove padding for full-width image */
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    overflow: hidden;
    /* Ensure image and overlay follow card radius */
}

.project-img-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-bottom: 1px solid var(--glass-border);
}

.project-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

.project-new-card:hover .project-img-container img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.project-new-card:hover .project-overlay {
    opacity: 1;
}

.view-live-overlay-btn {
    padding: 10px 25px;
    background: var(--primary);
    color: var(--bg-color);
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    transform: translateY(20px);
    transition: transform 0.4s ease, background 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.project-new-card:hover .view-live-overlay-btn {
    transform: translateY(0);
}

.view-live-overlay-btn:hover {
    background: var(--text-main);
    color: var(--bg-color);
}

.project-content {
    padding: 30px;
    /* Re-apply padding here */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-new-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: var(--primary);
}

.project-content h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--primary);
    background: linear-gradient(to right, var(--primary), var(--text-main));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-content p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 25px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.project-tags span {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 50px;
    background: rgba(56, 189, 248, 0.08);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.15);
    transition: var(--transition-normal);
}

.project-new-card:hover .project-tags span {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--primary);
}

.project-footer {
    margin-top: auto;
}

.live-demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    color: #0f172a;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition-normal);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.live-demo-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px var(--primary-glow);
    color: #0f172a;
}

/* ================= ACCESSIBILITY: REDUCED MOTION ================= */
@media (prefers-reduced-motion: reduce) {

    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}