:root {
    --bg-dark: #1e1e1e;
    --bg-sidebar: #252526;
    --bg-activity: #333333;
    --bg-tab: #2d2d2d;
    --bg-tab-active: #1e1e1e;
    --bg-hover: #2a2d2e;
    --color-text: #cccccc;
    --color-text-dim: #858585;
    --color-accent: #007acc;
    --border-color: #3c3c3c;

    /* Syntax Highlighting Colors */
    --syntax-keyword: #569cd6;
    --syntax-string: #ce9178;
    --syntax-function: #dcdcaa;
    --syntax-variable: #9cdcfe;
    --syntax-property: #4fc1ff;
    --syntax-comment: #6a9955;
    --syntax-operator: #d4d4d4;
    
    font-size: 14px;
}

html[data-theme="light"] {
    --bg-dark: #ffffff;
    --bg-sidebar: #f3f3f3;
    --bg-activity: #2c2c2c;
    --bg-tab: #ececec;
    --bg-tab-active: #ffffff;
    --bg-hover: #e8e8e8;
    --color-text: #333333;
    --color-text-dim: #616161;
    --color-accent: #0066b8;
    --border-color: #e4e4e4;

    /* Syntax Highlighting Colors (Light Theme) */
    --syntax-keyword: #0000ff;
    --syntax-string: #a31515;
    --syntax-function: #795e26;
    --syntax-variable: #001080;
    --syntax-property: #0070c1;
    --syntax-comment: #008000;
    --syntax-operator: #000000;
}

html[data-theme="light"] .dynamic-welcome h1,
html[data-theme="light"] .card-link h3 {
    color: #333333;
}

html[data-theme="light"] .primary-card {
    background: linear-gradient(145deg, #f0f8ff 0%, rgba(0,122,204,0.1) 100%);
}

html[data-theme="light"] {
    --active-file-color: var(--color-accent);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--color-text);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Activity Bar */
.activity-bar {
    width: 50px;
    background-color: var(--bg-activity);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    z-index: 10;
}

.activity-icon {
    width: 50px;
    height: 50px;
    background: transparent;
    border: none;
    color: var(--color-text-dim);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: color 0.2s;
    position: relative;
}

.activity-icon:hover {
    color: white;
}

.activity-icon.active {
    color: white;
}

.activity-icon.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background-color: var(--color-accent);
}

.activity-icon i {
    width: 24px;
    height: 24px;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--bg-sidebar);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--color-text-dim);
    letter-spacing: 1px;
}

.sidebar-header i {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
}

.folder-header {
    display: flex;
    align-items: center;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

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

/* Explorer Actions - High Specificity & Hover Logic */
.sidebar-content .folder-header .folder-actions {
    margin-left: auto;
    display: none !important;
    align-items: center;
    gap: 5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.sidebar-content .folder-header:hover .folder-actions {
    display: flex !important;
    opacity: 1;
    pointer-events: auto;
}

.folder-actions i {
    width: 14px;
    height: 14px;
    color: var(--color-text-dim);
}

.folder-actions i:hover {
    color: var(--color-text);
}

.folder-header .chevron {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    transition: transform 0.2s;
}

.folder-header.open .chevron {
    transform: rotate(0deg);
}

.folder-header:not(.open) .chevron {
    transform: rotate(-90deg);
}

.file-list {
    list-style: none;
    margin-left: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 4px 10px 4px 24px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text);
}

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

.file-item.active {
    background-color: var(--bg-hover);
    color: var(--active-file-color, white);
}

.file-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

/* Editor Area */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
    min-width: 0; /* Important for flex-child flex-shrink */
}

/* Mobile Header */
.mobile-header {
    display: none;
    height: 40px;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    padding: 0 10px;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--color-text);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-file-mobile {
    flex: 1;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-dim);
}

