/* Body background */
body {
    background: linear-gradient(135deg, #232946 60%, #1a1a2e 100%);
    color: #eaeaea;
}

/* Section backgrounds */
section,
#contact {
    background: linear-gradient(135deg, #232946 70%, #2d3250 100%);
    color: #eaeaea;
}

section:nth-child(even) {
    background: linear-gradient(135deg, #232946 80%, #393e6d 100%);
}

section:nth-child(odd) {
    background: linear-gradient(135deg, #232946 80%, #2d3250 100%);
}

/* h2 styles */
h2,
#contact h2 {
    background: linear-gradient(90deg, #a0a7d1, #6c63ff, #232946);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2::after,
#contact h2::after {
    background: linear-gradient(90deg, #6c63ff, #a0a7d1, #232946);
}

/* Interests */
#interests li {
    background: linear-gradient(90deg, #393e6d 60%, #6c63ff 100%);
    color: #eaeaea;
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.15);
}

/* Skills */
.skill-item {
    background: linear-gradient(135deg, #232946, #393e6d 80%, #6c63ff 100%);
    color: #a0a7d1;
    border: 3px solid #393e6d;
}

.skill-progress-bar {
    background: linear-gradient(90deg, #6c63ff, #a0a7d1);
}

/* Certificates */
#certificates {
    background: linear-gradient(135deg, #232946 90%, #393e6d 100%);
    color: #eaeaea;
}

.certificate-item {
    background: linear-gradient(135deg, #232946, #393e6d 80%, #6c63ff 100%);
    color: #a0a7d1;
    border: 3px solid #393e6d;
}

.certificate-frame {
    border: 6px solid #6c63ff;
    background: linear-gradient(135deg, #232946, #393e6d);
}

.certificate-frame::before {
    background: linear-gradient(90deg, #a0a7d1, #6c63ff, #232946);
}

/* Contact Section */
#contact p {
    color: #a0a7d1;
}

.contact-links a {
    background: linear-gradient(90deg, #393e6d 40%, #6c63ff 100%);
    border: 3px solid #6c63ff;
    color: #eaeaea;
}

.contact-links a:hover {
    background: linear-gradient(90deg, #6c63ff 60%, #a0a7d1 100%);
    color: #232946;
    border-color: #a0a7d1;
    box-shadow: 0 8px 24px rgba(108, 99, 255, 0.18);
}

/* Navigation Bar */
#top-nav {
    background: linear-gradient(90deg, #232946 60%, #393e6d 100%);
}

#top-nav .nav-link.active,
#top-nav .nav-link:hover {
    background: rgba(108, 99, 255, 0.18);
    color: #a0a7d1;
}

/* Language Button */
.lang-btn {
    background: linear-gradient(90deg, #393e6d 60%, #6c63ff 100%);
    color: #eaeaea;
    border: 2px solid #a0a7d1;
}

.lang-btn:hover {
    background: linear-gradient(90deg, #6c63ff 60%, #a0a7d1 100%);
    color: #232946;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #232946, #393e6d, #6c63ff);
    color: #a0a7d1;
}

/* Scrollbar */
::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #393e6d, #6c63ff, #a0a7d1);
}

/* LANGUAGE TOGGLE */
.language-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(124, 67, 189, 0.9);
    color: #e0e0e0;
    border: 2px solid #b39ddb;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.lang-btn:hover {
    background: rgba(179, 157, 219, 0.9);
    color: #111111;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.lang-flag {
    font-size: 1.2rem;
}

.lang-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* RTL SUPPORT FOR ARABIC */
html[dir="rtl"] body {
    text-align: right;
}

/* Remove these lines to prevent unwanted flipping/alignment: */
/*
html[dir="rtl"] .container {
    direction: rtl;
}
html[dir="rtl"] .contact-links {
    direction: rtl;
}
html[dir="rtl"] .certificates-grid {
    direction: rtl;
}
html[dir="rtl"] .skills-grid {
    direction: rtl;
}
html[dir="rtl"] #interests ul {
    direction: rtl;
}
*/

/* ARABIC FONT SUPPORT */
html[dir="rtl"] body,
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] p,
html[dir="rtl"] a,
html[dir="rtl"] li,
html[dir="rtl"] span,
html[dir="rtl"] .tagline {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
}

/* RESPONSIVE LANGUAGE TOGGLE */
@media (max-width: 768px) {
    .language-toggle {
        top: 15px;
        right: 15px;
    }

    .lang-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}


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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background: linear-gradient(145deg, #111111, #2d133d);
    overflow-x: hidden;
    cursor: auto;
    padding-top: 60px;
}

/* Make .container responsive */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2vw;
}

header {
    color: #e0e0e0;
    text-align: center;
    padding: 8vw 0;
    overflow: hidden;
    min-height: 60vh;
    display: flex;
    align-items: center;
    background: none;
}

header::before {
    background: linear-gradient(45deg, rgba(17, 17, 17, 0.8), rgba(45, 19, 61, 0.7));
}

#bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1;
    min-width: 100%;
    min-height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    background: #232946;
}

/* Add overlay for better text readability */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.6), rgba(102, 126, 234, 0.3));
    z-index: 0;
}

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

#profile-pic {
    width: 15vw;
    min-width: 120px;
    max-width: 180px;
    height: 15vw;
    min-height: 120px;
    max-height: 180px;
    border-radius: 50%;
    border: 6px solid white;
    margin-bottom: 20px;
    object-fit: cover;
    transition: all 0.5s ease;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    position: relative;
}

#profile-pic::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    background: linear-gradient(45deg, #667eea, #764ba2, #667eea);
    z-index: -1;
    animation: rotate-border 3s linear infinite;
}

