/* Parchment Chic Theme, custom that I'm also using for the app that i am building in startup studio*/
:root {
    --primary: #8B4513;
    --primary-light: #D2B48C;
    --dark: #5C4033;
    --dark-light: #3E2723;
    --light: #FFFBEB;
    --light-gray: #F5EED8;
    --text-dark: #252525;
    --text-light: #FFFBEB;
    --text-muted: #6a5f4a;
    --accent: #891C1C;
    --transition: all 0.3s ease;
}

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

body {
    background-color: var(--light);
    color: var(--text-dark);
    line-height: 1.7;
    transition: var(--transition);
    font-family: 'Georgia', serif; 
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Baskerville', 'Libre Baskerville', serif;
    font-weight: bold;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: rgba(255, 251, 235, 0.9); /* Parchment semi-transparent custom font  */
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid var(--primary);
    transition: var(--transition);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    position: relative;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    font-family: 'Baskerville', 'Libre Baskerville', serif;
    letter-spacing: 1px;
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-dark);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 101;
}

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

nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 1.1rem;
    transition: var(--transition);
    position: relative;
    font-family: 'Garamond', 'EB Garamond', serif;
}

nav a:hover {
    color: var(--primary);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: var(--transition);
}

nav a:hover::after {
    width: 100%;
}

.theme-switcher {
    background-color: transparent;
    color: var(--text-dark);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-switcher:hover {
    background-color: var(--light-gray);
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8rem;
    padding: 100px 0;
    gap: 50px;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 3.2rem;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--dark);
    font-family: 'Baskerville', 'Libre Baskerville', serif;
    font-weight: bold;
}

.hero-text h1 span {
    color: var(--primary);
    font-style: italic;
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-family: 'Garamond', 'EB Garamond', serif;
}

.hero-image {
    flex: 1;
    position: relative;
}

.profile-container {
    width: 350px;
    height: 350px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 8px solid var(--light-gray);
    outline: 2px solid var(--primary);
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upload-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(2, 8, 72, 0.8);
    padding: 15px;
    color: white;
    text-align: center;
    transform: translateY(100%);
    transition: var(--transition);
}

.profile-container:hover .upload-overlay {
    transform: translateY(0);
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background-color: var(--primary);
    color: var(--light);
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--accent);
    transform: translateY(-3px);
}

/* Sections */
section {
    padding: 80px 0;
    position: relative;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--dark);
    display: inline-block;
    font-family: 'Baskerville', 'Libre Baskerville', serif;
    letter-spacing: 1px;
}

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

/* Education Section */
.education-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.education-card {
    background-color: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    border: 1px solid #DDD6C1;
}

.education-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.education-card-header {
    padding: 25px;
    background-color: var(--primary);
    color: white;
}

.education-card-body {
    padding: 25px;
}

.education-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-family: 'Baskerville', 'Libre Baskerville', serif;
    font-weight: bold;
}

.education-subtitle {
    font-size: 1.1rem;
    color: var(--light);
    opacity: 0.9;
    font-family: 'Garamond', 'EB Garamond', serif;
    font-style: italic;
}

.education-date {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-top: 10px;
    font-family: 'Georgia', serif;
}

.education-detail {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-family: 'Garamond', 'EB Garamond', serif;
}

/* Skills Section */
.skills-container {
    background-color: var(--light-gray);
    border-radius: 4px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #DDD6C1;
}

.skill-group {
    margin-bottom: 20px;
}

.skill-group h3 {
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 1.3rem;
    font-family: 'Baskerville', 'Libre Baskerville', serif;
    font-weight: bold;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background-color: var(--light);
    color: var(--text-dark);
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: var(--transition);
    border: 1px solid #DDD6C1;
    font-family: 'Garamond', 'EB Garamond', serif;
}

.skill-tag:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-3px);
}

/* Experience Section */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

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

.timeline-item {
    position: relative;
    width: 50%;
    padding: 20px 40px;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

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

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

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

.timeline-content {
    background-color: var(--light-gray);
    padding: 25px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    border: 1px solid #DDD6C1;
}

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

.timeline-date {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 15px;
    font-family: 'Georgia', serif;
}

.timeline-title {
    font-size: 1.4rem;
    margin-bottom: 5px;
    color: var(--text-dark);
    font-family: 'Baskerville', 'Libre Baskerville', serif;
    font-weight: bold;
}

.timeline-subtitle {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 15px;
    font-family: 'Garamond', 'EB Garamond', serif;
}

.timeline-details {
    margin-top: 15px;
}

.timeline-details ul {
    padding-left: 20px;
}

.timeline-details li {
    margin-bottom: 8px;
    color: var(--text-muted);
    font-family: 'Garamond', 'EB Garamond', serif;
}

/* Projects Section */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    border: 1px solid #DDD6C1;
}

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

