/* --- Global Styles & Variables --- */
:root {
    --primary-color: #007BFF;
    --secondary-color: #6c757d;
    --background-color: #ffffff;
    --text-color: #343a40;
    --card-bg-color: #f8f9fa;
    --nav-bg-color: rgba(255, 255, 255, 0.85);
    --shadow-color: rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    --primary-color: #00A6ED;
    --secondary-color: #adb5bd;
    --background-color: #121212;
    --text-color: #e9ecef;
    --card-bg-color: #1e1e1e;
    --nav-bg-color: rgba(18, 18, 18, 0.85);
    --shadow-color: rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Header & Navigation --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background-color: var(--nav-bg-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: background-color 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.logo img {
    height: 40px; 
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: color 0.3s ease, transform 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.theme-toggle-btn:hover {
    color: var(--primary-color);
    transform: scale(1.2);
}

/* --- General Section Styling --- */
section {
    padding: 5rem 2rem; /* Reduced top/bottom padding */
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* --- Home Section --- */
#home {
    text-align: center;
}

.profile-photo {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 5px solid var(--primary-color);
    box-shadow: 0 4px 15px var(--shadow-color);
    margin-bottom: 1.5rem;
}

#home h1 {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

/* Style for the resume button in the home section */
#home .btn {
    margin-top: 2rem;
}

.tagline {
    font-size: 1.5rem;
    color: var(--secondary-color);
    font-weight: 300;
    min-height: 2.2rem;
}

.typewriter-cursor {
    display: inline-block;
    background-color: var(--text-color);
    width: 3px;
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    50% { opacity: 0; }
}

.location {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-top: 1rem;
}

/* --- About Section --- */
#about p {
    max-width: 800px;
    line-height: 1.8;
    font-size: 1.1rem;
}

/* --- Skills & Technologies Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 800px;
    margin-top: 2rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 1.5rem;
    background: var(--card-bg-color);
    border-radius: 10px;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px var(--shadow-color);
}

.skill-item i {
    font-size: 3rem;
    color: var(--primary-color);
}

.skill-item span {
    font-weight: 600;
}

/* --- Education (Timeline) --- */
.timeline {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin-top: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--primary-color);
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 40px;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 40px;
    text-align: left;
}

.timeline-item::after {
    content: '';
    position: absolute;
    top: 20px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--background-color);
    border: 3px solid var(--primary-color);
    z-index: 1;
}

.timeline-item:nth-child(odd)::after {
    right: -8px;
}

.timeline-item:nth-child(even)::after {
    left: -8px;
}

.timeline-content {
    padding: 1.5rem;
    background: var(--card-bg-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}
.timeline-content .date {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-top: 0.5rem;
    display: block;
}

/* --- Projects Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
    margin-top: 2rem;
}

.project-card {
    background: var(--card-bg-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow-color);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px var(--shadow-color);
}

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

.project-card h3, .project-card p, .project-card .btn {
    padding: 0 1.5rem;
}

.project-card h3 {
    margin-top: 1rem;
    color: var(--primary-color);
}

.project-card p {
    line-height: 1.6;
    margin: 1rem 0;
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 1.5rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* --- Contact Section --- */
#contact p {
    max-width: 600px;
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.contact-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    background: var(--card-bg-color);
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: transform 0.3s ease, color 0.3s ease;
}

.contact-links a:hover {
    transform: translateY(-5px);
    color: var(--primary-color);
}

.contact-links a i {
    margin-right: 0.5rem;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 1.5rem;
    background: var(--card-bg-color);
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .nav-links {
        display: none; /* Simple hiding for this example. Can be replaced with a hamburger menu. */
    }

    h1 {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1.2rem;
    }
    
    section {
        padding-top: 6rem;
    }
    
    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        left: 0 !important;
        padding-left: 50px;
        padding-right: 15px;
        text-align: left !important;
    }

    .timeline-item::after {
        left: 12px !important;
    }
}