:root {
    --bg-color: #120a1f;
    --bg-lighter: #1e1330;
    --text-color: #e0d4f7;
    --text-muted: #a891c2;
    --primary-color: #b388ff;
    --primary-dim: #6f42c1;
    --accent-color: #da7cff;
    --accent-dim: #9c42aa;
    --success-color: #9fffcb;
    --error-color: #ff5c8a;
    --border-color: #3a2b4f;

    /* Terminal specifics */
    --terminal-font: 'JetBrains Mono', monospace;
    --content-font: 'Roboto', sans-serif;
    --prompt-color: #c08cff;
    --command-color: #da7cff;
    --response-color: #e0d4f7;
    
    /* Component dimensions */
    --header-height: 70px;
    --terminal-border-radius: 10px;
    --section-spacing: 2.5rem;
}

/* Light theme variables */
.light-theme {
    --bg-color: #f4f0fb;
    --bg-lighter: #ffffff;
    --text-color: #3b2a4c;
    --text-muted: #7a668a;
    --primary-color: #9b5de5;
    --primary-dim: #c09dff;
    --accent-color: #d67fff;
    --accent-dim: #f0b3ff;
    --border-color: #dbcce8;
    --prompt-color: #9b5de5;
    --command-color: #d67fff;
    --response-color: #3b2a4c;
}


/* Theme transition */
.theme-transitioning {
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--content-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

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

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
    height: auto;
}

button, .btn {
    cursor: pointer;
}

/* Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Terminal Startup Animation */
#terminal-startup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

#terminal-startup.fade-out {
    opacity: 0;
}