.project-image {
    height: 200px;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.project-content {
    padding: 25px;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--text-dark);
    font-family: 'Baskerville', 'Libre Baskerville', serif;
    font-weight: bold;
}

.project-tech {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 15px;
    font-size: 0.9rem;
    font-family: 'Garamond', 'EB Garamond', serif;
}

.project-description {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.95rem;
    font-family: 'Garamond', 'EB Garamond', serif;
}

.project-link {
    display: inline-block;
    padding: 8px 20px;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: 'Georgia', serif;
}

.project-link:hover {
    background-color: var(--accent);
    transform: translateY(-3px);
}

/* Tech News Section */
.news-container {
    background-color: var(--light-gray);
    border-radius: 4px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #DDD6C1;
}

#news-content {
    margin-bottom: 20px;
}

.news-item {
    padding: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid #DDD6C1;
    transition: var(--transition);
}

.news-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.news-item:hover {
    transform: translateY(-3px);
}

.news-title {
    margin-bottom: 8px;
}

.news-title a {
    color: var(--primary);
    text-decoration: none;
    font-family: 'Baskerville', 'Libre Baskerville', serif;
    font-size: 1.2rem;
    font-weight: 600;
    transition: var(--transition);
}

.news-title a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.news-meta {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    font-family: 'Garamond', 'EB Garamond', serif;
}

#fetchNews {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Georgia', serif;
}

#fetchNews:hover {
    background-color: var(--accent);
    transform: translateY(-3px);
}

/* Dark Theme Fixes */
.dark-theme {
    background-color: #2c2418; /* Darker brown background */
    color: var(--text-light);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23241c12" fill-opacity="0.4"/><path d="M0 50 L100 50" stroke="%23362b1e" stroke-width="0.5" stroke-dasharray="10,5" stroke-opacity="0.2"/><path d="M50 0 L50 100" stroke="%23362b1e" stroke-width="0.5" stroke-dasharray="10,5" stroke-opacity="0.2"/></svg>');
    background-repeat: repeat;
}

.dark-theme header {
    background-color: rgba(59, 41, 33, 0.95); /* More opaque dark brown */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-bottom: 3px solid var(--primary-light);
}

.dark-theme .logo {
    color: var(--primary-light);
}

.dark-theme nav a {
    color: var(--text-light);
}

.dark-theme nav a:hover {
    color: var(--primary-light);
}

.dark-theme nav a::after {
    background-color: var(--primary-light);
}

.dark-theme .theme-switcher {
    color: var(--text-light);
}

.dark-theme .mobile-menu-toggle {
    color: var(--text-light);
}

.dark-theme .theme-switcher:hover {
    background-color: var(--dark-light);
}

.dark-theme .hero-text h1 {
    color: var(--text-light);
}

.dark-theme .hero-text h1 span {
    color: var(--primary-light);
}

.dark-theme .hero-text p {
    color: #d5cbb9; 
}

