/* ====== CSS Variables ====== */
:root {
    /* Light Mode Variables */
    --primary-color: #4a90e2;
    --primary-dark: #2a6ec6;
    --secondary-color: #f0f4f8;
    --text-color: #333;
    --text-light: #666;
    --text-muted: #aaaaaa;
    --bg-color: #f9f9f9;
    --white: #fff;
    --navbar-bg: #ffffff;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --progress-bg: #e9ecef;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

/* Dark Mode Variables */
[data-theme="dark"],
[data-bs-theme="dark"] {
    --bg-color: #121212;
    --text-color: #f0f0f0;
    --text-muted: #aaaaaa;
    --primary-color: #6ea8fe;
    --secondary-color: #9a6ffd;
    --card-bg: #1e1e1e;
    --border-color: #444;
    --navbar-bg: #1a1a1a;
    --progress-bg: #333;
    --white: #1e1e1e;
    /* Bootstrap-specific variables */
    --bs-body-bg: #121212;
    --bs-body-color: #f0f0f0;
    --bs-tertiary-bg: #1e1e1e;
    --bs-secondary-bg: #1a1a1a;
    --bs-border-color: #444;
    --bs-light: #1a1a1a;
}

/* ====== Base Styles ====== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: var(--transition);
    line-height: 1.6;
    overflow-x: hidden;
}

main {
    background-color: var(--bg-color);
    min-height: calc(100vh - 120px);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

.section-title {
    position: relative;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
}

    .section-title::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 80px;
        height: 3px;
        background: var(--primary-color);
    }

/* ====== Component Styles ====== */

/* Navbar */
.navbar {
    padding: 1rem 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    background-color: var(--navbar-bg) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.navbar-nav {
    gap: 1.5rem;
}

.nav-link {
    position: relative;
    padding: 0.5rem 0 !important;
    font-weight: 500;
    color: var(--text-color) !important;
    transition: var(--transition);
}

    .nav-link:hover {
        color: var(--primary-color) !important;
    }

    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--primary-color);
        transition: width 0.3s ease;
    }

    .nav-link:hover::after,
    .nav-link.active::after {
        width: 100%;
    }

    .nav-link.active {
        color: var(--primary-color) !important;
        font-weight: 600;
    }

    .nav-link:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.5);
    }

/* Sections */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 6rem 0;
    background-color: var(--bg-color);
    position: relative;
}

.about-section,
.contact-section {
    padding: 6rem 0;
    background-color: var(--secondary-color);
}

.portfolio-section {
    padding: 6rem 0;
    background-color: var(--bg-color);
}

/* Dark mode overrides for all sections */
[data-theme="dark"] .about-section,
[data-bs-theme="dark"] .about-section,
[data-theme="dark"] .contact-section,
[data-bs-theme="dark"] .contact-section {
    background-color: var(--bg-color) !important;
}

/* Alternative more precise control */
[data-theme="dark"] .hero-section h1,
[data-bs-theme="dark"] .hero-section h1 {
    color: #f8f9fa; /* Brighter white */
}

[data-theme="dark"] .hero-section .text-primary,
[data-bs-theme="dark"] .hero-section .text-primary {
    color: #86b7fe !important; /* Brighter version of primary color */
}


/* Contact Section Specific Styles */
.contact-info {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    border-radius: var(--border-radius);
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

    .contact-item i {
        width: 24px;
        text-align: center;
        color: var(--primary-color);
        margin-right: 1rem;
    }

.social-links {
    margin-top: 2rem;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--white);
    margin-right: 1rem;
    transition: var(--transition);
}

    .social-icon:hover {
        background-color: var(--primary-dark);
        transform: translateY(-3px);
    }

