/* Color Palette */
:root {
    /* Light Mode Colors */
    --bg-color: #F0F8FF;
    --card-bg: #FFFFFF;
    --text-color: #1A3A5A;
    --text-muted: #4A6585;
    --primary-color: #3498DB;
    --secondary-color: #2ECC71;
    --accent-light: #E1F0FA;
    --border-color: #E1E8ED;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --shadow-hover: rgba(0, 0, 0, 0.1);
}

/* Dark mode colors - applied when data-theme="dark" is set on html element */
html[data-theme="dark"] {
    --bg-color: #0F172A;
    --card-bg: #1E293B;
    --text-color: #E2E8F0;
    --text-muted: #94A3B8;
    --primary-color: #38BDF8;
    --secondary-color: #4ADE80;
    --accent-light: #1E3A5F;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --shadow-hover: rgba(0, 0, 0, 0.4);
}

/* System preference based dark mode (fallback) */
@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) {
        --bg-color: #0F172A;
        --card-bg: #1E293B;
        --text-color: #E2E8F0;
        --text-muted: #94A3B8;
        --primary-color: #38BDF8;
        --secondary-color: #4ADE80;
        --accent-light: #1E3A5F;
        --border-color: #334155;
        --shadow-color: rgba(0, 0, 0, 0.2);
        --shadow-hover: rgba(0, 0, 0, 0.4);
    }
}

/* General Styles */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

html {
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
}

*, *:before, *:after {
    box-sizing: inherit;
    max-width: 100%;
}

/* Header and Navigation */
header {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px var(--shadow-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

header nav {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin: 0 20px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 12px;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.nav-links a:hover {
    background-color: var(--accent-light);
    color: var(--primary-color);
}

.nav-links a.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5em;
    cursor: pointer;
    padding: 8px;
    z-index: 1010;
}

/* Theme Toggle Button */
.theme-toggle {
    background-color: var(--accent-light);
    border: none;
    border-radius: 50%;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    height: 36px;
    width: 36px;
    margin-left: 20px;
    position: absolute;
    right: 20px;
    transition: all 0.3s ease;
    z-index: 1010;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    background-color: var(--primary-color);
    color: white;
}

.theme-toggle .fa-sun {
    display: none;
}

.theme-toggle .fa-moon {
    display: block;
}

.theme-toggle.dark-mode .fa-sun {
    display: block;
}

.theme-toggle.dark-mode .fa-moon {
    display: none;
}

/* Main Content Styles */
main {
    max-width: 1200px;
    margin: 40px auto 100px;
    padding: 20px;
    background-color: var(--card-bg);
    box-shadow: 0 2px 15px var(--shadow-color);
    border-radius: 12px;
}

/* 3D Parallax Title Effect */
h1 {
    position: relative;
    transition: transform 0.3s ease;
}

h1:hover {
    transform: translateY(-2px);
}

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

p {
    font-size: 1.1em;
    line-height: 1.8;
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Card Container Styles */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0;
}

/* Individual Card Styles */
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow-hover);
    border-color: var(--border-color);
}

.card h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: var(--text-color);
    font-weight: 600;
}

.card p {
    font-size: 1em;
    margin-bottom: 20px;
    line-height: 1.6;
    color: var(--text-muted);
    flex-grow: 1;
}

/* Button Style */
.link {
    display: inline-block;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    background-color: var(--accent-light);
    transition: all 0.3s ease;
    border: none;
    text-align: center;
}

.link:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

/* General Styling for Work Experience */
.work-experience {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0;
}

.work-experience h1 {
    text-align: center;
    color: var(--text-color);
    font-size: 2.5em;
    margin-bottom: 50px;
}

/* Hidden class to hide full content */
.hidden {
    display: none;
}

/* Read More button styling */
.read-more {
    background-color: var(--accent-light);
    color: var(--primary-color);
    border: none;
    padding: 6px 14px;
    cursor: pointer;
    border-radius: 6px;
    margin-top: 15px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.85em;
    float: right;
    display: inline-block;
    clear: both;
}

.read-more:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

/* Simplified Work Experience Items */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: relative;
}

.timeline-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 25px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow-color);
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.timeline-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px var(--shadow-hover);
    border-color: var(--primary-color);
}

/* Logo Styling */
.timeline-logo {
    flex-shrink: 0;
    margin-right: 30px;
}

.timeline-logo img {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    object-fit: contain;
    padding: 10px;
    background-color: var(--card-bg);
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: all 0.5s ease;
    filter: grayscale(20%);
}

