/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Dark theme colors (default) */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-color: #4dabf7;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.3);

    /* VS Code colors (dark theme default) */
    --editor-bg: #1e1e1e;
    --editor-header-bg: #2d2d30;
    --editor-line-bg: #1e1e1e;
    --editor-text: #d4d4d4;
    --editor-keyword: #569cd6;
    --editor-string: #ce9178;
    --editor-variable: #9cdcfe;
    --editor-property: #9cdcfe;
    --editor-number: #b5cea8;
    --editor-comment: #6a9955;
    --editor-border: #3c3c3c;
    --control-close: #ff5f56;
    --control-minimize: #ffbd2e;
    --control-maximize: #27ca3f;
}

[data-theme="dark"] {
    /* Dark theme colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-color: #4dabf7;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.3);

    /* VS Code colors for dark theme */
    --editor-bg: #1e1e1e;
    --editor-header-bg: #2d2d30;
    --editor-line-bg: #1e1e1e;
    --editor-text: #d4d4d4;
    --editor-keyword: #569cd6;
    --editor-string: #ce9178;
    --editor-variable: #9cdcfe;
    --editor-property: #9cdcfe;
    --editor-number: #b5cea8;
    --editor-comment: #6a9955;
    --editor-border: #3c3c3c;
}

[data-theme="light"] {
    /* Light theme colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --accent-color: #0074d9;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.1);

    /* VS Code colors for light theme */
    --editor-bg: #ffffff;
    --editor-header-bg: #f3f3f3;
    --editor-line-bg: #ffffff;
    --editor-text: #2c3e50;
    --editor-keyword: #0066cc;
    --editor-string: #d63384;
    --editor-variable: #0066cc;
    --editor-property: #0066cc;
    --editor-number: #28a745;
    --editor-comment: #6c757d;
    --editor-border: #dee2e6;
    --control-close: #ff5f56;
    --control-minimize: #ffbd2e;
    --control-maximize: #27ca3f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Title Bar Styles */
.editor-title-bar {
    background-color: var(--editor-header-bg);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--editor-border);
    height: 48px;
    gap: 16px;
}

.title-bar-text {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none;
}

/* New Navigation Styles */
.editor-nav ul {
    display: flex;
    list-style: none;
    gap: 4px;
    padding: 0;
    margin: 0;
}

.editor-nav a {
    text-decoration: none;
    color: var(--editor-text);
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: block;
}

.editor-nav a:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.editor-nav a.active {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Override/Adjust existing Header styles removal */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 20px;
    /* Reduced from 80px */
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease;
}

/* Theme Toggle in Title Bar */
.theme-toggle-container .theme-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
}

.theme-toggle-container .theme-btn:hover {
    background-color: var(--bg-secondary);
}

.theme-btn svg {
    transition: all 0.3s ease;
    position: absolute;
    /* Both absolute to overlap perfectly */
}

/* Ensure icons are centered */
.sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.moon-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Adjusted Editor Header (Tab Bar) */
.editor-header {
    height: 35px;
    /* Slightly smaller for tab bar feel */
    padding: 0 16px;
    background-color: var(--editor-bg);
    /* Match editor bg or slight contrast */
}

/* Screen Container */
.screen-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.screen-content {
    background-color: var(--editor-bg);
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    min-height: 500px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    transition: transform 0.3s ease-out;
    transform-style: preserve-3d;
}

.screen-texture {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('assets/images/screentexture.jpg');
    background-size: 400px 400px;
    background-repeat: repeat;
    background-position: center;
    opacity: 0.04;
    pointer-events: none;
    z-index: 10;
    transition: transform 0.1s ease-out;
    transform-style: preserve-3d;
}

.screen-content .container {
    position: relative;
    z-index: 1;
    padding: 40px 20px;
}

.hero-content {
    text-align: left;
    max-width: 800px;
    width: 100%;
    margin-left: 0;
    padding-left: 0;
}

/* VS Code Editor */
.code-editor {
    background-color: var(--editor-bg);
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    border: 1px solid var(--editor-border);
}

.editor-header {
    background-color: var(--editor-header-bg);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--editor-border);
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 8px;
    cursor: pointer;
}

.control.close {
    background-color: var(--control-close);
}

.control.minimize {
    background-color: var(--control-minimize);
}

.control.maximize {
    background-color: var(--control-maximize);
}

.file-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--editor-text);
    font-size: 14px;
}

.file-icon {
    font-size: 16px;
}

.file-name {
    font-weight: 500;
}

.editor-content {
    display: flex;
    background-color: var(--editor-line-bg);
    align-items: flex-start;
}

.line-numbers {
    background-color: var(--editor-header-bg);
    padding: 12px 8px;
    border-right: 1px solid var(--editor-border);
    color: var(--editor-text);
    font-size: 14px;
    line-height: 1.4;
    text-align: right;
    min-width: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: fit-content;
}