@keyframes rotate-border {
    0% {
        transform: rotate(0deg);
    }

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

#profile-pic:hover {
    transform: scale(1.15);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

header h1 {
    font-size: 4rem;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #e0e0e0, #b39ddb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 1px 1px 8px #2d133d;
    animation: glow 2s ease-in-out infinite alternate;
}


@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }

    to {
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 40px rgba(102, 126, 234, 0.2);
    }
}

.tagline {
    font-size: 1.4rem;
    opacity: 0.95;
    min-height: 2em;
    border-right: 2px solid #b39ddb;
    padding-right: 5px;
    color: #b39ddb;
    animation: blink-cursor 1s infinite;
}

@keyframes blink-cursor {

    0%,
    50% {
        border-color: white;
    }

    51%,
    100% {
        border-color: transparent;
    }
}

/* Section Styles - REDUCED MOVEMENT */
section {
    padding: 8vw 0;
    opacity: 0;
    transform: translateY(80px);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    /* REMOVED transform property that was causing excessive movement */
}

section.animate-in {
    opacity: 1;
    transform: translateY(0);
}

section:nth-child(even) {
    background: linear-gradient(145deg, #222 80%, #2d133d 100%);
}

section:nth-child(odd) {
    background: linear-gradient(145deg, #181818 80%, #2d133d 100%);
}

/* h2 styles */
h2 {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    background: linear-gradient(45deg, #b39ddb, #7c43bd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: text-glow 3s ease-in-out infinite alternate;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 5px;
    background: linear-gradient(45deg, #b39ddb, #7c43bd);
    border-radius: 3px;
    animation: expand-line 2s ease-in-out infinite alternate;
}

@keyframes expand-line {
    from {
        width: 80px;
    }

    to {
        width: 120px;
    }
}

p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

/* Enhanced Interests Section */
#interests ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2vw;
    max-width: 90vw;
    padding: 0 2vw;
}

#interests li {
    background: linear-gradient(90deg, #393e6d 60%, #6c63ff 100%);
    color: #eaeaea;
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.15);
    padding: 20px 30px;
    border-radius: 35px;
    font-weight: bold;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

#interests li::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#interests li:hover::before {
    left: 100%;
}

#interests li:hover {
    transform: translateY(-12px) scale(1.08) rotateX(10deg);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.5);
}

#interests h2 {
    animation: text-glow 3s ease-in-out infinite alternate;
    /* Reduced glow just for this heading */
}

@keyframes text-glow {
    from {
        text-shadow: 0 0 4px rgba(179, 157, 219, 0.10);
    }

    to {
        text-shadow: 0 0 8px rgba(124, 67, 189, 0.18), 0 0 12px rgba(102, 126, 234, 0.08);
    }
}

.wave-animation {
    animation: wave 4s ease-in-out infinite;
}

@keyframes wave {

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

    25% {
        transform: translateY(-8px) rotate(1deg);
    }

    50% {
        transform: translateY(0px) rotate(0deg);
    }

    75% {
        transform: translateY(-4px) rotate(-1deg);
    }
}

