/* Enhanced Base Styles */
:root {
    --primary-color: #2A2A72;
    --secondary-color: #009FFD;
    --accent-color: #FF4B8D;
    --text-color: #333;
    --background-color: #FFFFFF;
    --card-background: #FFFFFF;
    --transition: all 0.3s ease;
    --primary-color-rgb: 42, 42, 114;
    --secondary-color-rgb: 0, 159, 253;
    --accent-color-rgb: 255, 75, 141;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--background-color);
    transition: var(--transition);
    scroll-behavior: smooth;
    overflow-x: hidden;
}

section {
    padding: 80px 0;
    position: relative;
}

.section-title {
    position: relative;
    display: inline-block;
    font-weight: 700;
    margin-bottom: 40px;
    font-size: 2.2rem;
    color: var(--primary-color);
    text-align: center;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* Improved Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    transition: var(--transition);
}

.navbar-brand {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition);
}

.nav-link {
    color: var(--primary-color) !important;
    font-weight: 500;
    margin: 0 5px;
    padding: 8px 16px !important;
    border-radius: 30px;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--secondary-color) !important;
    background-color: rgba(var(--secondary-color-rgb), 0.1);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 30px;
}

.mode-toggle {
    border-radius: 50% !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.3);
    transition: var(--transition);
}

.mode-toggle:hover {
    transform: rotate(30deg);
    box-shadow: 0 6px 20px rgba(var(--primary-color-rgb), 0.4);
}

/* Enhanced Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 150px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: scale(1.5);
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    transform: scale(1.5);
}

.profile-img {
    width: 220px;
    height: 260px;
    border-radius: 30px;
    border: 5px solid white;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    background: #9da7b1;
    transition: var(--transition);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.profile-img:hover {
    transform: scale(1.05);
    border-radius: 50%;
}

/* Improved Typewriter Effect */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    margin: 0 auto;
    display: inline-block;
    position: relative;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    font-weight: 300;
}

.typewriter::after {
    content: '|';
    position: absolute;
    right: -8px;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.resume-btn {
    padding: 12px 32px;
    border-radius: 50px;
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
}

.resume-btn:hover {
    background: transparent;
    color: white;
    border-color: white;
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2);
}

.social-icons {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
}

.social-icons a {
    margin: 10px 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transition: var(--transition);
}

.social-icons a:hover {
    background: white;
    color: var(--primary-color);
    transform: scale(1.2);
}

/* Enhanced Education Timeline */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 50px auto 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    width: 45%;
    margin-bottom: 60px;
    padding: 30px;
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.timeline-item:nth-child(odd) {
    float: left;
    clear: right;
}

.timeline-item:nth-child(even) {
    float: right;
    clear: left;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 30px;
    width: 20px;
    height: 20px;
    background: var(--secondary-color);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(var(--secondary-color-rgb), 0.2);
    z-index: 1;
}

.timeline-item:nth-child(odd)::before {
    right: -60px;
}

.timeline-item:nth-child(even)::before {
    left: -60px;
}

.timeline-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.timeline-item:hover::before {
    background: var(--primary-color);
    box-shadow: 0 0 0 6px rgba(var(--primary-color-rgb), 0.3), 0 0 25px var(--primary-color);
}

.timeline-item h4 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 10px;
}

.timeline-item p {
    margin-bottom: 5px;
}

.timeline-item small {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 15px;
    background: rgba(var(--secondary-color-rgb), 0.1);
    border-radius: 20px;
    color: var(--secondary-color);
    font-weight: 500;
}

.timeline-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: var(--secondary-color);
    transition: var(--transition);
}

.timeline-item:hover .timeline-icon {
    transform: scale(1.2) rotate(360deg);
    color: var(--primary-color);
}

/* Enhanced Project Cards */
.pro {
    background-color: #f8f9fa;
    position: relative;
    padding: 100px 0;
}

.project-card {
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
    position: relative;
    z-index: 1;
}

.project-card::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(315deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.5s ease-out;
    border-radius: var(--border-radius);
}

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