.timeline-item:hover .timeline-logo img {
    transform: scale(1.1) rotate(5deg);
    filter: grayscale(0%);
    box-shadow: 0 10px 20px var(--shadow-hover);
}

/* Timeline Content Styling */
.timeline-content {
    flex: 1;
    transition: transform 0.4s ease;
}

.timeline-content h2 {
    color: var(--text-color);
    font-size: 1.5em;
    margin-bottom: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-content h2 {
    color: var(--primary-color);
}

.timeline-content h3 {
    font-size: 1.1em;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.timeline-content p {
    color: var(--text-muted);
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-content p {
    color: var(--text-color);
}

.timeline-content p.short-description {
    margin-bottom: 0;
}

.timeline-content p.full-description {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
}

.timeline-date {
    font-size: 0.9em;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 15px;
    display: inline-block;
    background-color: var(--accent-light);
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-date {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Timeline Skills Styling */
.timeline-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 15px;
}

.timeline-skills span {
    background-color: var(--accent-light);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.timeline-skills span:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow-hover);
    background-color: var(--primary-color);
    color: white;
}

/* Contact Page Styles */
.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 40px auto;
    padding: 0;
}

.contact-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow-color);
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.contact-card:hover {
    transform: translateY(-10px) translateZ(30px);
    box-shadow: 0 20px 40px var(--shadow-hover);
}

.contact-card i {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 20px;
    background-color: var(--accent-light);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.5s ease, background-color 0.3s ease;
    transform-style: preserve-3d;
}

.contact-card:hover i {
    transform: translateZ(40px) rotateY(360deg);
    background-color: var(--primary-color);
    color: white;
}

.contact-card h2 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: var(--text-color);
    font-weight: 600;
}

