:root {
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --text-color: #f8fafc;
    --accent-color: #3b82f6;
    --border-color: #334155;
}

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

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

/* code[class*=language-],
pre[class*=language-] {
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
} */

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 30%;
    background-color: var(--sidebar-bg);
    padding: 2rem;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
    position: relative;
    min-width: 250px;
    max-width: 600px;
}

.resizer {
    width: 5px;
    background-color: var(--border-color);
    cursor: col-resize;
    transition: background-color 0.2s;
}

.resizer:hover,
.resizer.resizing {
    background-color: var(--accent-color);
}

.sidebar header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.sidebar header p {
    color: #94a3b8;
    font-size: 0.875rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.control-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #cbd5e1;
}

textarea {
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: #f8fafc;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 150px;
    outline: none;
    scrollbar-width: thin;
}

#codeInput {
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
}

.site-footer {
    margin-top: 60px;
    padding: 20px 0;
    text-align: center;

    background: #0d0d17;
    /* deep dark like the app background */
    color: #bbb;

    border-top: 1px solid rgba(255, 255, 255, 0.05);

    /* subtle glow on top to match purple theme */
    box-shadow: 0 -8px 30px rgba(200, 0, 255, 0.25);

    font-family: "Inter", "Segoe UI", sans-serif;
}

.site-footer p {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.site-footer a {
    color: #d673ff;
    /* smooth purple highlight */
    text-decoration: none;
    font-weight: 600;
    transition: 0.25s;
}

.site-footer a:hover {
    color: #ffb7ff;
    text-shadow: 0 0 8px rgba(255, 100, 255, 0.8);
}

#titleInput {
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: white;
}

select {
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    color: white;
    width: 100%;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23cbd5e1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

select:focus {
    border-color: var(--accent-color);
    outline: none;
}

textarea:focus {
    border-color: var(--accent-color);
}

.os-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.os-btn {
    background-color: #0f172a;
    border: 1px solid var(--border-color);
    color: #cbd5e1;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.os-btn:hover {
    background-color: #334155;
}

.os-btn.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    background: none;
}

.primary-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: auto;
}

.primary-btn:hover {
    background-color: #2563eb;
}

/* Preview Area */
.preview-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #020617;
    padding: 2rem;
    overflow: auto;
}

.capture-container {
    padding: 4rem;
    background-color: #c084fc;
    /* Default bg */
    display: inline-block;
    min-width: 600px;
}

.window-frame {
    background-color: #1e1e1e;
    /* Editor bg */
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px -10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    min-width: 500px;
}

.window-header {
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    position: relative;
    background-color: #2d2d2d;
}

.window-title {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    color: #9ca3af;
    font-size: 0.8rem;
    pointer-events: none;
}

.window-content {
    padding: 1.5rem;
    background-color: #1e1e1e;
}

pre {
    margin: 0 !important;
    background: transparent !important;
    text-shadow: none !important;
}

code {
    /* font-family: 'Fira Code', monospace !important; */
    font-size: 14px;
    line-height: 1.5;
}

/* --- OS Styles --- */

/* macOS */
.window-mac .window-header {
    background-color: #2d2d2d;
    justify-content: flex-start;
}

.window-mac .window-controls {
    display: flex;
    gap: 8px;
    z-index: 10;
}

.window-mac .control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.window-mac .close {
    background-color: #ff5f56;
}

.window-mac .minimize {
    background-color: #ffbd2e;
}

.window-mac .maximize {
    background-color: #27c93f;
}

/* Windows */
.window-win {
    border-radius: 0;
    border: 1px solid #444;
}

.window-win .window-header {
    background-color: #1e1e1e;
    justify-content: flex-end;
}

.window-win .window-title {
    text-align: left;
    padding-left: 1rem;
}

.window-win .window-controls {
    display: flex;
    gap: 0;
    height: 100%;
    align-items: center;
    z-index: 10;
}

