/* ==========================================================================
   Portfolio Stylesheet - v4.3 (FIXED ZigZag Timeline)
   Default Theme: Light (White)
   Font: Inter
   ==========================================================================
*/

/* 1. CSS Variables (Theme) */
:root {
    /* Light Mode (Default) */
    --bg-color: #ffffff;
    --bg-subtle: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #212529;
    --heading-color: #000000;
    --border-color: #dee2e6;
    --primary-color: #0d6efd;
    /* Bootstrap Blue */
    --font-family: 'Inter', sans-serif;
}

body.dark-mode {
    /* Dark Mode (Toggled) */
    --bg-color: #0a192f;
    --bg-subtle: #112240;
    --card-bg: #112240;
    --text-color: #8892b0;
    --heading-color: #ccd6f6;
    --border-color: #233554;
    --primary-color: #64FFDA;
    /* Tech Green */
}

/* 2. Global Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    padding-top: 80px;
    /* Increased header height */
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.page-section {
    padding: 80px 0;
}

/* Headings and Links */
h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-weight: 700;
    color: var(--heading-color);
}

h2.display-5 {
    font-weight: 300;
    margin-bottom: 3rem !important;
}

p.lead {
    color: var(--text-color);
    font-size: 1.1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--primary-color);
    opacity: 0.8;
}

.bg-subtle {
    background-color: var(--bg-subtle) !important;
}

/* 3. Navbar & Theme Toggle (Taller Header) */
.navbar {
    background-color: rgba(255, 255, 255, 0.85);
    /* Default light */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
    padding-top: 1rem;
    /* Taller header */
    padding-bottom: 1rem;
    /* Taller header */
}

.navbar .nav-link {
    color: var(--text-color);
    transition: color 0.3s ease;
    font-weight: 600;
    font-size: 1.1rem;
    /* Slightly larger font */
    margin-left: 5px;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--primary-color) !important;
}

.navbar-brand {
    color: var(--primary-color) !important;
    font-size: 1.5rem;
}

/* Dark Mode Navbar */
body.dark-mode .navbar {
    background-color: rgba(10, 25, 47, 0.85);
    /* Translucent Navy */
}

body.dark-mode .navbar-toggler-icon {
    filter: invert(1);
}

/* Theme Toggle Switch */
.theme-toggle-label {
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.5rem;
    /* Larger icon */
    margin-left: 10px;
}

body.dark-mode .theme-toggle-label {
    color: var(--primary-color);
}


/* 4. Hero Section (New Particle.js Animation) */
.hero {
    height: 100vh;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* Important for animation */
}

/* This is the container for the particles.js canvas */
#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: var(--bg-color);
    transition: background-color 0.3s ease;
}

.hero .container {
    position: relative;
    /* To keep content above animation */
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--heading-color);
}

.hero .lead {
    color: var(--heading-color);
}

#typing-effect {
    color: var(--primary-color);
    font-weight: 700;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 4px;
}

.btn-primary {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-color);
    opacity: 0.8;
}

.btn-outline-dark {
    border-color: var(--heading-color);
    color: var(--heading-color);
}

.btn-outline-dark:hover {
    background-color: var(--heading-color);
    color: var(--bg-color);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Dark mode button overrides */
body.dark-mode .btn-primary {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

body.dark-mode .btn-primary:hover {
    background-color: rgba(100, 255, 218, 0.1);
    color: var(--primary-color);
}

body.dark-mode .btn-outline-dark {
    border-color: var(--text-color);
    color: var(--text-color);
}

body.dark-mode .btn-outline-dark:hover {
    background-color: var(--text-color);
    color: var(--dark-bg);
}


/* 5. About & Skills */
.about-img {
    width: 300px;
    height: 350px;
    /* Slightly taller for rectangle */
    object-fit: cover;
    border-radius: 15px;
    /* Rounded rectangle */
    border: 5px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(13, 110, 253, 0.2);
}

body.dark-mode .about-img {
    box-shadow: 0 0 30px rgba(100, 255, 218, 0.2);
}

.skill-overview-card,
.skill-detail-card,
.service-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 25px;
    color: var(--heading-color);
    transition: all 0.3s ease;
    height: 100%;
}

.skill-overview-card:hover,
.skill-detail-card:hover,
.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(13, 110, 253, 0.1);
}

body.dark-mode .skill-overview-card:hover,
body.dark-mode .skill-detail-card:hover,
body.dark-mode .service-card:hover {
    box-shadow: 0 5px 15px rgba(100, 255, 218, 0.1);
}

.skill-overview-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.skill-detail-card h5 {
    color: var(--heading-color);
}

.skill-detail-card p.why-use {
    font-style: italic;
    color: var(--text-color);
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
    font-size: 0.9rem;
}