/* Tabs */
.editor-tabs {
    display: flex;
    height: 35px;
    background-color: var(--bg-sidebar);
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

.editor-tabs::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

.tab {
    display: flex;
    align-items: center;
    padding: 0 10px;
    background-color: var(--bg-tab);
    color: var(--color-text-dim);
    font-size: 13px;
    cursor: pointer;
    border-right: 1px solid var(--border-color);
    border-top: 1px solid transparent;
    border-bottom: 1px solid var(--border-color);
    min-width: max-content;
}

.tab:hover {
    background-color: var(--bg-hover);
}

.tab.active {
    background-color: var(--bg-tab-active);
    color: var(--color-text);
    border-top: 1px solid var(--color-accent);
    border-bottom: 1px solid transparent; /* matches bg */
}

.tab .tab-close {
    background: none;
    border: none;
    color: inherit;
    margin-left: 8px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab:hover .tab-close,
.tab.active .tab-close {
    opacity: 1;
}

.tab-close i {
    width: 14px;
    height: 14px;
}

.tab-close:hover {
    background-color: rgba(255,255,255,0.1);
    border-radius: 3px;
}

/* Editor Content */
.editor-content-container {
    flex: 1;
    position: relative;
    overflow: auto;
}

.code-page {
    display: none;
    padding: 20px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.6;
    /* Quitamos el height 100% y overflow-y para que el padre mande el scroll */
    min-height: min-content; 
}

.code-page.active {
    display: flex;
    flex-direction: row;
}

.line-numbers {
    padding-right: 20px;
    text-align: right;
    color: var(--color-text-dim);
    user-select: none;
    opacity: 0.5;
}

.code-content {
    flex: 1;
    overflow-x: auto;
}

pre {
    margin: 0;
    font-family: inherit;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Syntax colors */
.keyword { color: var(--syntax-keyword); }
.string { color: var(--syntax-string); }
.function { color: var(--syntax-function); }
.variable { color: var(--syntax-variable); }
.property { color: var(--syntax-property); }
.comment { color: var(--syntax-comment); }
.operator { color: var(--syntax-operator); }
.url-link { color: var(--syntax-string); text-decoration: underline; }

/* Dynamic / Prose Content */
.prose p {
    margin-bottom: 0.5rem;
}

.dynamic-welcome {
    margin-top: 40px;
    padding: 20px;
    border-left: 2px solid var(--color-accent);
    background-color: rgba(0, 122, 204, 0.05);
}

.dynamic-welcome h1 {
    font-family: 'Inter', sans-serif;
    font-size: 3rem;
    color: white;
    margin-bottom: 10px;
}

.dynamic-welcome h3 {
    font-family: 'Fira Code', monospace;
    font-size: 1.2rem;
    color: var(--color-accent);
    font-weight: 400;
}

.cursor {
    display: inline-block;
    width: 12px;
    height: 1.2em;
    background-color: var(--color-accent);
    vertical-align: middle;
    animation: blink 1s step-start infinite;
    margin-left: 5px;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Custom Highlight Cards */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
    font-family: 'Inter', sans-serif;
}

.card-link {
    display: block;
    padding: 20px;
    background-color: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.2s ease;
}

.card-link:hover {
    transform: translateY(-2px);
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.primary-card {
    background: linear-gradient(145deg, rgba(37,37,38,1) 0%, rgba(0,122,204,0.15) 100%);
    border-color: rgba(0, 122, 204, 0.4);
}

.card-link h3 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.card-link p {
    font-size: 0.95rem;
    color: var(--color-text-dim);
    margin-bottom: 15px;
}

.action-text {
    color: var(--color-accent);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Status Bar */
.status-bar {
    height: 22px;
    background-color: var(--color-accent);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    padding: 0 10px;
    z-index: 10;
    user-select: none;
}

.status-left, .status-right {
    display: flex;
    align-items: center;
    height: 100%;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 8px;
    height: 100%;
    cursor: pointer;
    transition: background-color 0.2s;
}

.status-item:hover {
    background-color: rgba(255,255,255,0.2);
}

.status-item i {
    width: 14px;
    height: 14px;
}

/* Git Gutter Indicators */
.git-gutter {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
}

.git-added { background-color: #2ea043; } /* VS Code Green */
.git-modified { background-color: #007acc; } /* VS Code Blue */

.code-line-wrapper {
    position: relative;
    padding-left: 5px;
}

.small-icon {
    width: 14px;
    height: 14px;
}

/* Settings Menu */
.settings-menu {
    display: none;
    position: absolute;
    bottom: 50px;
    left: 40px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1001;
    min-width: 180px;
    padding: 5px 0;
}

.settings-menu.open {
    display: block;
}

.settings-item {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-item:hover {
    background-color: var(--bg-hover);
    color: var(--color-accent);
}

.settings-item.active-theme i {
    color: var(--color-accent);
}

.settings-toggle-mobile {
    background: none;
    border: none;
    color: var(--color-text);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsiveness for Mobile */
@media screen and (max-width: 768px) {
    .activity-bar {
        display: none; /* Hide activity bar on mobile */
    }

    .mobile-header {
        display: flex; /* Show hamburger header */
    }

    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 1000;
        transform: translateX(-100%); /* Hidden by default */
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    }

    .sidebar.open {
        transform: translateX(0); /* Show when open class added */
    }

    /* Add overlay behind sidebar */
    .sidebar-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .hide-mobile {
        display: none !important; /* Force hide on mobile */
    }

    .dynamic-welcome h1 {
        font-size: 2rem;
    }

    .terminal-panel {
        height: 100px; /* Reduced height on mobile */
    }
    
    .settings-toggle-mobile {
        padding: 12px; /* Bigger hit area for touch */
    }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(121, 121, 121, 0.4);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 100, 100, 0.7);
}

html[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(100, 100, 100, 0.2);
}
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 100, 100, 0.4);
}

/* Title Bar */
.title-bar {
    height: 30px;
    background-color: var(--bg-sidebar);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--color-text-dim);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.mac-buttons {
    position: absolute;
    left: 15px;
    display: flex;
    gap: 8px;
}

.mac-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.mac-button.close { background-color: #ff5f56; }
.mac-button.minimize { background-color: #ffbd2e; }
.mac-button.maximize { background-color: #27c93f; }

/* Breadcrumbs */
.breadcrumbs {
    height: 22px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 13px;
    color: var(--color-text-dim);
    background-color: var(--bg-dark);
    flex-shrink: 0;
}
.breadcrumbs .separator {
    margin: 0 5px;
    opacity: 0.5;
}

/* Terminal Panel */
.terminal-panel {
    height: 150px;
    background-color: var(--bg-dark);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    height: 35px;
    font-size: 11px;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.terminal-tabs {
    display: flex;
    gap: 20px;
    height: 100%;
    align-items: center;
}
.terminal-tab {
    cursor: pointer;
    height: 100%;
    display: flex;
    align-items: center;
    border-bottom: 1px solid transparent;
}
.terminal-tab.active {
    color: var(--color-text);
    border-bottom: 1px solid var(--color-accent);
}
.terminal-actions {
    display: flex;
    gap: 10px;
    cursor: pointer;
}
.terminal-actions i:hover { color: var(--color-text); }
.terminal-content {
    flex: 1;
    padding: 10px 15px;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    overflow-y: auto;
}
.terminal-line { margin-bottom: 4px; }
.terminal-prompt { color: var(--syntax-string); font-weight: bold; margin-right: 8px; }
.terminal-success { color: var(--syntax-comment); }

/* Explorer Actions moved to line 177 for better specificity control */

/* reCAPTCHA Visibility Control - Hidden globally as requested */
.grecaptcha-badge { 
    visibility: hidden !important; 
    pointer-events: none !important;
}

/* Contact Form Styles */
.contact-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Fira Code', monospace;
}

.contact-header {
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.vs-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 8px;
}

.form-group label {
    min-width: 200px;
    white-space: nowrap;
    font-size: 14px;
    color: var(--color-text);
    padding-top: 8px;
}

.vs-form input, 
.vs-form textarea {
    flex: 1;
    background: var(--bg-hover);
    border: 1px solid transparent;
    color: var(--syntax-string);
    padding: 8px 12px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.vs-form input:hover, 
.vs-form textarea:hover {
    border: 1px solid var(--border-color);
}

.vs-form input:focus, 
.vs-form textarea:focus {
    background: var(--bg-sidebar);
    border: 1px solid var(--color-accent);
}

.file-upload-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.file-list-preview {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.file-list-preview li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--syntax-string);
}

.file-list-preview li .remove-file {
    color: var(--color-text-dim);
    cursor: pointer;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    padding: 2px;
}

.file-list-preview li .remove-file:hover {
    color: #f48771; /* vscode default red/orange for delete */
}

/* Foolproof hidden file input */
input.file-input-hidden {
    width: 0.1px !important;
    height: 0.1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    z-index: -1 !important;
}

.vs-button-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--color-text);
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.spinning {
    animation: spin 1s linear infinite;
}

.vs-button-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-accent);
}

#file-name {
    font-size: 12px;
    color: var(--syntax-comment);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.recaptcha-group {
    margin: 20px 0;
    padding-left: 200px;
}

.form-actions {
    margin-top: 20px;
    padding-left: 200px;
}

.vs-button {
    background-color: var(--color-accent);
    color: white;
    border: none;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: filter 0.2s;
}

.vs-button:hover {
    filter: brightness(1.2);
}

.contact-footer {
    padding: 10px 0;
    font-size: 14px;
    color: var(--color-text-dim);
}

.recaptcha-legal {
    font-size: 11px;
    color: var(--syntax-comment);
    margin-top: 25px;
    line-height: 1.6;
    padding-left: 200px;
}

.recaptcha-legal a {
    color: var(--syntax-comment);
    text-decoration: underline;
    opacity: 0.8;
}

.recaptcha-legal a:hover {
    opacity: 1;
    color: var(--color-accent);
}

@media screen and (max-width: 768px) {
    .recaptcha-legal {
        padding-left: 0;
    }
}

@media screen and (max-width: 768px) {
    .form-group {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }
    .form-group label {
        min-width: unset;
        padding-top: 0;
        font-size: 12px;
    }
    .recaptcha-group, .form-actions {
        padding-left: 0;
    }
}
