/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Prevent selection of SVG and icons */
svg, svg *, [aria-label] svg, .toggle-indicator, .theme-toggle * {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

:root {
    --color-bg: #ffffff;
    --color-text: #000000;
    --color-link: #000000;
    --color-link-hover: #000000;
}

body.dark-theme {
    --color-bg: #121212;
    --color-text: #f5f5f5;
    --color-link: #f5f5f5;
    --color-link-hover: #ffffff;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    padding: 70px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    opacity: 0; /* Start with 0 opacity for fade-in effect */
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out, opacity 0.4s ease-in-out; /* Smooth transitions */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

main {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Header section with content at top-left */
.header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8rem;
}

.left-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

h1 {
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.social {
    display: flex;
    gap: 1rem;
    align-items: center;
    user-select: none;
}

.social a {
    color: var(--color-link);
    text-decoration: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    user-select: none;
}

.social svg, .social svg path, .social a[aria-label="Twitter"] {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.bio {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.bio a {
    color: var(--color-link);
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

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

.research-link {
    margin-bottom: 0.75rem;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ASCII Art centered */
.ascii-art {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 0 auto;
}

.ascii-art-container {
    position: relative;
    max-width: 400px;
    width: 40%;
}

.ascii-art pre {
    font-family: monospace;
    white-space: pre;
    font-size: 12px;
    line-height: 1;
    text-align: center;
}

/* Theme-specific ASCII art */
.ascii-art img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    cursor: default;
    pointer-events: none; /* Completely prevents interaction with the image */
}

.ascii-art .theme-light {
    display: block;
}

.ascii-art .theme-dark {
    display: none;
}

body.dark-theme .ascii-art .theme-light {
    display: none;
}

body.dark-theme .ascii-art .theme-dark {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 40px;
    }
    
    .header {
        flex-direction: column;
        gap: 1.5rem;
        margin-bottom: 4rem;
    }
    
    .social {
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1.5rem;
    }
    
    .header {
        margin-bottom: 3rem;
    }
    
    .social {
        gap: 0.75rem;
    }
    
    h1 {
        font-size: 1rem;
    }
    
    .bio {
        font-size: 0.85rem;
    }
    
    .ascii-art pre {
        font-size: 10px;
    }
}

/* Theme toggle styles */
.theme-toggle-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    transform: scale(0.85);
    user-select: none;
}

.theme-toggle {
    position: relative;
    display: inline-block;
    user-select: none;
}

.theme-toggle input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    width: 50px;
    height: 25px;
    background-color: #FF5500;
    border-radius: 25px;
    display: inline-block;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    user-select: none;
}

body.dark-theme .toggle-track {
    background-color: #111;
}

.toggle-indicator {
    height: 21px;
    width: 21px;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right: 2px;
    transform: translateX(0);
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

#theme-toggle-checkbox:checked + .toggle-track .toggle-indicator {
    transform: translateX(-25px);
}

.toggle-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    opacity: 0;
    transition: opacity 0.2s ease;
    user-select: none;
}

.toggle-icon svg {
    stroke-width: 2px;
    width: 14px;
    height: 14px;
    user-select: none;
}

.toggle-icon svg * {
    user-select: none;
}

.toggle-icon-dark svg {
    stroke: #333;
    stroke-width: 2.5px;
}

.toggle-icon-light {
    opacity: 1;
}

.toggle-icon-dark {
    opacity: 0;
}

#theme-toggle-checkbox:checked + .toggle-track .toggle-icon-light {
    opacity: 0;
}

#theme-toggle-checkbox:checked + .toggle-track .toggle-icon-dark {
    opacity: 1;
}
