:root {
    --bg-color: #1e1b18; /* Dark coffee - Terminal Background */
    --desktop-bg: #2d2a2e; /* Dark Grey - Desktop Background */
    --text-color: #dccbb6; /* Beige */
    --accent-color: #ffffff; /* White */
    --link-color: #c0a080; /* Light brown/gold */
    --prompt-color: #8fbc8f; /* Green for prompt */
    --error-color: #cc6666;
    --font-family: 'Fira Code', 'Courier New', monospace;
}

body {
    background-color: var(--desktop-bg);
    background-image: radial-gradient(#3e3b3f 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden; /* Prevent scrolling on the desktop itself */
    line-height: 1.6;
    font-size: 16px;
}

a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--link-color);
}

a:hover {
    background-color: var(--link-color);
    color: var(--bg-color);
}

/* Terminal Window */
.container {
    width: 1000px;
    max-width: 90vw;
    height: 85vh;
    position: absolute;
    top: 7.5%;
    left: 10%;
    background-color: var(--bg-color);
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    border: 1px solid #333;
    transition: width 0.3s, height 0.3s, top 0.3s, left 0.3s, opacity 0.2s;
}

.container.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw;
    border-radius: 0;
}

.container.minimized {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8) translateY(200px);
}

.container.closed {
    display: none;
}

/* Mac-style Title Bar */
.title-bar {
    height: 30px;
    min-height: 30px; /* Force fixed height */
    background-color: #2d2a2e;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    cursor: grab;
    border-bottom: 1px solid #111;
    overflow: hidden; /* Prevent content from expanding height */
    flex-shrink: 0;   /* Prevent shrinking in flex container */
}

.container.maximized .title-bar {
    border-radius: 0;
    cursor: default; /* Disable dragging when maximized */
}

.title-bar:active {
    cursor: grabbing;
}

.buttons {
    display: flex;
    gap: 8px;
}

.button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.button:hover {
    filter: brightness(0.8);
}

