:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --accent-color: #38bdf8;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-heading: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body, html {
    height: 100%;
    width: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    overflow: hidden;
    position: relative;
}

/* Background animation / decoration */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.topbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 10;
    font-family: var(--font-heading);
}

.logo {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-home {
    color: inherit;
    text-decoration: none;
}

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

.logo .path {
    color: var(--accent-color);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 400;
    border-radius: 6px;
    min-width: 2ch;
    outline: none;
    padding: 0.25rem 0.35rem;
    white-space: nowrap;
}

.logo .path[contenteditable="true"] {
    cursor: text;
}

.logo .path[contenteditable="true"]:focus {
    background: rgba(56, 189, 248, 0.12);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.status {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #94a3b8;
}

.status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
}

.status.saving::before {
    background-color: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
    animation: pulse 1s infinite alternate;
}

.status.error::before {
    background-color: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

@keyframes pulse {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

.editor-container {
    height: 100%;
    width: 100%;
    padding-top: 60px; /* Space for topbar */
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto 1fr;
}

.attachments-panel {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 2rem 0;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.45);
}

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

.attachments-header h2 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
}

.attachments-header p,
.files-empty,
.file-info span {
    color: #94a3b8;
    font-size: 0.78rem;
}

.upload-button,
.download-button {
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 8px;
    color: #e0f2fe;
    cursor: pointer;
    font-size: 0.82rem;
    line-height: 1;
    padding: 0.65rem 0.8rem;
    text-decoration: none;
    white-space: nowrap;
}

.upload-button:hover,
.download-button:hover {
    background: rgba(56, 189, 248, 0.14);
}

.files-list {
    display: grid;
    gap: 0.5rem;
    max-height: 132px;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.file-row {
    align-items: center;
    background: rgba(0, 0, 0, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0.75rem;
}

.file-info {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.file-info strong {
    font-size: 0.86rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    resize: none;
    padding: 2rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-color);
    line-height: 1.6;
    outline: none;
}

textarea::placeholder {
    color: rgba(226, 232, 240, 0.3);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Homepage Styles */
.hidden {
    display: none !important;
}

.home-container {
    height: 100%;
    width: 100%;
    padding-top: 80px;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    font-family: var(--font-heading);
}

.home-container::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%);
    background-size: 100% 4px;
    z-index: 2;
    pointer-events: none;
    opacity: 0.7;
}

.home-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 3;
}

.home-content h1 {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    text-shadow: 4px 4px 0px rgba(0,0,0,0.8), 2px 2px 10px rgba(56, 189, 248, 0.5);
    line-height: 1.5;
    animation: float 3s ease-in-out infinite, pulse-glow 2s infinite alternate;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse-glow {
    from { text-shadow: 4px 4px 0px rgba(0,0,0,0.8), 0px 0px 5px rgba(56, 189, 248, 0.4); }
    to { text-shadow: 4px 4px 0px rgba(0,0,0,0.8), 0px 0px 20px rgba(56, 189, 248, 0.8); }
}

.home-content p {
    font-size: 1.1rem;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.jump-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.jump-box input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
}

.jump-box button {
    background: var(--accent-color);
    color: #0f172a;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.jump-box button:hover {
    transform: translateY(-2px);
    background: #7dd3fc;
}

.install-section {
    margin-bottom: 2rem;
}

.install-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.os-block {
    margin-bottom: 1.5rem;
}

.os-block h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #cbd5e1;
}

.code-box {
    background: #000;
    border: 2px solid #334155;
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: inset 0 0 10px rgba(56, 189, 248, 0.1);
}

.code-box code {
    font-family: var(--font-mono);
    color: #4ade80; /* Retro green */
    white-space: pre-wrap;
    line-height: 1.5;
    text-shadow: 0 0 5px rgba(74, 222, 128, 0.5);
}

.use-examples {
    border-left: 4px solid #10b981;
}

/* Pixel Cat Walking Animation */
.cat-track {
    position: absolute;
    bottom: -10px; /* Ride slightly below or directly on the bottom border */
    left: 0;
    width: 100%;
    height: 10px;
    z-index: 11;
    pointer-events: none;
    margin: 0;
}

.cat {
    position: absolute;
    bottom: 0;
    width: 4px;
    height: 4px;
    background: transparent;
    animation: cat-walk 0.8s steps(2) infinite, cat-move 15s linear infinite;
    transform: scale(1.5);
    transform-origin: bottom left;
}

@keyframes cat-move {
    0% { left: -50px; }
    100% { left: 100%; }
}

@keyframes cat-walk {
  0% { box-shadow: 12px 0px 0 #f97316,
    28px 0px 0 #f97316,
    12px 4px 0 #f97316,
    16px 4px 0 #f97316,
    20px 4px 0 #f97316,
    24px 4px 0 #f97316,
    28px 4px 0 #f97316,
    0px 8px 0 #f97316,
    12px 8px 0 #f97316,
    20px 8px 0 #000000,
    28px 8px 0 #f97316,
    0px 12px 0 #f97316,
    8px 12px 0 #f97316,
    12px 12px 0 #f97316,
    16px 12px 0 #f97316,
    20px 12px 0 #f97316,
    24px 12px 0 #f97316,
    28px 12px 0 #f97316,
    0px 16px 0 #f97316,
    4px 16px 0 #f97316,
    8px 16px 0 #f97316,
    12px 16px 0 #f97316,
    16px 16px 0 #f97316,
    20px 16px 0 #f97316,
    24px 16px 0 #f97316,
    28px 16px 0 #f97316,
    4px 20px 0 #ffffff,
    24px 20px 0 #ffffff; }
  50% { box-shadow: 12px 0px 0 #f97316,
    28px 0px 0 #f97316,
    12px 4px 0 #f97316,
    16px 4px 0 #f97316,
    20px 4px 0 #f97316,
    24px 4px 0 #f97316,
    28px 4px 0 #f97316,
    4px 8px 0 #f97316,
    12px 8px 0 #f97316,
    20px 8px 0 #000000,
    28px 8px 0 #f97316,
    4px 12px 0 #f97316,
    8px 12px 0 #f97316,
    12px 12px 0 #f97316,
    16px 12px 0 #f97316,
    20px 12px 0 #f97316,
    24px 12px 0 #f97316,
    28px 12px 0 #f97316,
    4px 16px 0 #f97316,
    8px 16px 0 #f97316,
    12px 16px 0 #f97316,
    16px 16px 0 #f97316,
    20px 16px 0 #f97316,
    24px 16px 0 #f97316,
    28px 16px 0 #f97316,
    8px 20px 0 #ffffff,
    28px 20px 0 #ffffff; }
}