/* 6. Experience Timeline (FIXED ZIGZAG) */
.timeline-wrapper {
    max-width: 1000px;
    /* Wider wrapper */
    margin: 0 auto;
}

.timeline {
    position: relative;
    padding: 40px 0;
    list-style: none;
}

/* This clearfix stops the float from overlapping the next section */
.timeline::after {
    content: "";
    display: table;
    clear: both;
}

/* The center line (Desktop) */
.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background: var(--border-color);
    transform: translateX(-50%);
}

.timeline-item {
    margin-bottom: 40px;
    position: relative;
    width: 50%;
    clear: both;
    /* Fix for broken floats */
}

/* Right side items */
.timeline-item:nth-child(even) {
    padding-left: 40px;
    /* Space from center line */
    left: 50%;
    text-align: left;
}

/* Left side items */
.timeline-item:nth-child(odd) {
    padding-right: 40px;
    /* Space from center line */
    float: left;
    /* Make it stick to the left */
    text-align: right;
}

.timeline-icon {
    position: absolute;
    top: 0;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.2rem;
}

body.dark-mode .timeline-icon {
    color: var(--dark-bg);
}

/* Icon positioning */
.timeline-item:nth-child(odd) .timeline-icon {
    right: -20px;
    /* (40px icon width / 2) */
    transform: translateX(50%);
}

.timeline-item:nth-child(even) .timeline-icon {
    left: -20px;
    /* (40px icon width / 2) */
    transform: translateX(-50%);
}

.timeline-body {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.timeline-body:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.dark-mode .timeline-body:hover {
    box-shadow: 0 10px 30px rgba(100, 255, 218, 0.1);
}

.timeline-body h5 {
    color: var(--primary-color);
}

.timeline-body h6 {
    color: var(--heading-color);
    font-weight: 700;
}

.timeline-body ul {
    padding-left: 20px;
    margin-top: 10px;
}

.timeline-date {
    display: block;
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 5px;
}


/* 7. GSC Section */
.service-card {
    text-align: center;
}

.service-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}


/* 8. Projects (Clickable Card) */
.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

/* Card body (Buttons are removed) */
.project-card .card-body {
    color: var(--text-color);
}

.project-card .card-title {
    color: var(--heading-color);
    cursor: pointer;
}

.project-card .card-img-top {
    cursor: pointer;
}

.project-card .card-title:hover {
    color: var(--primary-color);
}

/* Modal Theme */
.modal-content {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    color: var(--text-color);
}

.btn-close {
    filter: none;
}

body.dark-mode .modal-content {
    background-color: var(--card-bg) !important;
}

body.dark-mode .btn-close {
    filter: invert(1);
}

/* 9. Contact & Footer (Dynamic) */
#contact {
    background-color: var(--bg-subtle);
}

.contact-info-box {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.contact-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.contact-info-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-right: 20px;
    width: 40px;
}

.footer {
    padding: 50px 0 20px 0;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.footer h5 {
    color: var(--heading-color);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.footer p,
.footer-links li a {
    color: var(--text-color);
    font-size: 0.9rem;
}

.footer-links {
    list-style: none;
    padding-left: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links li a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.footer-social-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.footer-social-links a:hover {
    color: var(--primary-color);
}

.footer-copyright {
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 30px;
    font-size: 0.9rem;
}

/* 10. Responsive */

@media (max-width: 991.98px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .about-img {
        margin-bottom: 30px;
    }

    .footer {
        text-align: center;
    }

    .footer .col-md-4 {
        margin-bottom: 30px;
    }
}

@media (max-width: 767.98px) {
    body {
        padding-top: 70px;
    }

    .hero {
        height: 90vh;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .page-section {
        padding: 60px 0;
    }

    .about-img {
        width: 250px;
        height: 300px;
    }

    /* Adjust for smaller screens */

    /* Mobile Timeline (Single Column) */
    .timeline:before {
        left: 18px;
        /* Mobile position */
        transform: translateX(0);
    }

    .timeline-item {
        width: 100%;
        padding-left: 55px;
        /* Mobile padding */
        padding-right: 0;
        left: 0 !important;
        /* Override desktop 'left: 50%' */
        text-align: left !important;
        /* Override desktop 'text-align: right' */
        float: none;
        /* Clear desktop float */
    }

    .timeline-icon {
        left: 0;
        /* Mobile position */
        transform: translateX(0);
    }

    /* Hide the right-side icon rule */
    .timeline-item:nth-child(odd) .timeline-icon {
        right: auto;
        transform: translateX(0);
    }

    .timeline-item:nth-child(even) .timeline-icon {
        left: 0;
        /* Mobile position */
        transform: translateX(0);
    }
}