.contact-link {
    display: inline-block;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    background-color: var(--accent-light);
    transition: all 0.3s ease;
    border: none;
    margin-top: 15px;
    word-break: break-word;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.contact-link:hover {
    transform: translateY(-5px) translateZ(20px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

/* Footer Styles */
footer {
    background-color: var(--card-bg);
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
    width: 100%;
    box-shadow: 0 -2px 10px var(--shadow-color);
    /* Dynamic/fixed positioning will be controlled by JavaScript */
    transition: position 0.3s ease;
}

footer.fixed {
    position: fixed;
    bottom: 0;
}

footer.dynamic {
    position: static;
    margin-top: 50px;
}

footer p {
    margin: 0;
    font-size: 0.9em;
}

/* Hero Section Styles */
.hero {
    display: flex;
    flex-direction: column;
    gap: 50px;
    padding: 20px;
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: all 0.5s ease;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: translateZ(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 25px;
    background: var(--card-bg);
}

.hero-content h1 {
    font-size: 3em;
    margin-bottom: 0;
    padding-bottom: 0;
    text-align: left;
}

.hero-content h1:after {
    display: none;
}

.hero-content h2 {
    font-size: 1.8em;
    color: var(--secondary-color);
    font-weight: 600;
    margin-top: -10px;
    margin-bottom: 20px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.hero-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.hero-button.secondary {
    background-color: var(--accent-light);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.hero-button.secondary:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.hero-skills {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    transform: translateZ(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 25px;
    background: var(--card-bg);
}

.hero-skills h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: var(--text-color);
    position: relative;
    padding-bottom: 10px;
}

.hero-skills h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.skill-item {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.skill-item:hover {
    animation: float 2s ease-in-out infinite;
    box-shadow: 0 15px 25px var(--shadow-hover);
    transform: scale(1.05);
}

.skill-item i {
    font-size: 1.5em;
    margin-right: 10px;
    color: var(--primary-color);
}

/* Floating animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Mobile Responsive Design - CONSOLIDATED */
@media (max-width: 768px) {
    /* Header and Navigation */
    header {
        padding: 0;
        height: auto;
    }
    
    header nav {
        position: relative;
        justify-content: center;
        height: 50px;
        display: flex;
        align-items: center;
        padding: 0 15px;
    }
    
    /* Mobile Menu Toggle - ALWAYS VISIBLE */
    .mobile-menu-toggle {
        display: block !important;
        position: absolute !important;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1010;
        font-size: 1.3em;
        padding: 8px;
        margin: 0;
        background: none;
        border: none;
        color: var(--text-color);
    }
    
    .mobile-menu-toggle:hover {
        color: var(--primary-color);
    }
    
    /* Theme Toggle Position */
    .theme-toggle {
        position: absolute !important;
        right: 15px;
        top: 50%;
        transform: translateY(-50%) !important;
        margin: 0;
        background: none;
        width: 35px;
        height: 35px;
    }
    
    /* Mobile Navigation Overlay */
    .nav-links {
        display: none;
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        z-index: 1000;
        background-color: var(--card-bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding-top: 60px;
        opacity: 0.98;
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
    }
    
    .nav-links.active {
        display: flex !important;
    }
    
    .nav-links li {
        margin: 15px 0;
    }
    
    .nav-links a {
        font-size: 1.2em;
        padding: 15px 25px;
        display: block;
        text-align: center;
    }
    
    /* Hero Section */
    .hero {
        flex-direction: column;
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        overflow-x: hidden;
    }
    
    .hero-content {
        width: 100%;
        padding: 15px;
        margin: 0;
        text-align: center;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    .hero-content h1 {
        font-size: 2.2em;
        margin: 0 auto;
        text-align: center;
    }
    
    .hero-content h2 {
        font-size: 1.4em;
        margin: 10px auto;
        text-align: center;
    }
    
    .hero-content p {
        max-width: 100%;
        margin: 20px auto;
        text-align: center;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 0;
        align-items: center;
        box-sizing: border-box;
    }
    
    .hero-button {
        width: 100%;
        box-sizing: border-box;
        margin: 5px 0;
        padding: 12px 20px;
    }
    
    .hero-skills {
        margin-top: 30px;
        padding: 20px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .skills-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        max-width: 100%;
    }
    
    .skill-item {
        padding: 12px;
        font-size: 0.9em;
        text-align: center;
    }
    
    /* Timeline/Experience Section */
    .timeline-item {
        flex-direction: column;
        padding: 20px;
        width: 100%;
        box-sizing: border-box;
        margin: 0 0 20px 0;
    }
    
    .timeline-logo {
        margin-bottom: 20px;
        margin-right: 0;
        align-self: center;
    }
    
    .timeline-content h2, .timeline-content h3 {
        text-align: center;
    }
    
    .timeline-skills {
        justify-content: center;
    }
    
    .timeline-date {
        display: block;
        text-align: center;
        margin: 15px auto 0;
        width: fit-content;
    }
    
    .read-more {
        float: none;
        display: block;
        text-align: center;
        width: 100%;
    }
    
    /* Main Content */
    main {
        margin: 20px 10px 80px;
        padding: 15px;
        width: auto;
        box-sizing: border-box;
    }
    
    /* Project Cards */
    .project-tech {
        justify-content: center;
    }
    
    .project-tech span {
        text-align: center;
        justify-content: center;
    }
    
    .card .link {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Card Container */
    .card-container {
        grid-template-columns: 1fr;
        gap: 20px;
        width: 100%;
        padding: 0;
    }
    
    .card {
        padding: 20px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Typography */
    h1 {
        font-size: 2em;
        text-align: center;
    }
    
    h2 {
        font-size: 1.5em;
        text-align: center;
    }
    
    p {
        font-size: 1em;
        text-align: center;
    }
    
    /* Center align all descriptions */
    main p, .section-intro, .work-experience p, .projects-intro p {
        text-align: center !important;
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* Contact */
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    /* Footer always dynamic on mobile */
    footer {
        position: static !important;
        margin-top: 50px;
        padding: 10px 0;
    }
    
    footer.fixed {
        position: static !important;
    }
}

/* Section Intro/Description Paragraph */
.section-intro {
    font-size: 1.2em;
    max-width: 800px;
    margin: 0 auto 40px;
    text-align: center;
    color: var(--text-muted);
}

/* Project Card Styles */
.project-card {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.project-card > div {
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.project-card:hover > div {
    border-color: var(--primary-color);
}

.project-card:hover .card {
    transform: translateY(-10px) translateZ(30px) rotateX(2deg);
    box-shadow: 0 20px 40px var(--shadow-hover);
    border-color: var(--primary-color);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.project-tech span {
    background-color: var(--accent-light);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.project-tech span i {
    font-size: 1.1em;
}

.project-tech span:hover {
    transform: translateZ(20px) scale(1.1);
    background-color: var(--primary-color);
    color: white;
}

/* Mobile Project Card Styles */
@media (max-width: 768px) {
    .project-tech {
        justify-content: center;
    }
    
    .project-tech span {
        text-align: center;
        justify-content: center;
    }
    
    .card .link {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Desktop Responsive Design */
@media (min-width: 768px) {
    .hero {
        flex-direction: row;
    }
    
    .hero-content {
        flex: 3;
    }
    
    .hero-skills {
        flex: 2;
    }
}