/* Cards */
.card,
.portfolio-card,
.contact-info {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.portfolio-card {
    border: none;
    overflow: hidden;
    height: 100%;
}

    .portfolio-card:hover {
        transform: translateY(-10px);
        box-shadow: var(--shadow-lg);
    }

.card-img-top {
    object-fit: cover;
    height: 200px;
    width: 100%;
}

/* Forms */
.form-control {
    background-color: var(--white);
    border-color: var(--border-color);
    color: var(--text-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

    .form-control:focus {
        background-color: var(--white);
        color: var(--text-color);
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.25rem rgba(74, 144, 226, 0.25);
    }

/* Dark mode form overrides */
[data-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-control {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

    [data-theme="dark"] .form-control:focus,
    [data-bs-theme="dark"] .form-control:focus {
        background-color: var(--card-bg) !important;
    }

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

    .btn-primary:hover {
        background-color: var(--primary-dark);
        border-color: var(--primary-dark);
        transform: translateY(-2px);
    }

.btn-outline-secondary {
    color: var(--text-color);
    border-color: var(--border-color);
}

    .btn-outline-secondary:hover {
        background-color: var(--border-color);
    }

.btn-success {
    transition: all 0.3s ease;
}

    .btn-success:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

/* Progress Bars */
.progress {
    background-color: var(--progress-bg);
    height: 8px;
    border-radius: 4px;
}

.progress-bar {
    background-color: var(--primary-color);
}


/*sample if okay */

/* Timeline List with Icon Bullets */
.timeline-list {
    list-style: none;
    padding-left: 0;
}

    .timeline-list li {
        position: relative;
        padding-left: 0;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: flex-start;
    }

        .timeline-list li i.fas.fa-circle {
            font-size: 0.5rem;
            color: var(--primary-color);
            margin-top: 0.4rem;
            margin-right: 0.5rem;
            flex-shrink: 0;
        }

/* Dark Mode Adjustments */
[data-theme="dark"] .timeline-list li i.fas.fa-circle,
[data-bs-theme="dark"] .timeline-list li i.fas.fa-circle {
    color: var(--primary-color);
    opacity: 0.8;
}


/* ===== Timeline Styles ===== */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
    padding-left: 2rem;
    border-left: 2px solid var(--primary-color);
    margin-left: 1.5rem;
}

    .timeline-item::before {
        content: '';
        position: absolute;
        left: -9px;
        top: 0;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: var(--primary-color);
        border: 3px solid var(--card-bg);
    }

    .timeline-item i.fas {
        position: absolute;
        left: -2.5rem;
        top: 0.2rem;
        font-size: 1.2rem;
        color: var(--primary-color);
        background: var(--white);
        border-radius: 50%;
        padding: 0.3rem;
        z-index: 2;
    }

    .timeline-item .timeline-content {
        position: relative;
        z-index: 1;
    }

/* Timeline List Bullets */
.timeline-list {
    list-style: none;
    padding-left: 1.5rem;
}

    .timeline-list li {
        position: relative;
        margin-bottom: 0.5rem;
    }

        .timeline-list li i.fas.fa-circle-notch {
            position: absolute;
            left: -1.5rem;
            color: var(--text-color);
            font-size: 0.65rem;
            top: 0.35em;
        }

/* Dark Mode Adjustments */
[data-theme="dark"] .timeline-item i.fas,
[data-bs-theme="dark"] .timeline-item i.fas {
    background: var(--card-bg);
}

[data-theme="dark"] .timeline-list li i.fas.fa-circle-notch,
[data-bs-theme="dark"] .timeline-list li i.fas.fa-circle-notch {
    color: var(--primary-color);/*--text-muted*/
    opacity: 0.9;
}

/* Tech Stack */
.tech-stack {
    display: flex;
    gap: 12px;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.tech-icon {
    font-size: 1.25rem;
    color: var(--primary-color);
    transition: var(--transition);
}

    .tech-icon:hover {
        color: var(--primary-dark);
        transform: scale(1.2);
    }

/* Theme Toggle */
#themeToggle {
    color: var(--text-color);
    transition: var(--transition);
    border-radius: 50px;
}

    #themeToggle:hover {
        background: rgba(74, 144, 226, 0.1);
    }

[data-theme="dark"] #themeToggle,
[data-bs-theme="dark"] #themeToggle {
    color: var(--primary-color) !important;
}

/* Badges */
.badge {
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    animation: fadeIn 0.5s ease-out forwards;
}


/* Type animation */
.typewriter {
    height: 1.5em; /* Fixed height to prevent layout shift */
    display: inline-block; /* Contain the cursor properly */
    border-right: 3px solid #4a90e2; /* The cursor */
    overflow: hidden;
    animation: blink-caret 0.75s step-end infinite;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 300;
}

@keyframes blink-caret {
    from, to {
        border-color: transparent
    }

    50% {
        border-color: #4a90e2;
    }
}

/* ====== Responsive Adjustments ====== */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding: 4rem 0;
    }

    .hero-img {
        max-width: 70%;
        margin-top: 2rem;
    }

    .section-title::after {
        width: 50px;
    }

    .contact-info {
        margin-top: 2rem;
    }

    .contact-item {
        margin-bottom: 1rem;
    }

    .social-icon {
        width: 36px;
        height: 36px;
        margin-right: 0.75rem;
    }
}