@keyframes bounce {

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

    40% {
        transform: translateY(-20px);
    }

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

/* Enhanced Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 2vw;
    max-width: 100vw;
    padding: 0 2vw;
    margin-top: 30px;
}

.skill-card {
    background: linear-gradient(135deg, #232946 70%, #393e6d 100%);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(108, 99, 255, 0.10);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 18px 24px 18px;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    cursor: pointer;
    border: 2px solid #393e6d;
}

.skill-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 16px 32px rgba(108, 99, 255, 0.18);
    border-color: #6c63ff;
}

.skill-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin-bottom: 18px;
    filter: drop-shadow(0 2px 8px #23294688);
    transition: filter 0.3s;
}

.skill-card:hover .skill-icon {
    filter: drop-shadow(0 4px 16px #6c63ff88);
}

/* Skill images hover effect */
.skill-item:hover .skill-img {
    filter: drop-shadow(0 4px 16px #6c63ff88) brightness(1.15) contrast(1.1);
    transform: scale(1.08);
    transition: filter 0.3s, transform 0.3s;
}

.skill-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #a0a7d1;
    letter-spacing: 0.5px;
    text-align: center;
    margin-top: 4px;
}

/* Certificates Section */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 4vw;
    max-width: 100vw;
    padding: 0 2vw;
}

.certificate-item {
    background: linear-gradient(135deg, #232946, #393e6d 80%, #6c63ff 100%);
    color: #a0a7d1;
    box-shadow: 0 8px 16px rgba(45, 19, 61, 0.18);
    border: 3px solid #393e6d;
    padding: 40px 30px;
    text-align: center;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    transform: translateY(50px);
    opacity: 0;
}

.certificate-item.certificate-animate {
    transform: translateY(0);
    opacity: 1;
}

.certificate-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.6s;
}

.certificate-item:hover::before {
    left: 100%;
}

.certificate-item:hover {
    transform: translateY(-15px) scale(1.05);
    border-color: #667eea;
    box-shadow: 0 25px 50px rgba(102, 126, 234, 0.2);
}

/* CERTIFICATE FRAME STYLES - REDUCED SIZE */
.certificate-frame {
    width: 12vw;
    min-width: 110px;
    max-width: 160px;
    height: 8vw;
    min-height: 70px;
    max-height: 110px;
    margin: 0 auto 20px;
    position: relative;
    border: 6px solid #6c63ff;
    /* REDUCED FROM 8px */
    border-radius: 12px;
    /* REDUCED FROM 15px */
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(124, 67, 189, 0.25);
    /* REDUCED SHADOW */
    transition: all 0.4s ease;
    background: linear-gradient(135deg, #222, #2d133d);
}

.certificate-frame::before {
    content: '';
    position: absolute;
    top: -3px;
    /* REDUCED FROM -4px */
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #b39ddb, #38bdf8, #10b981, #ffd700);
    border-radius: 12px;
    z-index: -1;
    animation: rotate-frame 4s linear infinite;
}

@keyframes rotate-frame {
    0% {
        transform: rotate(0deg);
    }

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

.certificate-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* THIS ENSURES IMAGES FIT PROPERLY */
    object-position: center;
    /* CENTER THE IMAGE */
    transition: all 0.4s ease;
    border-radius: 6px;
    /* REDUCED FROM 8px */
}

.certificate-item:hover .certificate-frame {
    transform: scale(1.08) rotateY(3deg);
    /* REDUCED FROM 1.1 AND 5deg */
    box-shadow: 0 12px 28px rgba(124, 67, 189, 0.4);
    /* REDUCED SHADOW */
}

.certificate-item:hover .certificate-image {
    transform: scale(1.03);
    /* REDUCED FROM 1.05 */
    filter: brightness(1.08) contrast(1.05);
    /* REDUCED ENHANCEMENT */
}

.certificate-item h3 {
    font-size: 1.4rem;
    /* REDUCED FROM 1.5rem */
    color: #667eea;
    margin-bottom: 12px;
    /* REDUCED FROM 15px */
    font-weight: bold;
}

.certificate-item p {
    color: #ffffff;
    margin-bottom: 20px;
    /* REDUCED FROM 25px */
    font-size: 1rem;
    /* REDUCED FROM 1.1rem */
}

/* ENHANCED VIEW CERTIFICATE BUTTON */
.view-certificate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #2f375e, #393e6d 80%, #6c63ff 100%);
    color: #eaeaea;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.22);
}

.view-certificate:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.22), 0 0 8px #38bdf888;
    background: linear-gradient(90deg, #38bdf8 0%, #6c63ff 60%, #b39ddb 100%);
    border-color: #38bdf8;
}

.view-certificate:hover::before {
    width: 220%;
    height: 220%;
    background: rgba(56, 189, 248, 0.08);
    /* subtle blue glow */
}