.startup-content {
    font-family: var(--terminal-font);
    color: var(--success-color);
    font-size: 1rem;
    line-height: 1.4;
    padding: 1rem;
    max-width: 600px;
    white-space: pre-line;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(15, 17, 26, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
    padding-top: 15px;
}

.light-theme header {
    background-color: rgba(240, 242, 245, 0.9);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-family: var(--terminal-font);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    position: relative;
    transition: color 0.3s ease, transform 0.3s ease;
}

.logo:hover {
    color: var(--accent-color);
}

/* Logo glitch effect */
.logo.glitch {
    animation: glitch 0.2s linear;
    color: var(--accent-color);
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 2px); color: #00ffff; }
    40% { transform: translate(3px, -2px); color: #ff00ff; }
    60% { transform: translate(-3px, -2px); color: #ffff00; }
    80% { transform: translate(3px, 2px); color: #00ff00; }
    100% { transform: translate(0); }
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

nav a {
    font-family: var(--terminal-font);
    color: var(--text-color);
    font-size: 1rem;
    text-transform: lowercase;
    transition: color 0.3s ease, border-color 0.3s ease;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

nav a:hover, nav a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* Menu toggle for mobile */
.menu-toggle {
    display: none;
}

/* Main Content */
main {
    padding-top: calc(var(--header-height) + 2rem);
    padding-bottom: 2rem;
}

/* Terminal Sections */
.terminal-section {
    background-color: var(--bg-lighter);
    border-radius: var(--terminal-border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: var(--section-spacing);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease;
}

.terminal-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.terminal-focused {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2), 0 10px 20px rgba(0, 0, 0, 0.15);
}

.terminal-maximized {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    z-index: 90;
    border-radius: 0;
    transform: none;
    transition: all 0.3s ease;
}

.terminal-closing {
    animation: closeTerminal 0.3s forwards;
}

@keyframes closeTerminal {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0.7; transform: scale(0.97); }
}

/* Terminal Header */
.terminal-header {
    background-color: var(--bg-color);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    user-select: none;
    position: relative;
    transition: background-color 0.3s ease;
}

.header-hover {
    background-color: rgba(45, 51, 67, 0.7);
}

.light-theme .header-hover {
    background-color: rgba(240, 242, 245, 0.7);
}

.terminal-controls {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.dot:hover {
    transform: scale(1.2);
}

.dot.red {
    background-color: #ff5f56;
    cursor: pointer;
}

.dot.yellow {
    background-color: #ffbd2e;
}

.dot.green {
    background-color: #27c93f;
}

.terminal-title {
    margin-left: 1rem;
    font-family: var(--terminal-font);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Terminal Content */
.terminal-content {
    padding: 1.5rem;
    font-family: var(--terminal-font);
}

/* Terminal Lines */
.terminal-line {
    margin-bottom: 1rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.prompt {
    color: var(--prompt-color);
    margin-right: 0.5rem;
    font-weight: 700;
}

.command {
    color: var(--command-color);
    position: relative;
}

.command-highlight {
    animation: highlightCommand 0.5s ease;
}

@keyframes highlightCommand {
    0% { color: var(--command-color); }
    50% { color: var(--accent-color); background-color: rgba(240, 136, 62, 0.2); }
    100% { color: var(--command-color); }
}

/* Terminal Response */
.terminal-response {
    margin-bottom: 1.5rem;
    color: var(--response-color);
    padding-left: 0.5rem;
    border-left: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.terminal-response:hover {
    border-left-color: var(--primary-dim);
}

/* Typing Effect */
.typing-effect::after {
    content: '|';
    animation: blink 1s infinite;
}

.cursor-blink::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.typing-done::after {
    animation: none;
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-family: var(--terminal-font);
    font-weight: 700;
    transition: all 0.3s ease;
    text-align: center;
    border: none;
    outline: none;
    cursor: pointer;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.primary-btn:hover {
    background-color: var(--primary-dim);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
    color: var(--bg-color);
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: rgba(88, 166, 255, 0.1);
    transform: translateY(-2px);
    color: var(--primary-color);
}

/* Experience Section */
.experience-list {
    display: grid;
    gap: 1.5rem;
}

.experience-item {
    padding: 1rem;
    background-color: rgba(45, 51, 67, 0.3);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.light-theme .experience-item {
    background-color: rgba(240, 242, 245, 0.5);
}

.experience-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.timeline {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Skills Section */
.skills-category {
    margin-bottom: 2rem;
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    list-style: none;
    padding: 0;
}

.skills-list li {
    padding: 0.5rem 1rem;
    background-color: rgba(45, 51, 67, 0.3);
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    cursor: default;
}

.light-theme .skills-list li {
    background-color: rgba(240, 242, 245, 0.5);
}

.skills-list li:hover {
    background-color: var(--primary-dim);
    color: #ffffff;
    transform: translateY(-3px);
}

.skill-hover {
    animation: skillPulse 1s infinite alternate;
}

@keyframes skillPulse {
    0% { transform: translateY(-3px); }
    100% { transform: translateY(-6px); }
}

/* Projects Section (continued) */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background-color: rgba(45, 51, 67, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.light-theme .project-card {
    background-color: rgba(240, 242, 245, 0.5);
}

.project-card.fade-in {
    animation: fadeInUp 0.5s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-dim);
}

.project-card.active {
    border-color: var(--primary-color);
    background-color: rgba(88, 166, 255, 0.05);
}

.project-card.expanded {
    transform: scale(1.02);
    z-index: 5;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-title {
    margin: 0;
    font-size: 1.3rem;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.project-links {
    display: flex;
    gap: 0.5rem;
}

.project-link {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: underline;
}

.project-link:hover {
    color: var(--primary-color);
}

.project-tech {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    font-family: var(--terminal-font);
}

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

.project-expanded-content {
    height: 0;
    overflow: hidden;
    opacity: 0;
    transition: height 0.5s ease, opacity 0.3s ease;
}

.project-card.expanded .project-expanded-content {
    height: auto;
    opacity: 1;
    padding-top: 1rem;
}

.project-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--terminal-font);
    transition: color 0.3s ease;
}

.input-focused label {
    color: var(--primary-color);
}

.input-valid label {
    color: var(--success-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: rgba(45, 51, 67, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    font-family: var(--terminal-font);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.light-theme .form-group input,
.light-theme .form-group textarea {
    background-color: rgba(240, 242, 245, 0.5);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
    background-color: rgba(45, 51, 67, 0.5);
}

.light-theme .form-group input:focus,
.light-theme .form-group textarea:focus {
    background-color: rgba(240, 242, 245, 0.8);
}

.submit-btn {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: var(--terminal-font);
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.submit-btn:hover {
    background-color: var(--primary-dim);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.4);
}

.form-progress {
    height: 3px;
    background-color: var(--primary-color);
    width: 0;
    transition: width 0.3s ease;
    margin-top: 0.5rem;
    border-radius: 3px;
}

.typing-command {
    font-family: var(--terminal-font);
    color: var(--command-color);
    position: relative;
    margin-left: 0.5rem;
}

.typing-command::after {
    content: '|';
    animation: blink 1s infinite;
}

/* Form Message */
.form-message {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: var(--terminal-font);
}

.form-message.error {
    background-color: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff3333;
    color: #ff3333;
}

.form-message.success {
    background-color: rgba(0, 255, 0, 0.1);
    border: 1px solid #00cc00;
    color: #00cc00;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.social-link {
    font-family: var(--terminal-font);
    padding: 0.5rem 1rem;
    background-color: rgba(45, 51, 67, 0.3);
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.light-theme .social-link {
    background-color: rgba(240, 242, 245, 0.5);
}

.social-link:hover {
    background-color: var(--primary-dim);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
    padding: 2rem 0;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-family: var(--terminal-font);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Command Line Interface */
.command-line {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    z-index: 90;
    transition: transform 0.5s ease;
    max-height: 30vh;
    overflow-y: auto;
}

.command-line-hidden {
    transform: translateY(100%);
}

.command-prompt {
    display: flex;
    align-items: center;
    font-family: var(--terminal-font);
    margin-bottom: 0.5rem;
}

#command-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--command-color);
    font-family: var(--terminal-font);
    font-size: 1rem;
    padding: 0.5rem;
    outline: none;
}

.command-response {
    font-family: var(--terminal-font);
    color: var(--text-color);
    padding: 0.5rem;
    border-left: 2px solid var(--primary-dim);
    margin-left: 1rem;
    margin-bottom: 0.5rem;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px;
    background-color: rgba(10, 10, 20, 0.8);
    border: 1px solid var(--primary-dim);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 999;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.light-theme .theme-toggle {
    background-color: rgba(240, 240, 255, 0.8);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(45deg);
}

.theme-icon {
    line-height: 1;
    display: block;
}

/* Reopen Button */
.reopen-btn {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 0.5rem 0.75rem;
    font-family: var(--terminal-font);
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reopen-btn:hover {
    background-color: var(--primary-dim);
    transform: translateY(-2px);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.7rem;
    }
    
    .menu-toggle {
        display: block;
        background-color: transparent;
        border: none;
        color: var(--primary-color);
        font-size: 1.5rem;
        cursor: pointer;
        transition: transform 0.3s ease;
    }
    
    .terminal-section {
        margin-left: 1rem;
        margin-right: 1rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .skills-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .terminal-content {
        padding: 1rem;
    }
    
    .command-line {
        padding: 0.75rem;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .terminal-line {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .prompt {
        margin-bottom: 0.25rem;
    }
    
    .skills-list {
        grid-template-columns: 1fr;
    }
    
    .terminal-header {
        padding: 0.5rem;
    }
    
    .dot {
        width: 10px;
        height: 10px;
    }
    
    .theme-toggle {
        bottom: 10px;
        right: 10px;
        font-size: 1.2rem;
    }
    
    .terminal-section {
        margin-bottom: 1.5rem;
    }
}

/* Animation for section content */
@keyframes fadeInSection {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.terminal-animated {
    animation: fadeInSection 0.5s forwards;
}

/* Animation for terminal grabbing */
.terminal-grabbing {
    cursor: grabbing;
    user-select: none;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-dim);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Selection Styles */
::selection {
    background-color: var(--primary-dim);
    color: #ffffff;
}