.window-win .control {
    width: 46px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.window-win .control::before {
    content: '';
    display: block;
    border: 1px solid #fff;
}

.window-win .minimize::before {
    width: 10px;
    border-width: 0 0 1px 0;
}

.window-win .maximize::before {
    width: 10px;
    height: 10px;
    border-width: 1px;
}

.window-win .close::before {
    width: 10px;
    height: 10px;
    border: none;
    background: linear-gradient(45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%),
        linear-gradient(-45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%);
}

.window-win .close:hover {
    background-color: #e81123;
}

/* Linux (Ubuntu-ish) */
.window-linux .window-header {
    background-color: #3e3e3e;
    justify-content: flex-end;
}

.window-linux .window-controls {
    display: flex;
    gap: 8px;
    z-index: 10;
}

.window-linux .control {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #555;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 10px;
}

.window-linux .close {
    background-color: #e95420;
}

.window-linux .close::after {
    content: '×';
}

.window-linux .minimize::after {
    content: '−';
}

.window-linux .maximize::after {
    content: '+';
}

/* Windows XP */
.window-xp {
    border-radius: 8px 8px 0 0;
    border: 3px solid #0055ea;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.window-xp .window-header {
    background: linear-gradient(to bottom, #0058ee 0%, #3593ff 4%, #288eff 18%, #127dff 44%, #036dff 100%);
    height: 30px;
    justify-content: flex-end;
    padding-right: 5px;
}

.window-xp .window-title {
    color: white;
    text-shadow: 1px 1px #0f1089;
    font-family: 'Tahoma', sans-serif;
    font-weight: bold;
    text-align: left;
    padding-left: 10px;
    top: 6px;
}

.window-xp .window-controls {
    display: flex;
    gap: 2px;
    z-index: 10;
}

.window-xp .control {
    width: 21px;
    height: 21px;
    border-radius: 3px;
    border: 1px solid #fff;
    background: linear-gradient(to bottom, #fff 0%, #ececec 50%, #dedede 51%, #fff 100%);
    box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: bold;
    font-family: sans-serif;
    font-size: 12px;
}

.window-xp .close {
    background: linear-gradient(to bottom, #e07b79 0%, #e25652 50%, #d6332e 51%, #e65f5b 100%);
    border-color: #fff;
    color: white;
}

.window-xp .close::after {
    content: '×';
}

.window-xp .minimize::after {
    content: '_';
    position: relative;
    top: -3px;
}

.window-xp .maximize::after {
    content: '□';
    font-size: 10px;
}

.window-xp .window-content {
    background-color: #1e1e1e;
    /* Keep dark mode code editor */
}

/* Windows 98 */
.window-win98 {
    border: 2px solid #dfdfdf;
    border-right-color: #404040;
    border-bottom-color: #404040;
    background-color: #c0c0c0;
    padding: 2px;
    box-shadow: 2px 2px 0 #000;
    border-radius: 0;
}

.window-win98 .window-header {
    background: linear-gradient(90deg, #000080, #1084d0);
    height: 24px;
    justify-content: flex-end;
    padding: 2px;
}

.window-win98 .window-title {
    color: white;
    font-family: 'Microsoft Sans Serif', 'Tahoma', sans-serif;
    font-weight: bold;
    font-size: 12px;
    text-align: left;
    padding-left: 4px;
    top: 4px;
}

.window-win98 .window-controls {
    display: flex;
    gap: 2px;
    z-index: 10;
}

.window-win98 .control {
    width: 16px;
    height: 14px;
    background-color: #c0c0c0;
    border: 1px solid #fff;
    border-right-color: #404040;
    border-bottom-color: #404040;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    font-size: 10px;
    font-family: sans-serif;
    font-weight: bold;
}

.window-win98 .close::after {
    content: '×';
}

.window-win98 .minimize::after {
    content: '_';
    position: relative;
    top: -3px;
}

.window-win98 .maximize::after {
    content: '□';
}

.window-win98 .window-content {
    border: 2px solid #808080;
    border-right-color: #fff;
    border-bottom-color: #fff;
    background-color: #1e1e1e;
}

/* Windows 7 */
.window-win7 {
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
    background: rgba(20, 30, 40, 0.85);
    /* Glass approximation */
    backdrop-filter: blur(10px);
    padding: 4px;
}

.window-win7 .window-header {
    background: transparent;
    height: 30px;
    justify-content: flex-end;
}

.window-win7 .window-title {
    color: white;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    text-align: left;
    padding-left: 8px;
    top: 6px;
}

.window-win7 .window-controls {
    display: flex;
    gap: 2px;
    z-index: 10;
    margin-right: -4px;
    margin-top: -4px;
}

.window-win7 .control {
    width: 28px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Segoe UI Symbol', sans-serif;
    font-size: 10px;
    border: 1px solid transparent;
    border-radius: 0 0 4px 4px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
}

.window-win7 .close {
    background: linear-gradient(to bottom, #dbaeb0 0%, #c55e63 49%, #9f181d 50%, #b5383d 100%);
    width: 45px;
    border-color: #7d1a1f;
}

.window-win7 .close:hover {
    background: linear-gradient(to bottom, #eebfc2 0%, #d66f74 49%, #b0292e 50%, #c6494e 100%);
    box-shadow: 0 0 5px #e04343;
}

.window-win7 .close::after {
    content: '×';
    font-size: 14px;
}

.window-win7 .minimize::after {
    content: '_';
    position: relative;
    top: -4px;
}

.window-win7 .maximize::after {
    content: '□';
}

.window-win7 .window-content {
    background-color: #1e1e1e;
    border: 1px solid rgba(0, 0, 0, 0.3);
    margin-top: 2px;
}

/* Windows 11 */
.window-win11 {
    border-radius: 8px;
    border: 1px solid #444;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    background-color: #202020;
}

.window-win11 .window-header {
    background-color: #202020;
    height: 32px;
    justify-content: flex-end;
    border-bottom: 1px solid #333;
}

.window-win11 .window-title {
    color: #fff;
    font-family: 'Segoe UI', sans-serif;
    font-size: 12px;
    text-align: center;
    /* Centered title in Win11 usually, but let's keep consistent */
    top: 8px;
}

.window-win11 .window-controls {
    display: flex;
    height: 100%;
}

.window-win11 .control {
    width: 46px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    transition: background 0.2s;
}

.window-win11 .control:hover {
    background-color: #333;
}

.window-win11 .close:hover {
    background-color: #e81123;
}

.window-win11 .close::after {
    content: '×';
}

.window-win11 .minimize::after {
    content: '−';
}

.window-win11 .maximize::after {
    content: '□';
    font-size: 10px;
}

/* GNOME (Adwaita Dark) */
.window-gnome {
    border-radius: 12px 12px 0 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.window-gnome .window-header {
    background-color: #303030;
    height: 44px;
    justify-content: flex-end;
    border-bottom: 1px solid #1e1e1e;
}

.window-gnome .window-title {
    color: #fff;
    font-family: 'Cantarell', sans-serif;
    font-weight: bold;
    font-size: 14px;
    top: 12px;
}

.window-gnome .window-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 12px;
    z-index: 10;
}

.window-gnome .control {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #454545;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #eee;
    font-size: 12px;
    border: 1px solid #555;
}

.window-gnome .close {
    background-color: #454545;
}

.window-gnome .close:hover {
    background-color: #e01b24;
    border-color: #e01b24;
}

.window-gnome .close::after {
    content: '×';
}

.window-gnome .minimize,
.window-gnome .maximize {
    display: none;
    /* GNOME often hides these by default */
}

/* KDE Plasma (Breeze Dark) */
.window-kde {
    border: 1px solid #3daee9;
    box-shadow: 0 0 10px rgba(61, 174, 233, 0.2);
}

.window-kde .window-header {
    background-color: #31363b;
    height: 30px;
    justify-content: flex-end;
}

.window-kde .window-title {
    color: #eff0f1;
    font-family: 'Noto Sans', sans-serif;
    font-size: 13px;
    top: 6px;
    text-align: center;
}

.window-kde .window-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 5px;
    z-index: 10;
}

.window-kde .control {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #eff0f1;
    font-size: 10px;
}

.window-kde .close {
    background-color: #da4453;
}

.window-kde .close::after {
    content: '×';
}

.window-kde .minimize {
    background-color: transparent;
}

/* Right Sidebar */
/* Right Sidebar Removed */

/* Theme Grid */
.theme-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.scrollable-grid::-webkit-scrollbar {
    width: 6px;
}

.scrollable-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.scrollable-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.scrollable-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.theme-card {
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
    /* overflow: hidden; */
    /* Aspect ratio for card look */
    aspect-ratio: 1 / 0.8;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.theme-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.theme-card.active {
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.theme-preview {
    background-color: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    border-radius: 0.75rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-grow: 1;
    margin-bottom: 1rem;
    position: relative;
}

/* Fake window header for preview */
.theme-preview::before {
    content: '// Just a code example';
    display: block;
    color: #666;
    margin-bottom: 0.5rem;
    font-size: 0.6rem;
}

.theme-name {
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 0.5rem;
    backdrop-filter: blur(2px);
    transition: background-color 0.2s;
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(16px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Prism Line Numbers Override */
.line-numbers .line-numbers-rows {
    border-right: 1px solid #444;
}

.window-kde .maximize {
    background-color: transparent;
}

.window-kde .maximize::after {
    content: '^';
    font-size: 10px;
}

/* Resizer */
.resizer {
    width: 5px;
    background-color: var(--border-color);
    cursor: col-resize;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.resizer:hover,
.resizer.resizing {
    background-color: var(--accent-color);
}