/* Import modern font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Theme Variables --- */
:root {
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    --body-color: #1e293b;
    --nav-bg: rgba(255, 255, 255, 0.85);
    --nav-border: rgba(255, 255, 255, 0.3);
    --nav-link-color: #64748b;
    --container-bg: #ffffff;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --heading-color: #0f172a;
    --subheading-color: #1e293b;
    --subtitle-color: #64748b;
    --border-color: #e2e8f0;
    --table-td-bg: #f8fafc;
    --table-td-border: #f1f5f9;
    --table-hover-bg: #f1f5f9;
    --cursor-wash: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, rgba(59, 130, 246, 0) 65%);
}

[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    --body-color: #f1f5f9;
    --nav-bg: rgba(15, 23, 42, 0.9);
    --nav-border: rgba(255, 255, 255, 0.05);
    --nav-link-color: #94a3b8;
    --container-bg: #1e293b;
    --card-bg: #0f172a;
    --card-border: #334155;
    --heading-color: #f8fafc;
    --subheading-color: #f1f5f9;
    --subtitle-color: #94a3b8;
    --border-color: #334155;
    --table-td-bg: #0f172a;
    --table-td-border: #334155;
    --table-hover-bg: #334155;
    --cursor-wash: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0) 65%);
}

/* --- Keyframe Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* --- Base Styles --- */
body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: var(--bg-gradient);
    color: var(--body-color);
    min-height: 100vh;
    scroll-behavior: smooth;
    transition: background 0.3s ease, color 0.3s ease;
}

/* --- Navigation (Glassmorphism & Flex Layout) --- */
nav {
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 14px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid var(--nav-border);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-links {
    margin: 0 auto;
    display: flex;
    align-items: center;
}

nav a {
    color: var(--nav-link-color);
    text-decoration: none;
    margin: 0 15px;
    font-weight: 600;
    font-size: 1.05em;
    transition: all 0.3s ease;
    display: inline-block;
}

nav a:hover, nav a.active {
    color: #3b82f6;
    transform: translateY(-2px);
}

/* --- Hamburger Menu Button --- */
.hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.3rem;
    align-items: center;
    justify-content: center;
    color: var(--body-color);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.hamburger:hover {
    background-color: var(--card-bg);
}

/* --- Theme Toggle Button --- */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    position: absolute;
    right: 30px;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background-color: var(--card-bg);
}