.project-card:hover {
    transform: translateY(-20px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.project-card:hover .card-title, .project-card:hover ul {
    color: white;
}

.project-card:hover .tech-badge {
    background: white;
    color: var(--primary-color);
}

.card-body {
    padding: 30px;
    position: relative;
    z-index: 2;
    transition: var(--transition);
}

.card-title {
    font-weight: 600;
    font-size: 1.4rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    color: var(--primary-color);
    transition: var(--transition);
}

.card-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 2px;
    transition: var(--transition);
}

.project-card:hover .card-title::after {
    width: 80px;
    background: white;
}

.tech-badge {
    background: var(--primary-color);
    color: white;
    margin: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}

/* Enhanced Skills Section */
.skill-item {
    text-align: center;
    padding: 25px 15px;
    transition: var(--transition);
    border-radius: var(--border-radius);
    background: var(--card-background);
    box-shadow: var(--box-shadow);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.skill-item::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: var(--transition);
}

.skill-item:hover::before {
    opacity: 1;
}

.skill-item:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.skill-item:hover p {
    color: white;
}

.skill-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 15px;
    transition: var(--transition);
    filter: grayscale(30%);
}

.skill-item:hover .skill-icon {
    transform: scale(1.2);
    filter: grayscale(0%);
}

.skill-item p {
    font-weight: 500;
    margin-top: 10px;
    transition: var(--transition);
}

/* Contact Section */
.contact {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 70%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.contact .section-title {
    color: white;
}

.contact .section-title::after {
    background: white;
}

.contact-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px;
}