/* FIXED RESPONSIVE DESIGN FOR CERTIFICATES */
@media (max-width: 768px) {
    .certificates-grid {
        grid-template-columns: 1fr;
        gap: 6vw;
        padding: 0 4vw;
    }

    .certificate-item {
        padding: 30px 20px;
    }

    /* MOBILE CERTIFICATE FRAME - EVEN SMALLER */
    .certificate-frame {
        width: 32vw;
        height: 20vw;
        min-width: 90px;
        min-height: 60px;
    }

    .certificate-item h3 {
        font-size: 1.2rem;
    }

    .certificate-item p {
        font-size: 0.9rem;
    }

    .view-certificate {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Enhanced Contact Section */
#contact {
    background: linear-gradient(135deg, #181818 60%, #2d133d 80%, #38bdf8 100%);
    color: #eaeaea;
    position: relative;
    overflow: hidden;
    min-height: 75vh;
    /* Increased height for more space */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Move content to the bottom */
    align-items: center;
    padding: 60px 0 60px 0;
    /* Balanced top and bottom padding */
}

#contact .container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Keep content at the bottom */
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    position: relative;
}

#contact h2 {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
    margin-bottom: 0;
    width: 100%;
    text-align: center;
    z-index: 2;
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(45deg, #b39ddb, #7c43bd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#contact h2::after {
    content: '';
    display: block;
    margin: 0 auto;
    margin-top: 10px;
    width: 100px;
    height: 5px;
    background: linear-gradient(45deg, #b39ddb, #7c43bd);
    border-radius: 3px;
    animation: expand-line 2s ease-in-out infinite alternate;
}

@keyframes expand-line {
    from {
        width: 80px;
    }

    to {
        width: 120px;
    }
}

/* Add top padding to container so content doesn't overlap the title */
#contact .container {
    padding-top: 100px;
}

#contact p {
    color: #a0a7d1;
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.contact-links a {
    color: #eaeaea;
    text-decoration: none;
    padding: 18px 38px;
    /* Bigger buttons */
    font-size: 1.18rem;
    /* Larger text */
    border: 3px solid #6c63ff;
    border-radius: 50px;
    transition:
        background 0.3s,
        color 0.3s,
        box-shadow 0.3s,
        transform 0.2s;
    background: rgba(124, 67, 189, 0.18);
    backdrop-filter: blur(10px);
    font-weight: 600;
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 0 2px 12px rgba(124, 67, 189, 0.12);
}

.contact-links a:hover {
    background: linear-gradient(90deg, #6c63ff 60%, #a0a7d1 100%);
    color: #232946;
    border-color: #a0a7d1;
    box-shadow: 0 8px 24px rgba(124, 67, 189, 0.25);
}

.contact-links .contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.contact-links .contact-icon i {
    font-size: 1.5rem;
    color: #6c63ff;
    transition: color 0.3s, transform 0.3s;
}

.contact-links a:hover .contact-icon i {
    color: #a0a7d1;
    transform: scale(1.15);
}

/* Optional: Add a subtle glow effect on hover */
.contact-links a:hover::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%);
    border-radius: 50px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 40%, transparent 80%);
    z-index: 0;
    pointer-events: none;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .contact-links a {
        width: auto;
        padding: 18px 38px;
        font-size: 1.18rem;
    }

    footer {
        padding: 3vw 0;
        margin-top: 0;
    }

    header h1,
    h2 {
        font-size: 3.5rem;
    }

    p,
    .tagline {
        font-size: 1.2rem;
    }

    #top-nav {
        flex-direction: row;
        height: 60px;
        padding: 0 2vw;
    }

    #top-nav ul {
        gap: 2vw;
        flex-wrap: nowrap;
    }

    #top-nav .nav-link {
        font-size: 1.05rem;
        padding: 8px 18px;
    }

    #top-nav .language-toggle.nav-lang {
        margin-left: 2vw;
        margin-top: 0;
    }

    .certificates-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 4vw;
        padding: 0 2vw;
    }

    .certificate-item {
        padding: 40px 30px;
    }

    .certificate-frame {
        width: 12vw;
        min-width: 110px;
        max-width: 160px;
        height: 8vw;
        min-height: 70px;
        max-height: 110px;
    }

    .certificate-item h3 {
        font-size: 1.4rem;
    }

    .certificate-item p {
        font-size: 1rem;
    }

    .view-certificate {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .language-toggle {
        top: 20px;
        right: 20px;
    }

    .lang-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

footer {
    background: linear-gradient(135deg, #232946, #393e6d);
    color: #a0a7d1;
    text-align: center;
    padding: 3vw 0;
    position: relative;
    transition: transform 0.1s ease-out;
}

footer::before {
    background: linear-gradient(90deg, transparent, #7c43bd, transparent);
}

/* Top Navigation Bar */
#top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    background: linear-gradient(90deg, #181818 60%, #232043 100%);
    box-shadow: 0 2px 12px rgba(45, 19, 61, 0.18);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2vw;
    height: 60px;
}

#top-nav ul {
    display: flex;
    gap: 2vw;
    list-style: none;
    margin: 0;
    padding: 0;
}

#top-nav li {
    display: flex;
    align-items: center;
}