/* --- Main Container --- */
.container {
    max-width: 850px;
    margin: 60px auto;
    background: var(--container-bg);
    padding: 50px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    animation: fadeInUp 0.8s ease-out forwards;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.text-center {
    text-align: center;
}

/* --- Profile Picture --- */
.pfp {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid var(--container-bg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 25px;
    animation: float 6s ease-in-out infinite;
    transition: transform 0.4s ease, border-color 0.3s ease;
}

.pfp:hover {
    transform: scale(1.05) rotate(2deg);
    animation-play-state: paused;
}

/* --- Typography --- */
h1 {
    color: var(--heading-color);
    margin-bottom: 8px;
    font-size: 3em;
    font-weight: 700;
    letter-spacing: -1px;
    transition: color 0.3s ease;
}

h2 {
    color: var(--subheading-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-top: 35px;
    font-size: 1.6em;
    font-weight: 600;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.subtitle {
    color: var(--subtitle-color);
    font-size: 1.25em;
    margin-top: 0;
    font-weight: 400;
    transition: color 0.3s ease;
}

/* --- Contact Links --- */
.contact-info {
    margin: 25px 0;
    font-size: 1.1em;
}

.contact-info a {
    color: #3b82f6;
    text-decoration: none;
    margin: 0 12px;
    font-weight: 500;
    position: relative;
    transition: color 0.3s;
}

.contact-info a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: #3b82f6;
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.contact-info a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* --- Activity Widgets Container (Spotify & Books) --- */
#activity-widgets {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 16px;
    flex-wrap: wrap;
    margin: 24px 0;
}

.activity-widget {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px;
    width: 100%;
    max-width: 360px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--body-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.spotify-widget:hover {
    transform: translateY(-2px);
    border-color: #1DB954;
    box-shadow: 0 6px 20px rgba(29, 185, 84, 0.15);
}

.book-widget:hover {
    transform: translateY(-2px);
    border-color: #3b82f6;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
}

.widget-icon-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.widget-icon-emoji {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.widget-info {
    text-align: left;
    overflow: hidden;
}

.widget-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.spotify-header {
    color: #1DB954;
}

.book-header {
    color: #3b82f6;
}

.widget-title {
    font-weight: 600;
    color: var(--heading-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-subtitle {
    font-size: 0.8rem;
    color: var(--subtitle-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Interactive Hover Cards --- */
.hover-cards-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 45px auto 60px auto; 
    width: 100%; 
    max-width: 850px; 
    box-sizing: border-box; 
    padding: 0 20px; 
}

.hover-card {
    background: var(--card-bg);
    width: 100%; 
    box-sizing: border-box; 
    padding: 25px 30px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    cursor: pointer;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.hover-card:nth-child(1) { animation-delay: 0.3s; }
.hover-card:nth-child(2) { animation-delay: 0.5s; }
.hover-card:nth-child(3) { animation-delay: 0.7s; }

.hover-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: all 0.6s ease;
}

.hover-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.12);
    border-color: #bfdbfe;
}

.hover-card:hover::before {
    left: 100%;
}

.hover-card h3 {
    color: var(--heading-color);
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.hover-card:hover h3 {
    color: #2563eb;
}

.hover-card p {
    color: var(--subtitle-color);
    font-size: 0.95em;
    margin: 0;
    line-height: 1.5;
    transition: color 0.3s ease;
}

/* --- Skills Tags --- */
.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0;
    list-style: none;
}

.skills-list li {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.95em;
    font-weight: 600;
    border: 1px solid #bfdbfe;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: default;
}

[data-theme="dark"] .skills-list li {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #60a5fa;
    border-color: #334155;
}

.skills-list li:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.2);
    background: #2563eb;
    color: #ffffff;
}

/* --- Tables & Lists --- */
.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: 15px;
}

th, td {
    text-align: left;
    padding: 15px;
}

th {
    background-color: transparent;
    color: var(--subtitle-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

td {
    background-color: var(--table-td-bg);
    border: 1px solid var(--table-td-border);
    color: var(--body-color);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

td:first-child { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
td:last-child { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }

tr:hover td {
    background-color: var(--table-hover-bg);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

ul.experience-list {
    padding-left: 20px;
    color: var(--subtitle-color);
}

ul.experience-list li {
    margin-bottom: 12px;
}

/* --- GitHub Link --- */
.github-link {
    color: #0ea5e9;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    margin-left: 8px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}

.github-link:hover {
    color: #0284c7;
    transform: translateX(3px);
}

/* --- Cursor Dot --- */
.cursor-dot {
    position: absolute;
    width: 500px;
    height: 500px;
    background: var(--cursor-wash);
    border-radius: 50%;
    pointer-events: none; 
    transform: translate(-50%, -50%); 
    opacity: 0;
    transition: opacity 0.4s ease-out;
    z-index: 0;
}

#main-container > img,
#main-container > h1,
#main-container > .contact-info,
#main-container > #activity-widgets,
#main-container > h2,
#main-container > p {
    position: relative;
    z-index: 1;
}

/* --- Responsive Media Queries for Mobile View --- */
@media (max-width: 768px) {
    nav {
        padding: 12px 20px;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--nav-bg);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--nav-border);
        padding: 15px 0;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
        margin: 0;
        z-index: 999;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        margin: 10px 0;
        font-size: 1.1em;
    }

    .theme-toggle {
        position: static;
        margin-left: auto;
        margin-right: 15px;
    }

    .container {
        margin: 20px 15px;
        padding: 25px 20px;
        border-radius: 12px;
    }

    h1 {
        font-size: 2.2em;
    }

    .pfp {
        width: 140px;
        height: 140px;
    }

    .hover-cards-container {
        padding: 0 15px;
        margin: 30px auto;
    }

    #activity-widgets {
        flex-direction: column;
        align-items: center;
    }

    .activity-widget {
        max-width: 100%;
    }
}