.contact-icon {
    font-size: 1.8rem;
    color: white;
    transition: var(--transition);
    margin: 0 20px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.contact-icon:hover {
    color: var(--primary-color);
    background: white;
    transform: translateY(-10px) scale(1.1);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
    background: var(--primary-color);
    color: white;
    text-align: center;
    padding: 20px 0;
}

footer p {
    margin-bottom: 0;
}

/* Dark Mode Styles */
body.dark-mode {
    --primary-color: #BB86FC;
    --secondary-color: #03DAC6;
    --accent-color: #FF7597;
    --text-color: #EEEEEE;
    --background-color: #121212;
    --card-background: #1E1E1E;
}

body.dark-mode .navbar {
    background: rgba(30, 30, 30, 0.95);
}

body.dark-mode .navbar-brand {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.dark-mode .nav-link {
    color: var(--text-color) !important;
}

body.dark-mode .nav-link:hover, body.dark-mode .nav-link.active {
    color: var(--secondary-color) !important;
    background-color: rgba(var(--secondary-color-rgb), 0.1);
}

body.dark-mode .mode-toggle {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

body.dark-mode .hero-section {
    background: linear-gradient(135deg, #121212 0%, #2D2D2D 100%);
}

body.dark-mode .pro {
    background-color: #1A1A1A;
}

body.dark-mode .timeline::before {
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

body.dark-mode .project-card::before {
    background: linear-gradient(315deg, var(--primary-color), var(--secondary-color));
}

/* Responsive Design */
@media (max-width: 992px) {
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        width: 100%;
        float: none !important;
        clear: both !important;
        margin-left: 60px;
    }
    
    .timeline-item:nth-child(odd)::before,
    .timeline-item:nth-child(even)::before {
        left: -40px;
        right: auto;
    }
}

@media (max-width: 768px) {
    section {
        padding: 60px 0;
    }
    
    .hero-section {
        padding: 120px 0 60px;
    }
    
    .profile-img {
        width: 180px;
        height: 220px;
    }
    
    .timeline-icon {
        display: none;
    }
    
    .mode-toggle {
        margin-left: auto;
    }
    
    .skill-item {
        padding: 20px;
    }
    
    .skill-icon {
        width: 60px;
        height: 60px;
    }
    
    .contact-icon {
        margin: 0 10px;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 1.8rem;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .typewriter {
        font-size: 1.2rem;
    }
    
    .profile-img {
        width: 150px;
        height: 180px;
    }
    
    .timeline-item {
        padding: 20px;
    }
    
    .card-body {
        padding: 20px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary-color), var(--secondary-color));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

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

.scroll-top:hover {
    transform: translateY(-5px);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 1s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }
.delay-4 { animation-delay: 0.8s; }

/* Dark Mode Fixes for Projects and Contact Sections */

/* Fix for project cards in dark mode */
body.dark-mode .project-card {
    background: var(--card-background);
}

body.dark-mode .project-card::before {
    background: linear-gradient(315deg, rgba(187, 134, 252, 0.8), rgba(3, 218, 198, 0.8));
}

/* Fix for project cards text and badges */
body.dark-mode .card-title {
    color: var(--text-color);
}

body.dark-mode .project-card .card-body {
    color: var(--text-color);
}

body.dark-mode .tech-badge {
    background: rgba(187, 134, 252, 0.3);
    color: var(--text-color);
}

body.dark-mode .project-link {
    color: var(--secondary-color);
}

/* Fix for contact section in dark mode */
body.dark-mode .contact {
    background: linear-gradient(135deg, #2D2D2D 0%, #121212 100%);
}

body.dark-mode .contact::before {
    background: rgba(187, 134, 252, 0.1);
}

/* Fix for skill items in dark mode */
body.dark-mode .skill-item {
    background: var(--card-background);
}

body.dark-mode .skill-item::before {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

/* Fix for project links */
.project-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

body.dark-mode .project-card:hover .project-link {
    color: white;
}

/* Adjustments made for viewing on smartphone screen */

@media (max-width: 768px) {
    /* Fix hero section for mobile */
    .hero-section {
        padding: 120px 0 80px;
        text-align: center;
    }
    
    /* Fix social icons position on mobile */
    .social-icons {
        position: static;
        flex-direction: row;
        justify-content: center;
        margin-top: 30px;
    }
    
    .social-icons a {
        margin: 0 10px;
    }
    
    /* Fix resume button for mobile */
    .resume-btn {
        display: inline-block;
        margin-bottom: 30px;
        z-index: 100;
        position: relative;
    }
    
    /* Alternative resume button position fix */
    .alt-resume-btn {
        bottom: 20px;
        right: 20px;
    }
    
    /* Timeline adjustments for mobile */
    .timeline-item {
        padding: 20px 15px;
        margin-bottom: 40px;
        margin-left: 40px;
    }
    
    .timeline-item:nth-child(odd)::before,
    .timeline-item:nth-child(even)::before {
        left: -30px;
    }
    
    /* Project card adjustments */
    .project-card {
        margin-bottom: 30px;
    }
}

@media (max-width: 576px) {
    /* Smaller screens adjustments */
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .typewriter {
        font-size: 1.1rem;
    }
    
    /* Better profile image sizing */
    .profile-img {
        width: 140px;
        height: 170px;
        margin-top: 20px;
    }
    
    /* Improved contact icons spacing */
    .contact-icons {
        flex-wrap: wrap;
    }
    
    .contact-icon {
        margin: 10px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    /* Skills grid adjustment */
    .skill-item {
        margin-bottom: 15px;
    }
    
    /* Timeline further adjustments */
    .timeline::before {
        left: 15px;
    }
    
    .timeline-item {
        margin-left: 30px;
    }
    
    .timeline-item:nth-child(odd)::before,
    .timeline-item:nth-child(even)::before {
        left: -25px;
    }
}

/* Fix navbar collapse on mobile */
@media (max-width: 992px) {
    .navbar-collapse {
        background: var(--background-color);
        padding: 15px;
        border-radius: 10px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        margin-top: 10px;
    }
    
    body.dark-mode .navbar-collapse {
        background: var(--card-background);
    }
    
    .navbar-nav {
        align-items: center;
    }
}

/* Fix for About section stats on mobile */
@media (max-width: 576px) {
    .about-stat {
        padding: 10px;
    }
    
    .about-stat h3 {
        font-size: 1.5rem;
    }
}

/* ===== Extracted from inline <style> (NO changes) ===== */

/* Resume button fix styles */
.resume-btn {
    position: relative !important;
    z-index: 9999 !important; 
    pointer-events: auto !important;
    cursor: pointer !important;
    display: inline-block !important;
    padding: 12px 24px !important;
    transition: all 0.3s ease !important;
    overflow: visible !important;
    text-decoration: none !important;
}

.hero-section {
    position: relative;
    overflow: visible !important;
}

.hero-section .container,
.hero-section .row,
.hero-section .col-lg-6 {
    position: relative;
    overflow: visible !important;
    z-index: 1;
    pointer-events: auto !important;
}

.resume-btn:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

/* Alternative resume download */
.alt-resume-btn {
    position: fixed;
    bottom: 80px; 
    right: 20px;
    background: #ff4d5a;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: block;
    text-decoration: none;
}

.alt-resume-btn:hover {
    background: #e43b49;
    color: white;
    text-decoration: none;
}