.line-numbers span {
    display: block;
    opacity: 0.6;
    height: 1.4em;
    line-height: 1.4;
    min-height: 1.4em;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.code-lines {
    padding: 12px 16px;
    flex: 1;
    color: var(--editor-text);
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
}

.code-line {
    margin-bottom: 0;
    white-space: pre;
    line-height: 1.4;
    text-align: left;
    padding-left: 0;
    min-height: 1.4em;
    display: flex;
    align-items: center;
}

/* Syntax highlighting */
.keyword {
    color: var(--editor-keyword);
    font-weight: bold;
}

.string {
    color: var(--editor-string);
}

.variable {
    color: var(--editor-variable);
}

.property {
    color: var(--editor-property);
}

.number {
    color: var(--editor-number);
}

.comment {
    color: var(--editor-comment);
}

.typing-text {
    color: var(--editor-string);
    font-weight: 600;
    position: relative;
    display: inline-block;
    transition: color 0.3s ease;
}

.typing-text::after {
    content: '';
}

/* File Explorer */
.hero-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
    max-width: 1200px;
    width: 100%;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.code-editor {
    flex: 1;
    max-width: 800px;
    transform: translateZ(20px);
    transition: transform 0.3s ease-out;
}

.file-explorer {
    background-color: var(--editor-header-bg);
    border-radius: 20px;
    border: 1px solid var(--editor-border);
    width: 280px;
    min-height: 400px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateZ(40px);
    transition: transform 0.3s ease-out;
}



.explorer-header {
    background-color: var(--editor-bg);
    padding: 12px 16px;
    border-bottom: 1px solid var(--editor-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--editor-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.explorer-content {
    padding: 8px 0;
}

.folder-item {
    margin-bottom: 8px;
}

.folder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: var(--editor-text);
    font-size: 14px;
}

.folder-header:hover {
    background-color: var(--editor-bg);
}

.folder-icon {
    font-size: 16px;
}

.folder-name {
    flex: 1;
    font-weight: 500;
}

.folder-count {
    background-color: var(--editor-border);
    color: var(--editor-text);
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.folder-content {
    margin-left: 16px;
}

.project-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: var(--editor-text);
    font-size: 13px;
}

.project-item:hover {
    background-color: var(--editor-bg);
}

.project-icon {
    font-size: 14px;
    margin-top: 2px;
}

.project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.project-name {
    font-weight: 500;
    color: var(--editor-text);
}

.project-date {
    font-size: 11px;
    color: var(--editor-comment);
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .screen-content {
        margin: 10px;
        border-radius: 10px;
    }

    .screen-content .container {
        padding: 15px;
    }

    .hero-content {
        flex-direction: column;
        gap: 15px;
    }

    .code-editor {
        margin: 0;
        max-width: 100%;
    }

    .file-explorer {
        width: 100%;
        margin: 0;
    }

    .code-lines {
        font-size: 12px;
        padding: 12px;
    }

    .line-numbers {
        font-size: 12px;
        padding: 12px 6px;
        min-width: 35px;
    }

    .nav ul {
        gap: 1rem;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    .theme-toggle {
        margin-left: 0.5rem;
    }
}

@media (max-width: 480px) {
    .code-lines {
        font-size: 11px;
        padding: 8px;
    }

    .line-numbers {
        font-size: 11px;
        padding: 8px 4px;
        min-width: 30px;
    }

    .nav ul {
        gap: 0.5rem;
    }

    .nav a {
        font-size: 0.9rem;
    }

    .theme-btn {
        width: 35px;
        height: 35px;
    }
}

/* Contact Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-container {
    width: 90%;
    max-width: 800px;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* No perspective needed here, flat editor look is fine, or re-use 3d effect if desired */
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.contact-editor {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    /* Override hero specific max-width if needed */
}

.contact-form-content {
    display: flex;
    flex-direction: column;
    /* gap: 8px; Removed gap to align with code lines logic */
    width: 100%;
}

.indent {
    padding-left: 2rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.indent.double {
    padding-left: 4rem;
}

.code-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--editor-comment);
    color: var(--editor-string);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    padding: 0 4px;
    margin-left: 8px;
    width: 250px;
    transition: all 0.3s ease;
}

.code-input:focus {
    outline: none;
    border-bottom-color: var(--accent-color);
    width: 300px;
}

.code-textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--editor-border);
    border-radius: 4px;
    color: var(--editor-text);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    width: 100%;
    max-width: 500px;
    min-height: 100px;
    padding: 8px;
    margin: 8px 0;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.code-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-actions {
    margin-top: 20px;
    padding-left: 2rem;
    display: flex;
    gap: 16px;
}

.submit-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.submit-btn:active {
    transform: translateY(0);
}

/* Make inputs look like code strings */
.code-input::placeholder,
.code-textarea::placeholder {
    color: var(--editor-comment);
    opacity: 0.7;
}

/* Mobile Adjustments for Modal */
@media (max-width: 600px) {
    .indent {
        padding-left: 1rem;
    }

    .indent.double {
        padding-left: 1rem;
    }

    .code-input {
        width: 100%;
        margin-left: 0;
        margin-top: 4px;
    }

    .code-textarea {
        max-width: 100%;
    }
}