@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500&display=swap');

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

.linux-body {
    font-family: 'Fira Code', monospace;
    background: radial-gradient(circle at top, #111827 0, #020617 45%, #020617 100%);
    color: #e5e7eb;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */

.linux-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(90deg, #0f172a, #111827);
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.8);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-mark {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: conic-gradient(from 180deg, #1793d1, #38bdf8, #e95420, #f97316, #1793d1);
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.8);
}

.topbar-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.os-name {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.os-flavor {
    font-size: 0.7rem;
    color: #9ca3af;
}

.topbar-nav a {
    font-size: 0.8rem;
    text-decoration: none;
    color: #e5e7eb;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: 0.15s ease;
}

.topbar-nav a + a {
    margin-left: 6px;
}

.topbar-nav a:hover {
    border-color: rgba(156, 163, 175, 0.7);
    background: rgba(15, 23, 42, 0.9);
}

/* Desktop */

.desktop {
    flex: 1;
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px 14px;
}

.desktop-icons {
    width: 80px;
    min-width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
}

.desktop-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: radial-gradient(circle at top, rgba(23, 147, 209, 0.35), rgba(15, 23, 42, 0.96));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    color: #e5e7eb;
    font-size: 0.7rem;
    transition: 0.15s ease;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.6);
}

.desktop-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.8);
    border-color: rgba(248, 113, 113, 0.9);
}

.icon-symbol {
    font-size: 1.2rem;
}

.icon-label {
    font-size: 0.7rem;
    text-align: center;
}

.linux-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 0.9fr 1.4fr 1.15fr;
    gap: 12px;
}

/* Panels */

.panel {
    background: radial-gradient(circle at top left, rgba(23, 147, 209, 0.12), rgba(15, 23, 42, 0.98));
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
    padding: 10px;
    display: flex;
    flex-direction: column;
    min-height: 230px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 6px;
    border-bottom: 1px solid rgba(30, 64, 175, 0.5);
    font-size: 0.75rem;
    color: #cbd5f5;
}

.window-dots {
    display: flex;
    gap: 4px;
}

.window-dots .dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #facc15; }
.dot.green { background: #22c55e; }

.panel-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.panel-label {
    font-size: 0.78rem;
    color: #e5e7eb;
}

.file-label {
    font-size: 0.7rem;
    color: #9ca3af;
}

/* Files */

.files-toolbar {
    display: flex;
    gap: 6px;
    margin: 8px 4px 6px;
}

.files-toolbar button {
    flex: 1;
    font-size: 0.7rem;
    padding: 6px 4px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    cursor: pointer;
    transition: 0.15s ease;
}

.files-toolbar button:hover {
    background: linear-gradient(135deg, rgba(23, 147, 209, 0.4), rgba(14, 116, 144, 0.9));
}

.file-list {
    list-style: none;
    margin-top: 4px;
    padding: 2px;
    overflow-y: auto;
    flex: 1;
}

.file-list li {
    padding: 6px 7px;
    font-size: 0.76rem;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: 0.15s ease;
    color: #e5e7eb;
}

.file-list li span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-list li:hover {
    background: rgba(15, 23, 42, 0.9);
}

.file-list li.active {
    background: linear-gradient(90deg, rgba(23, 147, 209, 0.7), rgba(233, 84, 32, 0.75));
}

/* Editor */

.editor-panel {
    min-height: 260px;
}

#file-editor {
    flex: 1;
    margin-top: 8px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.96);
    color: #e5e7eb;
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    padding: 10px;
    resize: none;
    outline: none;
}

#file-editor::placeholder {
    color: #6b7280;
}

/* Terminal */

.terminal-panel {
    min-height: 260px;
}

.terminal-output {
    flex: 1;
    margin-top: 6px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: radial-gradient(circle at top, rgba(15, 118, 110, 0.35), rgba(15, 23, 42, 0.98));
    font-size: 0.78rem;
    overflow-y: auto;
}

.terminal-line {
    margin-bottom: 2px;
}

.terminal-line.system {
    color: #c4b5fd;
}

.terminal-line.command {
    color: #6ee7b7;
}

.terminal-line.error {
    color: #fca5a5;
}

.terminal-input-row {
    display: flex;
    align-items: center;
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: rgba(15, 23, 42, 0.96);
}

.prompt {
    font-size: 0.78rem;
    margin-right: 6px;
    color: #6ee7b7;
}

#terminal-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: #e5e7eb;
    font-size: 0.8rem;
}

/* Rotate overlay */

.rotate-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, #020617, #020617);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 20px;
    text-align: center;
}

.rotate-box {
    max-width: 320px;
    width: 100%;
    border-radius: 18px;
    padding: 18px 16px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: linear-gradient(145deg, #0f172a, #020617);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.9);
}

.rotate-box h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.rotate-box p {
    font-size: 0.9rem;
    color: #e5e7eb;
    margin-bottom: 4px;
}

.rotate-small {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Scrollbars */

.file-list,
.terminal-output {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.7) transparent;
}

.file-list::-webkit-scrollbar,
.terminal-output::-webkit-scrollbar {
    width: 6px;
}

.file-list::-webkit-scrollbar-thumb,
.terminal-output::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.7);
    border-radius: 999px;
}

/* Orientation: phones portrait -> show overlay */

@media (max-width: 900px) and (orientation: portrait) {
    .rotate-overlay {
        display: flex;
    }
    .desktop {
        filter: blur(2px);
        pointer-events: none;
    }
}

/* Orientation: landscape -> hide overlay */

@media (orientation: landscape) {
    .rotate-overlay {
        display: none;
    }
}

/* Landscape mobile tweaks */

@media (max-width: 900px) and (orientation: landscape) {
    .desktop {
        padding: 8px;
        gap: 8px;
    }
    .desktop-icons {
        width: 68px;
    }
    .linux-layout {
        grid-template-columns: 1fr;
        grid-auto-rows: minmax(0, 1fr);
    }
    .panel {
        min-height: 200px;
    }
}

/* Tablet layout */

@media (max-width: 1024px) {
    .linux-layout {
        grid-template-columns: 1.1fr 1.4fr;
        grid-template-rows: minmax(0, 260px) minmax(0, 260px);
        grid-template-areas:
            "files editor"
            "terminal terminal";
    }
    .files-panel { grid-area: files; }
    .editor-panel { grid-area: editor; }
    .terminal-panel { grid-area: terminal; }
}

/* Very small screens */

@media (max-width: 480px) {
    .linux-topbar {
        padding: 8px 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}