/* Variables */
:root {
    /* Light mode (default) */
    --primary-color: #1e1e1e;
    --secondary-color: #3a86ff;
    --accent-color: #ff006e;
    --background: #ffffff;
    --terminal-bg: #f5f5f5;
    --terminal-header: #e0e0e0;
    --text-color: #121212;
    --heading-color: #000000;
    --link-color: #3a86ff;
    --link-hover: #ff006e;
    --scanline-color: rgba(0, 0, 0, 0.03);
    --text-glow: 0 0 2px rgba(0, 0, 0, 0.5);
    --border-color: #1e1e1e;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --toggle-bg: #e0e0e0;
    --toggle-switch: #ffffff;
}

/* Dark mode variables */
:root.dark-mode {
    --primary-color: #e1e1e1;
    --secondary-color: #64b5ff;
    --accent-color: #ff5a9d;
    --background: #121212;
    --terminal-bg: #1e1e1e;
    --terminal-header: #2a2a2a;
    --text-color: #e1e1e1;
    --heading-color: #ffffff;
    --link-color: #64b5ff;
    --link-hover: #ff5a9d;
    --scanline-color: rgba(255, 255, 255, 0.03);
    --text-glow: 0 0 2px rgba(255, 255, 255, 0.5);
    --border-color: #444444;
    --nav-bg: rgba(18, 18, 18, 0.9);
    --toggle-bg: #444444;
    --toggle-switch: #f5f5f5;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Space Mono', monospace;
    background-color: var(--background);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

a {
    text-decoration: none;
    color: var(--link-color);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--link-hover);
    text-shadow: var(--text-glow);
}

ul {
    list-style: none;
}

.retro-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Scanlines effect - subtle */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        var(--scanline-color) 51%,
        transparent 51%
    );
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
    opacity: 0.1;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255,255,255,0) 0%, rgba(0,0,0,0.02) 90%);
    pointer-events: none;
    z-index: 9;
    opacity: 0.4;
}

/* Header styles */
header {
    margin-bottom: 2rem;
    position: relative;
}

.terminal {
    background-color: var(--terminal-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 2rem 0;
    border: 1px solid var(--border-color);
    position: relative;
}

.terminal-header {
    background-color: var(--terminal-header);
    padding: 10px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.terminal-buttons {
    display: flex;
    gap: 8px;
    margin-right: 15px;
}

.button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.close {
    background-color: #ff5f56;
}

.minimize {
    background-color: #ffbd2e;
}

.maximize {
    background-color: #27c93f;
}

.terminal-title {
    font-family: 'VT323', monospace;
    color: var(--text-color);
    font-size: 1.2rem;
}

.terminal-content {
    padding: 2rem;
    height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.typing-text .line {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    margin-bottom: 0.5rem;
    font-family: 'VT323', monospace;
    font-size: 1.5rem;
    animation: typing 3.5s steps(40, end);
    text-shadow: var(--text-glow);
}

.typing-text .line:nth-child(2) {
    animation-delay: 1.5s;
}

.typing-text .line:nth-child(3) {
    animation-delay: 3s;
    animation: typing 3.5s steps(40, end);
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

.scanline {
    width: 100%;
    height: 100px;
    z-index: 8;
    background: linear-gradient(
        0deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.05) 10%,
        rgba(0, 0, 0, 0) 100%
    );
    position: absolute;
    bottom: 100%;
    animation: scanline 8s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    0% {
        bottom: 100%;
    }
    80% {
        bottom: 100%;
    }
    100% {
        bottom: 0%;
    }
}

/* Navigation */
nav {
    background-color: var(--nav-bg);
    border-top: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(5px);
    padding: 0.5rem 0;
}

nav ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
}

nav ul li {
    margin: 0 1rem;
    position: relative;
}

nav ul li a {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
    display: inline-block;
    color: var(--text-color);
    transition: all 0.3s ease;
    position: relative;
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--link-hover);
    text-shadow: var(--text-glow);
}

/* Remove brackets effect */
nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--link-hover);
    transition: width 0.3s ease;
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

/* Content Section */
.content-section {
    margin: 3rem 0;
    padding: 2rem;
    background-color: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--secondary-color), var(--accent-color));
    z-index: 1;
}

.glitch-box {
    text-align: center;
    margin-bottom: 2rem;
}

.glitch {
    font-family: 'Press Start 2P', cursive;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    color: var(--heading-color);
    letter-spacing: 3px;
    text-shadow: var(--text-glow);
}

/* Home page styles */
.home-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
}

.profile-pic-container {
    flex: 1;
    min-width: 300px;
    max-width: 350px;
}

.profile-pic-placeholder {
    width: 100%;
    padding-bottom: 100%;
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--terminal-bg);
}

.profile-pic-placeholder span {
    position: absolute;
    font-family: 'VT323', monospace;
    font-size: 1.5rem;
    color: var(--text-color);
}

.home-intro {
    flex: 2;
    min-width: 300px;
}

.home-intro h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.home-intro h4 {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.9rem;
    margin: 1.5rem 0 0.8rem 0;
}

