:root {
    --primary-color: #3d5afe; /* Your existing primary color */
    --secondary-color: #282a36; /* Dark background */
    --tertiary-color: #303245; /* Lighter dark for borders/cards */
    --text-color: #f3f3f3; /* Main light text color */
    --muted-text-color: rgba(255, 255, 255, 0.7); /* Lighter muted text color */
    --light-dark-bg: #1e1e2d; /* Slightly lighter than main background for sections */
    --dark-bg: #181824;
}

body {
    background: var(--dark-bg);
    color: var(--text-color); /* Ensure body text is light */
    font-family: 'Poppins', sans-serif; /* Poppins for general text */
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif; /* Montserrat for headings */
    color: var(--text-color); /* Ensure headings are light */
    font-weight: 600;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: #5b7bff; /* Lighter shade of primary on hover */
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 8px;
    background: var(--tertiary-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

/* Navbar */
.navbar {
    background: rgba(24, 24, 36, 0.8) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(61, 90, 254, 0.2);
    transition: all 0.3s ease-in-out;
}

.navbar.scrolled {
    background: rgba(24, 24, 36, 0.95) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body.light-theme .navbar {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(37, 99, 235, 0.2);
}

body.light-theme .navbar.scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
}

.navbar-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.7rem;
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    color: var(--text-color) !important; /* Ensure nav links are light */
    font-weight: 500;
    margin-left: 15px;
    position: relative;
    padding-bottom: 5px; /* Space for underline effect */
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease-in-out;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 100%;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.1);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Hero Section */
.hero-section {
    min-height: 90vh; /* Make it nearly full height */
    background: linear-gradient(135deg, rgba(40, 42, 54, 0.8) 0%, rgba(26, 26, 46, 0.7) 50%, rgba(61, 90, 254, 0.3) 100%);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    position: relative;
    padding: 100px 0;
    backdrop-filter: blur(2px);
}

@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.profile-picture {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(61, 90, 254, 0.5); /* Glowing effect */
    transition: transform 0.3s ease;
}

.profile-picture:hover {
    transform: scale(1.05);
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-top: 20px;
}

.hero-section p.lead {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.8); /* Ensure lead text is light */
}

.custom-btn {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(61, 90, 254, 0.4);
    color: var(--text-color); /* Ensure button text is light */
}

.custom-btn:hover {
    background-color: #5b7bff;
    border-color: #5b7bff;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(61, 90, 254, 0.6);
}

.custom-btn-outline {
    border-color: var(--primary-color);
    color: var(--primary-color);
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.custom-btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--text-color);
    transform: translateY(-3px);
}


.social-links a {
    color: var(--text-color); /* Ensure social links are light */
    transition: transform 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}

/* Sections General */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 40px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-color); /* Ensure subtitles are light */
    margin-bottom: 30px;
}

.bg-light-dark {
    background-color: var(--light-dark-bg);
}

/* About Section */
.profile-picture-lg {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(61, 90, 254, 0.5);
}

/* Explicitly target paragraphs in about-overview and set color */
.about-overview p,
.about-overview p.lead {
    color: var(--muted-text-color); /* This targets the p elements directly */
}


/* Skills Section */
.skills-section {
    background-color: var(--dark-bg);
}

