/* Theme Variables */
html[data-theme="dark"] {
    --primary: #8ab4f8;           /* soft blue for highlights */
    --secondary: #5f6368;         /* muted gray for secondary elements */
    --background: #1e1e1e;        /* neutral dark background */
    --text: #e8eaed;              /* high contrast light text */
    --accent: #4fbfa8;            /* elegant greenish-blue (teal/jade) */
    --border: #3c4043;            /* subtle dark gray border */
    --card-bg: rgba(30, 30, 30, 0.85);
    --nav-bg: rgba(30, 30, 30, 0.9);
    --overlay: rgba(30, 30, 30, 0.95);
}

html[data-theme="light"] {
    --primary: #1a73e8;           /* vibrant blue for action */
    --secondary: #5f6368;         /* consistent muted gray */
    --background: #f0f1f3;        /* soft light gray (no white) */
    --text: #202124;              /* dark gray text for contrast */
    --accent: #3ba290;            /* deep jade greenish-blue */
    --border: #d1d5db;            /* light neutral border */
    --card-bg: rgba(243, 244, 246, 0.85);
    --nav-bg: rgba(243, 244, 246, 0.9);
    --overlay: rgba(243, 244, 246, 0.95);
}

.only-dark {
  display: none;
}

html[data-theme="dark"] .only-dark {
  display: inline;
}

html[data-theme="dark"] .only-light {
  display: none;
}

html {
    scroll-behavior: smooth;
}

.theme-toggle {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    background: var(--text);
    border: 2px solid var(--text);
    border-radius: 50%;
    color: var(--background);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* font-family: 'Courier New', monospace; */
    /* text-transform: uppercase; */
    /* letter-spacing: 1px; */
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    /* animation: subtlePulse 1.0s ease-in-out infinite; */
    animation: borderFlow 1.5s ease-in-out infinite;
}

/* Existing animations */
@keyframes glitch {
    0% {
        transform: translate(0)
    }

    20% {
        transform: translate(-2px, 2px)
    }

    40% {
        transform: translate(-2px, -2px)
    }

    60% {
        transform: translate(2px, 2px)
    }

    80% {
        transform: translate(2px, -2px)
    }

    100% {
        transform: translate(0)
    }
}

@keyframes scanline {
    0% {
        transform: translateY(-100%)
    }

    100% {
        transform: translateY(100%)
    }
}

@keyframes flicker {
    0% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.8;
    }
}

@keyframes borderFlow {
    0% {
        border-color: var(--border);
    }

    50% {
        border-color: var(--accent);
    }

    100% {
        border-color: var(--border);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes geometricReveal {
    0% {
        clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    }

    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

@keyframes subtlePulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

/* Modal window related css */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* background-color: rgba(0, 0, 0, 0.5); */
    backdrop-filter: blur(10px) brightness(80%) contrast(100%);
}

.modal-content {
    position: relative;
    background-color: var(--background);
    margin: 15vh auto;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 80%;
}


.modal-close {
    position: absolute;
    top: -0.25em;
    right: 0px;
    z-index: 1000;
    font-size: 2.1em;
    align-items: center;
    justify-content: center;
    /* padding: 0.4rem; */
    /* background: var(--card-bg); */
    /* border: 1px solid var(--border); */
    color: var(--accent);
    cursor: pointer;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    /* letter-spacing: 1px; */
    transition: all 0.3s ease;
}

.modal-close:hover {
    transform: translateY(-2px) translateX(2px);
    /* animation: subtlePulse 1.0s ease-in-out infinite; */
    animation: borderFlow 1.0s ease-in-out infinite;
}

.modal-candidate {
    display: none;
}

.modal-icon {
    color: var(--accent);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Sora', 'Epilogue', 'Montserrat', 'Courier Prime', 'Courier New', monospace;
}

body {
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    position: relative;
    transition: all 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(var(--overlay), var(--overlay)),
        url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h20v20H0V0zm10 10h10v10H10V10zM0 10h10v10H0V10z' fill='%23938875' fill-opacity='0.1'/%3E%3C/svg%3E");
    z-index: -1;
    transition: all 0.3s ease;
}

/* body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: linear-gradient(transparent 50%, rgba(195, 181, 159, 0.025) 50%);
    background: linear-gradient(transparent, var(--accent));
    background-size: 100% 0.5em;
    pointer-events: none;
    animation: scanline 15s linear infinite;
    opacity: 0.025;
    z-index: 999;
} */

header {
    background-color: var(--nav-bg);
    color: var(--text);
    padding: 2rem;
    text-align: center;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 16px;
    margin: 2rem;
    transition: all 0.3s ease;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 5px;
    pointer-events: none;
}

.profile-section {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
}

.profile-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border: 2px solid var(--border);
    border-radius: 12px;
    position: relative;
    /* filter: sepia(20%); */
}

.profile-image::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 1px solid var(--border);
    border-radius: 16px;
    animation: glitch 2s infinite;
}

.profile-info h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: flicker 4s infinite;
}

nav {
    background-color: transparent;
    backdrop-filter: blur(10px) brightness(100%) contrast(98%);
    /* background-color: var(--background); */
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

nav ul {
    max-width: 1000px;
    margin: 0 auto;
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    position: relative;
    transition: color 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    border-radius: 8px;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

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

nav a:hover::before {
    opacity: 1;
}

main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--background);
    position: relative;
    border: 1px solid var(--border);
    border-radius: 16px;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 5px;
    pointer-events: none;
}

h2 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 100%;
    height: 1px;
    background: var(--border);
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.course-card {
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
    transition: transform 0.3s;
    background: var(--background);
}

.course-card:hover {
    transform: translateY(-5px);
    /* animation: glitch 0.3s infinite; */
    animation: borderFlow 1.5s ease-in-out infinite;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 5px;
    pointer-events: none;
}

.publication {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.publication a {
    color: inherit;
    text-decoration: none;
}

.publication a:hover {
    text-decoration: underline;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.skill-item {
    background: var(--background);
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
    transition: transform 0.3s;

    display: flex;
    align-items: center;
    /* Vertical alignment */
    justify-content: center;
    /* Horizontal alignment */
}

.skill-item i, .ifix {
    font-size: 2.5rem;
}

.skill-item .ifix {
    font-size: 2.2rem;
}

.skill-item:hover {
    transform: translateY(-3px);
    color: var(--accent);
    /* animation: glitch 0.3s infinite; */
    animation: borderFlow 1.5s ease-in-out infinite;
}

.mail-address {
    color: inherit;
    text-decoration: none;
}

.mail-address:hover {
    text-decoration: underline;
}

footer {
    background-color: var(--background);
    color: var(--text);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    position: relative;
}

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

.contact-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 1.5rem;
    transition: color 0.3s;
    position: relative;
}

.contact-links a:hover {
    color: var(--accent);
    /* animation: glitch 0.3s infinite; */
    animation: borderFlow 1.5s ease-in-out infinite;
}

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

::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border: 1px solid var(--text);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
    border: 1px solid var(--accent);
    border-radius: 4px;
}

@media (max-width: 768px) {
    .profile-section {
        flex-direction: column;
        text-align: center;
    }

    /* nav ul {
        flex-wrap: wrap;
    } */
    nav {
        padding: 0.5rem 0;
    }

    nav ul {
        max-width: none;
        margin: 0;
        justify-content: flex-start;
        gap: 1rem;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.5rem 1rem;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        
        /* Hide scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    nav ul::-webkit-scrollbar {
        display: none;
    }

    nav li {
        flex-shrink: 0;
    }

    nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        letter-spacing: 0.5px;
    }
}