#top-nav .nav-link {
    color: #e0e0e0;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.05rem;
    padding: 8px 18px;
    border-radius: 20px;
    transition: background 0.3s, color 0.3s;
    position: relative;
}

#top-nav .nav-link.active,
#top-nav .nav-link:hover {
    background: rgba(124, 67, 189, 0.18);
    color: #b39ddb;
}

#top-nav .language-toggle.nav-lang {
    position: static;
    margin-left: 2vw;
}

/* Prevent top navigation bar from flipping in RTL */
html[dir="rtl"] #top-nav,
html[dir="rtl"] #top-nav ul {
    direction: ltr !important;
}

@media (max-width: 768px) {
    #top-nav {
        flex-direction: row;
        height: 60px;
        padding: 0 2vw;
        align-items: center;
        overflow-x: auto;
        /* Enable horizontal scrolling */
        white-space: nowrap;
        /* Prevent wrapping */
    }

    #top-nav ul {
        flex-direction: row;
        gap: 2vw;
        flex-wrap: nowrap;
        align-items: center;
        width: auto;
        white-space: nowrap;
        /* Prevent wrapping */
    }

    #top-nav li {
        align-items: center;
        white-space: nowrap;
    }

    #top-nav .nav-link {
        font-size: 1rem;
        padding: 6px 10px;
        white-space: nowrap;
    }

    #top-nav .language-toggle.nav-lang {
        margin-left: 2vw;
        margin-top: 0;
        position: static;
        flex-shrink: 0;
        /* Prevent shrinking */
    }
}

/* Push body down so content isn't hidden under nav */
body {
    padding-top: 60px;
}

/* Enhanced Animations */
@keyframes rainbow {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .contact-links a {
        padding: 8px 16px;
        /* Smaller padding for mobile */
        font-size: 0.88rem;
        /* Smaller font for mobile */
    }

    footer {
        padding: 8vw 0;
        margin-top: 12vw;
    }

    header h1,
    h2 {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
    }

    p,
    .tagline {
        font-size: clamp(0.95rem, 3vw, 1.1rem);
    }
}

/* Enhanced Scrollbar */
::-webkit-scrollbar {
    width: 14px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(45deg, #181818, #2d133d);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #38bdf8, #b39ddb, #10b981);
    border-radius: 7px;
    border: 2px solid #181818;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #b39ddb, #38bdf8, #10b981);
}

/* Skills Section with Font Awesome icons */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 2vw;
    margin-top: 30px;
}

.skill-item {
    background: linear-gradient(135deg, #232946 70%, #393e6d 100%);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(108, 99, 255, 0.10);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 18px 24px 18px;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    cursor: pointer;
    border: 2px solid #393e6d;
}

.skill-item:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 16px 32px rgba(108, 99, 255, 0.18);
    border-color: #6c63ff;
}

.skill-item:hover .skill-icon i {
    filter: drop-shadow(0 4px 16px #6c63ff88) brightness(1.15) contrast(1.1);
    transform: scale(1.08);
    transition: filter 0.3s, transform 0.3s;
}

.skill-icon i {
    font-size: 3rem;

    margin-bottom: 18px;
    transition: color 0.3s;
}


.skill-icon .fa-python {
    color: #3776AB;
}

.skill-icon .fa-js {
    color: #F7DF1E;
}

.skill-icon .fa-react {
    color: #61DAFB;
}

.skill-icon .fa-node-js {
    color: #339933;
}

.skill-icon .fa-html5 {
    color: #E34F26;
}

.skill-icon .fa-css3-alt {
    color: #1572B6;
}

.skill-icon .fa-java {
    color: #007396;
}

.skill-icon .fa-php {
    color: #777BB4;
}

.skill-icon .fa-git-alt {
    color: #F05032;
}

.skill-icon .fa-database {
    color: #4DB33D;
}

@media (max-width: 768px) {
    #bg-video {
        width: 100vw;
        height: 60vh;
        min-height: 60vh;
        max-height: 60vh;
        object-fit: cover;
    }

    header {
        min-height: 60vh;
        height: 60vh;
    }
}