.skill-item {
    background-color: var(--secondary-color);
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid var(--tertiary-color);
    height: 100%; /* Ensure equal height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.skill-item i {
    color: var(--primary-color); /* Default skill icon color */
}
/* Specific icon colors if needed */
.skill-item .fa-js-square { color: #f0db4f; } /* Yellow for JS */
.skill-item .fa-php { color: #8892bf; } /* Blue for PHP */
.skill-item .fa-python { color: #3776ab; } /* Dark blue for Python */
.skill-item .fa-database { color: #b7b7b7; } /* Grey for database */
.skill-item .fa-gem { color: #cc342d; } /* Red for Ruby */

.skill-item h6 {
    color: var(--text-color); /* Ensure skill names are light */
}

/* Projects Section */
.project-card {
    background-color: var(--secondary-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--tertiary-color);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.project-card img {
    height: 200px;
    object-fit: cover;
    width: 100%;
    border-bottom: 1px solid var(--tertiary-color);
}

.project-card .card-title {
    color: var(--primary-color);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

/* Ensure project descriptions are readable */
.project-card .card-text {
    color: var(--muted-text-color);
}

.project-tags .badge {
    background-color: var(--tertiary-color);
    color: var(--text-color); /* Ensure badge text is light */
    font-size: 0.8rem;
    padding: 0.5em 0.8em;
    border-radius: 5px;
    margin-bottom: 5px;
}

/* Contact Form - REMOVED */


/* Footer */
.footer {
    background: var(--secondary-color) !important;
    border-top: 1px solid var(--tertiary-color);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    color: var(--text-color); /* Ensure footer text is light */
}

.footer-social a {
    color: var(--text-color); /* Ensure footer social links are light */
    transition: color 0.3s ease, transform 0.3s ease;
}

.footer-social a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Page Title for inner pages */
.page-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 15px;
}

.page-title::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Timeline for About Page */
.timeline {
    position: relative;
    padding: 20px 0;
    margin-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: -20px; /* Adjust to align with dots */
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--tertiary-color);
}

.timeline-item {
    margin-bottom: 30px;
    position: relative;
    padding-left: 40px; /* Space for dot and line */
}

.timeline-dot {
    position: absolute;
    left: -28px; /* Adjust to align with the line */
    top: 0;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 4px solid var(--dark-bg); /* Match body background */
    z-index: 1;
}

.timeline-content {
    background-color: var(--secondary-color);
    border-radius: 10px;
    border: 1px solid var(--tertiary-color);
    transition: transform 0.2s ease;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* Ensure text within timeline content is readable */
.timeline-content p {
    color: var(--muted-text-color);
}

.timeline-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.timeline-content ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.7); /* Ensure list items are light/muted */
}

.timeline-content ul li::before {
    content: "\f058"; /* Font Awesome check-circle */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Hobbies section */
.hobby-item {
    background-color: var(--secondary-color);
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid var(--tertiary-color);
    height: 100%; /* Ensure equal height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.hobby-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.hobby-item i {
    color: var(--primary-color);
}

.hobby-item h6 {
    color: var(--text-color); /* Ensure hobby names are light */
}


/* Media Queries for responsiveness */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    .hero-section p.lead {
        font-size: 1.2rem;
    }
    .profile-picture {
        width: 150px;
        height: 150px;
    }
    .section-title {
        font-size: 2rem;
    }
    .page-title {
        font-size: 2.5rem;
    }
    .timeline::before {
        left: 15px; /* Adjust for smaller screens */
    }
    .timeline-item {
        padding-left: 50px;
    }
    .timeline-dot {
        left: 7px;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    .hero-section p.lead {
        font-size: 1rem;
    }
    .profile-picture {
        width: 120px;
        height: 120px;
    }
    .custom-btn, .custom-btn-lg {
        width: 100%;
        padding: 10px 20px;
        font-size: 1rem;
    }
    .social-links a {
        margin: 0 10px;
    }
    .section-title {
        font-size: 1.8rem;
    }
    .page-title {
        font-size: 2rem;
    }
    .timeline::before {
        left: 10px;
    }
    .timeline-item {
        padding-left: 40px;
    }
    .timeline-dot {
        left: 2px;
        width: 16px;
        height: 16px;
    }
}

/* Matrix Rain Effect */
.matrix-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: transparent;
}

.matrix-canvas {
    width: 100%;
    height: 100%;
    opacity: 0.1;
}

/* Enhanced project cards for better visibility over matrix */
.project-card {
    background: rgba(40, 42, 54, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(61, 90, 254, 0.2);
    transition: all 0.3s ease;
}

.project-card:hover {
    background: rgba(40, 42, 54, 0.98) !important;
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(61, 90, 254, 0.3);
}

/* 3D Floating Cards Effect */
.project-card {
    perspective: 1000px;
    transform-style: preserve-3d;
    position: relative;
    overflow: visible !important;
}

.project-card:hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(5deg) scale(1.02) !important;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(61, 90, 254, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 10px;
}

.project-card:hover::before {
    opacity: 1;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Glitch Text Effect */
.glitch {
    position: relative;
    color: var(--primary-color);
    font-size: inherit;
    font-weight: inherit;
    animation: glitch-skew 1s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-anim-1 0.5s infinite linear alternate-reverse;
    color: #ff0040;
    z-index: -1;
}

.glitch::after {
    animation: glitch-anim-2 1s infinite linear alternate-reverse;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch-anim-1 {
    0% { clip: rect(24px, 9999px, 44px, 0); transform: skew(0.85deg); }
    5% { clip: rect(12px, 9999px, 59px, 0); transform: skew(0.40deg); }
    10% { clip: rect(63px, 9999px, 33px, 0); transform: skew(0.30deg); }
    15% { clip: rect(16px, 9999px, 99px, 0); transform: skew(0.45deg); }
    20% { clip: rect(75px, 9999px, 15px, 0); transform: skew(0.12deg); }
    25% { clip: rect(46px, 9999px, 82px, 0); transform: skew(0.62deg); }
    30% { clip: rect(68px, 9999px, 28px, 0); transform: skew(0.24deg); }
    35% { clip: rect(20px, 9999px, 67px, 0); transform: skew(0.81deg); }
    40% { clip: rect(37px, 9999px, 93px, 0); transform: skew(0.38deg); }
    45% { clip: rect(89px, 9999px, 42px, 0); transform: skew(0.96deg); }
    50% { clip: rect(55px, 9999px, 18px, 0); transform: skew(0.07deg); }
    55% { clip: rect(31px, 9999px, 76px, 0); transform: skew(0.83deg); }
    60% { clip: rect(78px, 9999px, 51px, 0); transform: skew(0.22deg); }
    65% { clip: rect(14px, 9999px, 85px, 0); transform: skew(0.57deg); }
    70% { clip: rect(47px, 9999px, 39px, 0); transform: skew(0.41deg); }
    75% { clip: rect(72px, 9999px, 13px, 0); transform: skew(0.05deg); }
    80% { clip: rect(25px, 9999px, 61px, 0); transform: skew(0.74deg); }
    85% { clip: rect(58px, 9999px, 29px, 0); transform: skew(0.18deg); }
    90% { clip: rect(41px, 9999px, 87px, 0); transform: skew(0.69deg); }
    95% { clip: rect(83px, 9999px, 56px, 0); transform: skew(0.32deg); }
    100% { clip: rect(19px, 9999px, 94px, 0); transform: skew(0.77deg); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(65px, 9999px, 100px, 0); transform: skew(0.02deg); }
    5% { clip: rect(52px, 9999px, 74px, 0); transform: skew(0.05deg); }
    10% { clip: rect(79px, 9999px, 23px, 0); transform: skew(0.03deg); }
    15% { clip: rect(37px, 9999px, 88px, 0); transform: skew(0.01deg); }
    20% { clip: rect(17px, 9999px, 56px, 0); transform: skew(0.07deg); }
    25% { clip: rect(91px, 9999px, 35px, 0); transform: skew(0.04deg); }
    30% { clip: rect(43px, 9999px, 97px, 0); transform: skew(0.06deg); }
    35% { clip: rect(86px, 9999px, 11px, 0); transform: skew(0.02deg); }
    40% { clip: rect(61px, 9999px, 49px, 0); transform: skew(0.08deg); }
    45% { clip: rect(28px, 9999px, 73px, 0); transform: skew(0.05deg); }
    50% { clip: rect(92px, 9999px, 26px, 0); transform: skew(0.01deg); }
    55% { clip: rect(44px, 9999px, 81px, 0); transform: skew(0.04deg); }
    60% { clip: rect(69px, 9999px, 37px, 0); transform: skew(0.06deg); }
    65% { clip: rect(21px, 9999px, 95px, 0); transform: skew(0.03deg); }
    70% { clip: rect(84px, 9999px, 16px, 0); transform: skew(0.07deg); }
    75% { clip: rect(56px, 9999px, 72px, 0); transform: skew(0.02deg); }
    80% { clip: rect(33px, 9999px, 90px, 0); transform: skew(0.04deg); }
    85% { clip: rect(77px, 9999px, 45px, 0); transform: skew(0.01deg); }
    90% { clip: rect(38px, 9999px, 67px, 0); transform: skew(0.05deg); }
    95% { clip: rect(86px, 9999px, 24px, 0); transform: skew(0.03deg); }
    100% { clip: rect(50px, 9999px, 81px, 0); transform: skew(0.06deg); }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    10% { transform: skew(2deg); }
    20% { transform: skew(0deg); }
    30% { transform: skew(1deg); }
    40% { transform: skew(0deg); }
    50% { transform: skew(-1deg); }
    60% { transform: skew(0deg); }
    70% { transform: skew(-2deg); }
    80% { transform: skew(0deg); }
    90% { transform: skew(1deg); }
    100% { transform: skew(0deg); }
}

/* Typing Animation */
.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--primary-color);
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.1em;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-color); }
}

.dynamic-text {
    color: var(--primary-color);
    font-weight: 700;
    min-height: 1.4em;
    display: inline-block;
}

/* Particle System */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

.particle {
    position: absolute;
    background: var(--primary-color);
    border-radius: 50%;
    pointer-events: none;
    animation: particleExplosion 1s ease-out forwards;
}

@keyframes particleExplosion {
    0% {
        opacity: 1;
        transform: scale(1) translate(0, 0);
    }
    100% {
        opacity: 0;
        transform: scale(0) translate(var(--random-x), var(--random-y));
    }
}

/* Loading Animation */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-logo {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 30px;
    animation: pulse 2s ease-in-out infinite;
}

.loading-progress {
    width: 500px;
    height: 6px;
    background: var(--tertiary-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #5b7bff);
    border-radius: 3px;
    animation: loadingBar 3s ease-out forwards;
}

/* Secret page loading styles */
#secretLoading .loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#secretLoading .loading-bar {
    width: 500px;
    height: 6px;
    background: var(--tertiary-color);
    border-radius: 3px;
    overflow: hidden;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#secretLoading .loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), #5b7bff);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.loading-percentage {
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 10px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Light theme loading percentage fix */
body.light-theme .loading-percentage {
    color: var(--text-color) !important;
    text-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
}

/* Secret page specific styles */
#secretContent {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1000;
    overflow: hidden;
}

#secretContent .container-fluid {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

#secretContent .row {
    width: 100%;
    margin: 0;
    justify-content: center;
}

/* Make sure Matrix background stays behind content */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.matrix-bg canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes loadingBar {
    0% { width: 0%; }
    100% { width: 100%; }
}

.loading-text {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-top: 10px;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 100px;
    right: 30px;
    z-index: 1000;
    background: var(--secondary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(61, 90, 254, 0.4);
}

.theme-toggle i {
    color: var(--primary-color);
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(180deg);
}

/* Responsive theme toggle */
@media (max-width: 768px) {
    .theme-toggle {
        top: 80px;
        right: 15px;
        padding: 10px 12px;
    }
    
    .theme-toggle i {
        font-size: 1.1rem;
    }
}

/* Light Theme */
body.light-theme {
    --primary-color: #2563eb;
    --secondary-color: #ffffff;
    --tertiary-color: #e2e8f0;
    --text-color: #1e293b;
    --muted-text-color: rgba(30, 41, 59, 0.8);
    --light-dark-bg: #f8fafc;
    --dark-bg: #ffffff;
}

body.light-theme .matrix-canvas {
    opacity: 0.02;
}

body.light-theme .hero-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 50%, rgba(37, 99, 235, 0.1) 100%);
    color: var(--text-color);
}

body.light-theme .hero-section h1,
body.light-theme .hero-section p {
    color: var(--text-color) !important;
}

body.light-theme .project-card {
    background: rgba(255, 255, 255, 0.98) !important;
    color: var(--text-color);
    border: 1px solid var(--tertiary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.light-theme .project-card .card-text {
    color: var(--muted-text-color) !important;
}

body.light-theme .navbar {
    background: var(--secondary-color) !important;
    border-bottom: 1px solid var(--tertiary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.light-theme .footer {
    background: var(--secondary-color) !important;
    color: var(--text-color);
    border-top: 1px solid var(--tertiary-color);
}

body.light-theme .skill-item,
body.light-theme .hobby-item,
body.light-theme .timeline-content {
    background: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--tertiary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body.light-theme .section-title,
body.light-theme .page-title {
    color: var(--primary-color);
}

body.light-theme .section-subtitle {
    color: var(--text-color);
}

body.light-theme .about-overview p,
body.light-theme .about-overview p.lead {
    color: var(--muted-text-color) !important;
}

body.light-theme .timeline-content p,
body.light-theme .timeline-content ul li {
    color: var(--muted-text-color) !important;
}

/* Additional about page text fixes for light theme */
body.light-theme .text-white-50 {
    color: var(--muted-text-color) !important;
}

body.light-theme .text-white {
    color: var(--text-color) !important;
}

body.light-theme .lead {
    color: var(--muted-text-color) !important;
}

body.light-theme main p {
    color: var(--muted-text-color) !important;
}

body.light-theme .timeline-content h5,
body.light-theme .hobby-item h6,
body.light-theme .skill-item h6 {
    color: var(--text-color) !important;
}

body.light-theme .timeline-content ul li {
    color: var(--muted-text-color) !important;
}
body.light-theme .about-overview .lead {
    color: var(--muted-text-color) !important;
}

body.light-theme main p {
    color: var(--muted-text-color) !important;
}

body.light-theme .timeline-content .card-title {
    color: var(--primary-color) !important;
}

body.light-theme .hobby-item h6,
body.light-theme .skill-item h6 {
    color: var(--text-color) !important;
}

body.light-theme .badge {
    background-color: var(--tertiary-color) !important;
    color: var(--text-color) !important;
}

body.light-theme .glitch {
    color: var(--primary-color);
}

/* Fix dark cards and their content in light theme */
body.light-theme .card.bg-dark {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #e0e0e0 !important;
    color: var(--text-color) !important;
}

body.light-theme .timeline-content.card.bg-dark {
    background-color: rgba(255, 255, 255, 0.95) !important;
    color: var(--text-color) !important;
}

body.light-theme .timeline-content.card.bg-dark h5 {
    color: var(--primary-color) !important;
}

body.light-theme .timeline-content.card.bg-dark p,
body.light-theme .timeline-content.card.bg-dark ul li {
    color: var(--muted-text-color) !important;
}

body.light-theme .hobby-item.card.bg-dark,
body.light-theme .skill-item.card.bg-dark {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #e0e0e0 !important;
    color: var(--text-color) !important;
}

body.light-theme .hobby-item.card.bg-dark h6,
body.light-theme .skill-item.card.bg-dark h6 {
    color: var(--text-color) !important;
}

body.light-theme .loading-screen {
    background: var(--dark-bg);
}

body.light-theme .theme-toggle {
    background: var(--secondary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Theme transition */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

* {
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 9998;
    background: transparent;
}

.scroll-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #5b7bff, #00ffff);
    width: 0%;
    transition: width 0.1s ease;
}

/* Floating Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(61, 90, 254, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(61, 90, 254, 0.6);
}

/* Animated Icons */
.animated-icon {
    transition: transform 0.3s ease;
}

.animated-icon:hover {
    transform: scale(1.2) rotate(10deg);
}

/* Pulse Effect for Important Elements */
.pulse-effect {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(61, 90, 254, 0.5);
    }
    50% { 
        box-shadow: 0 0 25px rgba(61, 90, 254, 0.8), 0 0 35px rgba(61, 90, 254, 0.6);
    }
}

/* Gradient Text Effect */
.gradient-text {
    background: linear-gradient(45deg, var(--primary-color), #5b7bff, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Card Hover Glow Effect */
.glow-on-hover {
    position: relative;
    overflow: hidden;
}

.glow-on-hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(61, 90, 254, 0.3), transparent);
    transition: left 0.5s ease;
}

.glow-on-hover:hover::after {
    left: 100%;
}

/* Mouse Trail Effect */
.mouse-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, var(--primary-color), transparent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .scroll-progress {
        height: 3px;
    }
}

/* Easter Egg Secret Page */
.secret-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 0;
    color: white;
    font-family: 'Courier New', monospace;
}

.secret-page.active {
    display: flex;
}

/* Undertale-style dialog box */
.dialog-box {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 600px;
    min-height: 150px;
    background: #000;
    border: 4px solid #fff;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    line-height: 1.5;
    color: #fff;
    opacity: 0;
    animation: fadeInDialog 0.5s ease forwards;
}

@keyframes fadeInDialog {
    to { opacity: 1; }
}

.dialog-text {
    margin: 0;
    font-size: 1.1rem;
    animation: typewriter 2s steps(30, end);
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #fff;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

/* Matrix style final text */
.matrix-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary-color);
    opacity: 0;
    animation: matrixReveal 2s ease forwards;
    text-shadow: 0 0 20px var(--primary-color);
    font-family: 'Montserrat', sans-serif;
}

@keyframes matrixReveal {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.5); 
    }
    50% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1.2); 
    }
    100% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    }
}