.home-expertise ul {
    margin-left: 1rem;
}

.home-expertise li {
    margin-bottom: 0.5rem;
}

.typewriter {
    overflow: hidden;
    border-right: .15em solid var(--text-color);
    white-space: nowrap;
    letter-spacing: .1em;
    animation: typing 3.5s steps(40, end);
}

.home-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.home-button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--terminal-bg);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7rem;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.home-button:hover {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

:root.dark-mode .home-button:hover {
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.05);
}

/* Footer */
footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

/* Bio page */
.bio-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.bio-section {
    margin-bottom: 1.5rem;
}

.bio-section h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
}

/* Resume page */
.resume-section {
    margin-bottom: 2rem;
}

.resume-heading {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.resume-item {
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
}

.resume-item-title {
    color: var(--secondary-color);
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.resume-item-subtitle {
    color: var(--accent-color);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.resume-item-period {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    opacity: 0.8;
}

.resume-item-description {
    margin-left: 1rem;
}

.resume-item-description li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.resume-item-description li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

/* Skills */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.skill-category {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    background-color: var(--terminal-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

:root.dark-mode .skill-category:hover {
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.07);
}

.skill-category h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.skill-category ul li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.skill-category ul li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-size: 1.2rem;
}

/* Projects page */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem;
    background-color: var(--terminal-bg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--secondary-color), var(--accent-color));
}

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

:root.dark-mode .project-card:hover {
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.07);
}

.project-title {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
}

.project-description {
    margin-bottom: 1rem;
}

.project-link, .thought-link {
    color: var(--secondary-color);
    font-weight: bold;
    transition: all 0.3s ease;
}

.project-link:hover, .thought-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Thoughts page */
.thoughts-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.thought-item {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem;
    background-color: var(--terminal-bg);
    transition: all 0.3s ease;
}

.thought-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

:root.dark-mode .thought-item:hover {
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.07);
}

.thought-title {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
}

.thought-date {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 1rem;
}

.thought-preview {
    margin-bottom: 1rem;
}

/* Project and Thought detail pages */
.detail-header {
    margin-bottom: 2rem;
}

.detail-title {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5rem;
}

.detail-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-date {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

.detail-tags {
    display: flex;
    gap: 0.5rem;
}

.detail-tag {
    background-color: var(--terminal-bg);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
}

.detail-content {
    line-height: 1.8;
}

.detail-content p {
    margin-bottom: 1.5rem;
}

.back-link {
    display: inline-block;
    margin-top: 2rem;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background-color: var(--terminal-bg);
}

/* Contact */
.contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

.contact-item {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
    background-color: var(--terminal-bg);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

:root.dark-mode .contact-item:hover {
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.07);
}

.contact-item .icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.contact-item p {
    word-break: break-word;
}

.contact-item a {
    word-break: break-word;
    display: inline-block;
    max-width: 100%;
}

/* Media Queries */
/* Theme Toggle */
.theme-toggle-container {
    display: flex !important;
    align-items: center;
    margin-left: 1.5rem;
    list-style: none;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0.5rem 0;
}

.theme-toggle {
    position: relative;
    width: 56px;
    height: 28px;
    background-color: var(--toggle-bg);
    border-radius: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    margin-top: 2px;
}

.theme-toggle .icon {
    font-size: 14px;
    color: var(--text-color);
    z-index: 2;
}

.theme-toggle .switch {
    position: absolute;
    left: 2px;
    top: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--toggle-switch);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
    z-index: 3;
}

.theme-toggle.dark .switch {
    transform: translateX(28px);
}

/* Starry background for dark mode */
.stars {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

:root.dark-mode .stars {
    display: block;
}

.star {
    position: absolute;
    background-color: #ffffff;
    border-radius: 50%;
    animation: twinkle 4s infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.1;
    }
    50% {
        opacity: 0.7;
    }
}

@media (max-width: 768px) {
    .terminal-content {
        height: 200px;
    }
    
    .typing-text .line {
        font-size: 1.2rem;
    }
    
    nav {
        padding: 0.5rem 1rem;
    }
    
    nav ul {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    nav ul li {
        margin: 0.3rem 0.5rem;
    }
    
    nav ul li a {
        font-size: 0.7rem;
        padding: 0.3rem 0.5rem;
    }
    
    .glitch {
        font-size: 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .theme-toggle-container {
        margin-left: 0.5rem;
    }
}

/* Profile Picture Styling */
.profile-pic-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-width: 300px;
    max-width: 350px;
}

.profile-pic {
    width: 100%;
    border-radius: 4px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 10px rgba(58, 134, 255, 0.3), 0 0 20px rgba(255, 0, 110, 0.2);
    object-fit: cover;
    transition: all 0.3s ease;
    filter: contrast(1.05);
}

.profile-pic:hover {
    transform: scale(1.02);
    border-color: var(--secondary-color);
    box-shadow: 0 0 15px rgba(255, 0, 110, 0.4), 0 0 30px rgba(58, 134, 255, 0.3);
}