:root {
    --primary: #232f3e;
    --secondary: #ff9900;
    --text: #333;
    --bg-light: #f8f9fa;
    --spacing: 2rem;
    --transition: all 0.3s ease;
    --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

body {
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary), #1a222e);
    color: white;
    padding: var(--spacing) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
    height: auto;
    min-height: 60px; /* Add minimum height for consistency */
}

header.scrolled {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

h1, h2, h3, h4 {
    font-weight: 600;
    letter-spacing: -0.5px;
}

header p {
    color: var(--secondary);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

/* Ensure content stays below header when scrolled */
.container {
    position: relative;
    margin-bottom: 1.5rem;

}


nav {
    display: flex;
    gap: 1.25rem;  /* Slightly reduced gap to fit all items */
    flex-wrap: wrap;
    justify-content: center;  /* Added to center items when wrapped */
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0.75rem;  /* Slightly reduced padding */
    border-radius: 4px;
    transition: var(--transition);
    font-size: 0.95rem;  /* Slightly reduced font size */
    font-weight: 500;
}

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

/* Section Styles */
section {
    padding: var(--spacing) 0;
    margin: 2rem 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    scroll-margin-top: 100px; /* This helps with scroll positioning */
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

section h2 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: var(--spacing);
    position: relative;
    padding-bottom: 0.5rem;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--secondary);
    border-radius: 2px;
}

/* About Section */
.about-content {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding-bottom: 1.2rem;
}

.about-text p {
    font-weight: 400;
    line-height: 1.8;
}

.profile-image {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--secondary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.profile-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 5%;
}

.about-text {
    flex: 1;
    padding-top: 1rem;
}

/* Skills Section */
#skills ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    list-style: none;
    padding-bottom: 1.2rem;

}

#skills li {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid var(--secondary);
    transition: var(--transition);
}

#skills li:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

#skills li i {
    color: var(--secondary);
    margin-right: 0.5rem;
}

/* Projects Section */
.project {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.project:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.project h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;

}

.project i {
    color: var(--secondary);
    margin-right: 0.5rem;
    
}

/* Work History Section */
.work-timeline {
    position: relative;
    padding: 1rem 0;
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.work-timeline::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0;
    width: 4px;
    height: 100%;
    background: #ffd700;
    border-radius: 2px;
}

.work-item {
    position: relative;
    padding: 1.5rem 0;
    display: flex;
    align-items: center;
}

.work-item::before {
    content: '';
    position: absolute;
    left: -2.5rem;
    width: 1rem;
    height: 1rem;
    background: white;
    border: 3px solid #ffd700;
    border-radius: 50%;
    transition: var(--transition);
}

.work-item:hover::before {
    background: #ffd700;
    transform: scale(1.1);
}

.work-info {
    display: grid;
    grid-template-columns: 300px 200px 200px auto;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.role {
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.company {
    color: #ffd700;
    font-weight: 500;
}

.location {
    color: var(--primary);
    font-style: italic;
}

.date {
    color: #666;
    font-size: 0.9rem;
    text-align: right;
}

/* Blog Section */
.blog-container {
    position: relative;
    padding: 0 40px;
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;


}

.blog-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
    opacity: 0.7;
}

.blog-nav-btn:hover {
    opacity: 1;
    background: var(--secondary);
    transform: translateY(-50%) scale(1.1);
}

.blog-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: var(--primary);
}

.prev-btn {
    left: 0;
}

.next-btn {
    right: 0;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.1rem;
    background: var(--bg-light);
    border-radius: 8px;
    margin: 1rem 0;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 1rem 0;
}

.error-message a {
    color: #721c24;
    text-decoration: underline;
}

#medium-posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 2rem;
    transition: transform 0.3s ease;
}

.post {
    position: relative;
    background: white;
    border-radius: 12px;
    height: 500px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.post:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.post-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-image {
    position: relative;
    background: var(--bg-light);
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: var(--transition);
}

.post:hover .post-image img {
    transform: scale(1.05);
}

.post-details {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    letter-spacing: -0.3px;

}

.post-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

.post-title a:hover {
    color: var(--secondary);
}

.post-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
}

.post-meta i {
    color: var(--secondary);
}

.post-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1rem;
}

.post-buttons {
    display: flex;
    margin-top: auto;
    padding-top: 1rem;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--secondary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border: 2px solid var(--secondary);
    width: 100%;
}

.read-more-btn:hover {
    background: #e68a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.2);
}

/* Contact Section */
.contact-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
}

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

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    padding: 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--secondary);
    transition: var(--transition);
}

.contact-item span {
    font-size: 1rem;
    font-weight: 500;
}

.contact-item:hover {
    transform: translateY(-5px);
    background: var(--bg-light);
}