/* Secret button styles */
.secret-btn {
    background: transparent;
    border: 2px solid rgba(61, 90, 254, 0.3);
    color: rgba(61, 90, 254, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.secret-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(61, 90, 254, 0.1);
    transform: scale(1.1);
}

/* Undertale Dialog Styles */
.undertale-dialog {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.dialog-border {
    background: #000;
    border: 4px solid #fff;
    padding: 20px;
    font-family: 'Courier New', monospace;
}

.speaker-name {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.speaker-name:contains("noydra") {
    color: #ff0000 !important;
    text-shadow: 0 0 10px #ff0000;
    animation: redGlow 1s ease-in-out infinite alternate;
}

.dialog-text {
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 15px;
    min-height: 60px;
}

.dialog-continue {
    color: #ccc;
    font-size: 0.9rem;
    text-align: right;
    animation: blink 1.5s infinite;
}

/* Special styling for "KAÇ" message */
.dialog-text:contains("KAÇ") {
    color: #ff0000 !important;
    font-size: 2rem !important;
    font-weight: bold !important;
    text-align: center !important;
    text-shadow: 0 0 20px #ff0000;
    animation: urgentPulse 0.5s ease-in-out infinite alternate;
}

@keyframes redGlow {
    0% { text-shadow: 0 0 10px #ff0000; }
    100% { text-shadow: 0 0 20px #ff0000, 0 0 30px #ff0000; }
}

@keyframes urgentPulse {
    0% { 
        transform: scale(1); 
        text-shadow: 0 0 20px #ff0000;
    }
    100% { 
        transform: scale(1.1); 
        text-shadow: 0 0 30px #ff0000, 0 0 40px #ff0000;
    }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Continuous RUN warning styles */
.run-warning {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    pointer-events: none;
}

.run-text {
    color: #ff0000;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000;
    animation: urgentPulse 1s ease-in-out infinite alternate;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* Screen shake animation */
@keyframes screenShake {
    0% { transform: translate(0); }
    10% { transform: translate(-2px, -1px); }
    20% { transform: translate(-1px, 2px); }
    30% { transform: translate(1px, 2px); }
    40% { transform: translate(2px, -1px); }
    50% { transform: translate(-1px, 2px); }
    60% { transform: translate(-1px, 1px); }
    70% { transform: translate(2px, 1px); }
    80% { transform: translate(-2px, -1px); }
    90% { transform: translate(1px, 2px); }
    100% { transform: translate(1px, -2px); }
}

/* Enhanced urgent pulse for increasing intensity */
@keyframes urgentPulse {
    0% { 
        transform: scale(1); 
        text-shadow: 0 0 20px #ff0000;
        filter: brightness(1);
    }
    100% { 
        transform: scale(1.1); 
        text-shadow: 0 0 30px #ff0000, 0 0 40px #ff0000, 0 0 50px #ff0000;
        filter: brightness(1.5);
    }
}

/* Responsive dialog */
@media (max-width: 768px) {
    .dialog-box {
        width: 90%;
        bottom: 30px;
        padding: 15px;
        font-size: 1rem;
    }
    
    .dialog-text {
        font-size: 0.9rem;
    }
    
    .matrix-text {
        font-size: 2.5rem;
    }
}