.close { background-color: #ff5f56; }
.minimize { background-color: #ffbd2e; }
.maximize { background-color: #27c93f; }

.window-title {
    flex-grow: 1;
    text-align: center;
    font-size: 12px;
    color: #888;
    margin-right: 50px; /* Balance the buttons */
    user-select: none;
}

/* Content Area within Window */
.terminal-content {
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scroll */
    flex-grow: 1;
}

/* Removed old scrollbar styles */
/*
.terminal-content::-webkit-scrollbar {
    width: 8px;
}

.terminal-content::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.terminal-content::-webkit-scrollbar-thumb {
    background-color: #444;
    border-radius: 4px;
}
*/

/* Dock / Taskbar */
.dock {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(45, 42, 46, 0.8);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 16px;
    display: flex;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    z-index: 1000;
}

.dock-item {
    width: 48px;
    height: 48px;
    background-color: #1e1b18;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    position: relative;
    border: 1px solid #444;
}

.dock-item:hover {
    transform: scale(1.1) translateY(-5px);
    background-color: #333;
}

.dock-item.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    width: 4px;
    height: 4px;
    background-color: var(--text-color);
    border-radius: 50%;
}

.dock-icon {
    font-size: 24px;
    color: var(--text-color);
    font-family: monospace;
    font-weight: bold;
}

/* Desktop Icons */
.desktop-icon {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 80px;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 5px;
    color: var(--text-color);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    transition: background-color 0.2s;
}

.desktop-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.icon-img {
    width: 48px;
    height: 48px;
    background-color: #1e1b18;
    border-radius: 8px;
    border: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    font-size: 24px;
    font-family: monospace;
}

.icon-label {
    font-size: 12px;
    text-align: center;
    background-color: rgba(0,0,0,0.3);
    padding: 2px 6px;
    border-radius: 10px;
}

header {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--text-color);
    padding-bottom: 10px;
}

nav ul {
    list-style-type: none;
    padding: 0;
}

nav ul li {
    display: inline;
    margin-right: 20px;
}

nav ul li::before {
    content: "> ";
    color: var(--prompt-color);
}

h1, h2, h3 {
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.prompt {
    color: var(--prompt-color);
    font-weight: bold;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 18px;
    background-color: var(--text-color);
    animation: blink 1s infinite;
    vertical-align: middle;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.blog-post {
    margin-bottom: 40px;
    border-bottom: 1px dashed var(--text-color);
    padding-bottom: 20px;
}

.meta {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 10px;
}

code {
    background-color: #332f2c;
    padding: 2px 5px;
    border-radius: 3px;
}

pre {
    background-color: #332f2c;
    padding: 15px;
    overflow-x: hidden; /* Hide scrollbar since we wrap */
    border: 1px solid var(--text-color);
    white-space: pre-wrap;       /* css-3 */
    white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
    white-space: -pre-wrap;      /* Opera 4-6 */
    white-space: -o-pre-wrap;    /* Opera 7 */
    word-wrap: break-word;       /* Internet Explorer 5.5+ */
}

blockquote {
    border-left: 4px solid var(--link-color);
    margin-left: 0;
    padding-left: 20px;
    color: #aaa;
}

.tags-cloud {
    margin-bottom: 20px;
    padding: 10px;
    border: 1px dotted var(--text-color);
}

.tags-cloud a {
    margin-right: 10px;
    color: var(--prompt-color);
    border-bottom: none;
}

.tags-cloud a:hover, .tags-cloud a.active-tag {
    color: var(--accent-color);
    background-color: transparent;
    text-decoration: underline;
}

.post-tags {
    margin-top: 10px;
    margin-bottom: 10px;
}

.small-tag {
    font-size: 0.85em;
    color: var(--link-color);
    margin-right: 8px;
    border-bottom: none;
    background-color: #332f2c;
    padding: 2px 5px;
    border-radius: 3px;
}

.small-tag:hover {
    background-color: var(--link-color);
    color: var(--bg-color);
}

.tag-filter {
    background-color: #332f2c;
    padding: 5px 10px;
    margin-bottom: 20px;
    border-left: 3px solid var(--prompt-color);
}

/* Responsive Images */
img {
    max-width: 100%;
    height: auto;
    border: 1px solid #444;
    border-radius: 4px;
    display: block;
    margin: 20px 0;
}

/* Ensure text wraps correctly */
.terminal-content, .response, p, li, div {
    overflow-wrap: anywhere; /* Force wrapping for long strings */
    word-wrap: break-word;
    word-break: break-word;
}

/* Hide scrollbars but allow scrolling */
.terminal-content, .terminal-output, pre {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.terminal-content::-webkit-scrollbar,
.terminal-output::-webkit-scrollbar,
pre::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

/* Added for Chat Terminal */
.terminal-output {
    background-color: #1e1b18;
    color: #dccbb6;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Fira Code', 'Courier New', monospace;
    margin-top: 20px;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-height: 500px;
    overflow-y: auto;
}

.input-line {
    display: block;
    position: relative;
    margin-top: 5px;
}

#command-input {
    background: transparent;
    border: none;
    color: #dccbb6;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 16px;
    width: 100%;
    outline: none;
    margin-left: 0;
    padding-left: 0;
    resize: none;
    overflow: hidden;
    min-height: 24px;
    line-height: 1.5;
    box-sizing: border-box;
    display: block;
}

.input-line .prompt {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none; /* Let clicks pass through to textarea */
}

/* Ensure caret is visible */
#command-input {
    caret-color: #dccbb6;
}

/* Copyright Footer */
.copyright {
    position: absolute;
    bottom: 10px;
    right: 20px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
    font-family: var(--font-family);
    user-select: none;
    z-index: 0; /* Behind windows */
}

/* Add a blinking cursor block for empty input if desired, 
   but standard caret is better for real input. 
   Let's just ensure the input area is clear. */
.input-line {
    position: relative;
}