.contact-item:hover i {
    transform: scale(1.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .contact-links {
        gap: 1.5rem;
    }
    
    .contact-item {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .contact-links {
        gap: 1rem;
    }
    
    .contact-item i {
        font-size: 1.25rem;
    }
    
    .contact-item span {
        font-size: 0.9rem;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 5px;
}

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

/* Responsive Design */
@media (max-width: 1200px) {
    #medium-posts {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem 0;
    }

    header h1 {
        font-size: 2rem;
    }

    nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    nav a {
        text-align: center;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .profile-image {
        margin: 0 auto 1.5rem;
    }

    .blog-nav-btn {
        display: none;
    }
    
    .blog-container {
        padding: 0;
    }

    #medium-posts {
        grid-template-columns: 1fr;
    }
    
    .post {
        height: auto;
        min-height: 500px;
    }

    section {
        margin: 1rem 0;
    }

    section h2 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    :root {
        --spacing: 1.5rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    header p {
        font-size: 1rem;
    }

    .post-title {
        font-size: 1.1rem;
    }

    .post-excerpt {
        font-size: 0.9rem;
    }
}

@media (max-width: 1200px) {
    .work-info {
        grid-template-columns: 250px 180px 180px auto;
    }
}

@media (max-width: 992px) {
    .work-info {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .date {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .work-timeline {
        margin-left: 1.5rem;
    }
    
    .work-timeline::before {
        left: -1.5rem;
    }
    
    .work-item::before {
        left: -2rem;
        width: 0.8rem;
        height: 0.8rem;
    }
    
    .role {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .work-item {
        padding-left: 1.5rem;
    }

    .work-header h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    nav a {
        text-align: center;
        padding: 0.75rem;
        font-size: 1rem;
    }
}

/* Education Section Styles */
#education {
    padding: var(--spacing) 0;
    margin-bottom: 1.5rem;

}

.education-item {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 8px;
    transition: var(--transition);
}

.degree-image {
    width: 100%;
    max-width: 600px;
    margin: 0 auto 2rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.degree-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

.degree-image:hover img {
    transform: scale(1.02);
}

/* Rest of the existing education styles remain the same */
.education-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.education-meta {
    display: flex;
    gap: 1.5rem;
    color: #666;
    margin: 0.5rem 0 1rem;
}

.school {
    color: var(--secondary);
    font-weight: 500;
}

.concentration {
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.certifications, .coursework {
    margin-top: 2rem;
}

.certifications h4, .coursework h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.certifications ul {
    display: flex;
    justify-content: space-around;
    align-items: center;
    list-style: none;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
    margin-top: 1rem;
}

.certifications li {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    transition: var(--transition);
}

.certifications li:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.cert-badge {
    height: 100px;
    width: auto;
    transition: var(--transition);
    margin-left: 1rem;
}

.cert-badge:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .certifications ul {
        flex-direction: column;
        gap: 1rem;
    }
    
    .certifications li {
        width: 100%;
        justify-content: center;
    }
}

.coursework ul {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    list-style: none;
    padding: 0;
}

.coursework li {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    transition: var(--transition);
}

.coursework li:hover {
    transform: translateY(-3px);
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@media (max-width: 992px) {
    .coursework ul {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .coursework ul {
        grid-template-columns: 1fr;
    }
}

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

/* Scroll to Top Button */

#scroll-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

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

#scroll-top:hover {
    background: var(--secondary);
    transform: translateY(-5px);
}

/* Only add mobile-specific styles within media queries to preserve desktop design */
/* Update the mobile media queries to keep nav horizontal */
@media (max-width: 768px) {
    header {
        padding: 1rem 0;
        height: auto;
        min-height: auto;
    }

    header .container {
        width: 100%;
        padding: 0.5rem 1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }


    header h1 {
        font-size: 2rem;
        margin-bottom: 0;
        text-align: center;
    }

    header p {
        font-size: 1rem;
        margin-bottom: 0.75rem;
        text-align: center;
    }

    /* Remove the column direction for nav */
    nav {
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        padding: 0.25rem;
    }

    nav a {
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
        white-space: nowrap;
    }

    .about-content {
        margin-top: 1rem;
    }

    #about {
        margin-top: 0.5rem;
    } 

    .profile-image {
        margin: 0 auto 1.5rem;
    }

    .blog-nav-btn {
        display: none;
    }
    
    .blog-container {
        padding: 0;
    }

    #medium-posts {
        grid-template-columns: 1fr;
    }
    
    .post {
        height: auto;
        min-height: 500px;
    }

    section {
        margin-top: 1rem;
        padding-top: 1.5rem;
    }

    section h2 {
        font-size: 1.75rem;
    }
}

/* Remove or update any other media queries that might affect nav */
@media (max-width: 480px) {
    :root {
        --spacing: 1.5rem;
    }

    header h1 {
        font-size: 1.75rem;
    }

    header p {
        font-size: 1rem;
    }

    /* Remove nav stacking for small screens */
    nav {
        flex-direction: row; /* Maintain horizontal layout */
        padding: 0.5rem;
        gap: 0.5rem;
    }

    nav a {
        font-size: 0.9rem;
        padding: 0.5rem 0.65rem;
    }

    .post-title {
        font-size: 1.1rem;
    }

    .post-excerpt {
        font-size: 0.9rem;
    }
}

/* Remove any duplicate mobile nav styles */
@media (max-width: 768px) {
    /* Remove this duplicate section that was forcing column layout */
    nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    nav a {
        text-align: center;
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
        white-space: nowrap;
    }
}