.dark-theme .profile-container {
    border: 8px solid var(--dark-light);
    outline: 2px solid var(--primary-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dark-theme .section-title h2 {
    color: var(--text-light);
}

.dark-theme .section-title h2::after {
    background: var(--primary-light);
}

.dark-theme section::before {
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
}

/* Card elements in dark mode */
.dark-theme .education-card, 
.dark-theme .skills-container, 
.dark-theme .timeline-content, 
.dark-theme .project-card {
    background-color: #3b2921; /* Slightly lighter than body background */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #4d372c; /* Subtle border */
}

.dark-theme .education-card:hover,
.dark-theme .timeline-content:hover,
.dark-theme .project-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.dark-theme .education-card-header {
    background-color: var(--primary-light);
    color: #2c2418; /* Dark text on light background for contrast */
}

.dark-theme .education-title,
.dark-theme .timeline-title,
.dark-theme .project-title {
    color: var(--text-light);
}

.dark-theme .education-detail,
.dark-theme .timeline-details li,
.dark-theme .project-description,
.dark-theme .project-tech {
    color: #d5cbb9; /* Lighter muted text for better readability */
}

.dark-theme .education-subtitle {
    color: #2c2418; /* Dark text on light background for contrast */
}

.dark-theme .skill-group h3 {
    color: var(--primary-light);
}

.dark-theme .skill-tag {
    background-color: #2c2418;
    border: 1px solid #4d372c;
    color: var(--text-light);
}

.dark-theme .skill-tag:hover {
    background-color: var(--primary-light);
    color: #2c2418;
}

.dark-theme .timeline::after {
    background-color: var(--primary-light);
}

.dark-theme .timeline-item::after {
    background-color: #2c2418;
    border: 3px solid var(--primary-light);
}

.dark-theme .timeline-date {
    background-color: var(--primary-light);
    color: #2c2418;
}

.dark-theme .timeline-subtitle {
    color: #d5cbb9;
}

.dark-theme .project-link {
    background-color: var(--primary-light);
    color: #2c2418;
}

.dark-theme .project-link:hover {
    background-color: var(--accent);
    color: var(--text-light);
}

.dark-theme .news-container {
    background-color: #3b2921;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #4d372c;
}

.dark-theme .news-item {
    border-bottom-color: #4d372c;
}

.dark-theme .news-title a {
    color: var(--primary-light);
}

.dark-theme .news-title a:hover {
    color: var(--light);
}

.dark-theme .news-meta {
    color: #d5cbb9;
}

.dark-theme #fetchNews {
    background-color: var(--primary-light);
    color: #2c2418;
}

.dark-theme #fetchNews:hover {
    background-color: var(--accent);
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding: 60px 0;
    }

    .social-icons {
        justify-content: center;
    }

    .profile-container {
        width: 250px;
        height: 250px;
        margin-bottom: 30px;
    }

    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item:nth-child(even) {
        left: 0;
    }

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

/* Mobile Navigation Improvements */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
        padding-bottom: 15px;
    }

    .nav-menu {
        width: 100%;
        overflow-x: auto; /* Allow horizontal scrolling if needed */
    }

    nav ul {
        justify-content: center;
        gap: 1rem;
        padding-bottom: 5px; /* Add a bit of padding at the bottom */
        flex-wrap: wrap; /* Allow menu items to wrap on very small screens */
    }

    nav a {
        font-size: 0.95rem; /* Slightly smaller font size on mobile */
        padding: 5px 0; /* Add vertical padding for better tap targets */
    }

    .theme-switcher {
        position: absolute;
        top: 15px;
        right: 20px;
    }

    /* Fix hero section margins */
    .hero {
        margin-left: 0; /* Remove the left margin on mobile */
        padding: 40px 0; /* Reduce padding on mobile */
    }
}

/* Add a mobile menu toggle for very small screens */
@media (max-width: 576px) {
    .nav-menu {
        display: none; /* Hide by default on very small screens */
    }

    .nav-menu.active {
        display: block; /* Show when active class is added */
    }

    .mobile-menu-toggle {
        display: block;
        position: absolute;
        top: 15px;
        right: 20px;
        background: transparent;
        border: none;
        color: var(--text-dark);
        font-size: 1.5rem;
        cursor: pointer;
        z-index: 101;
    }

    .dark-theme .mobile-menu-toggle {
        color: var(--text-light);
    }

    .theme-switcher {
        position: absolute;
        top: 15px;
        right: 70px; /* Move to accommodate menu button */
    }

    nav ul {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 1rem 0;
    }

    nav a {
        font-size: 1.1rem; /* Larger font for better tap targets in dropdown */
        display: block;
        padding: 8px 0;
    }

    /* Project and Education cards full width */
    .education-container,
    .projects-container {
        grid-template-columns: 1fr;
    }
    
    /* Adjust timeline for very small screens */
    .timeline-item {
        padding-left: 50px;
        padding-right: 10px;
    }
}

/* Additional timeline fixes for mobile */
@media (max-width: 480px) {
    .timeline::after {
        left: 22px; /* Adjust the vertical line position */
    }
    
    .timeline-item::after {
        width: 16px;
        height: 16px;
    }
    
    .timeline-item:nth-child(odd)::after,
    .timeline-item:nth-child(even)::after {
        left: 15px;
    }
    
    .timeline-item {
        padding-left: 45px;
    }
    
    /* Adjust other section paddings for smaller screens */
    section {
        padding: 50px 0;
    }
    
    .section-title {
        margin-bottom: 30px;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
}

/* Fix profile container on small screens */
@media (max-width: 400px) {
    .profile-container {
        width: 200px;
        height: 200px;
    }
}