/*
Theme Name: Desktop Environment
Theme URI: https://example.com
Author: Custom Theme
Author URI: https://example.com
Description: A dark-themed WordPress site with a desktop environment interface featuring CDE-style windows
Version: 1.0.3
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: desktop-env
*/

/* =================================================================
   BASE STYLES
   ================================================================= */

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

html {
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f1425 100%);
    color: #e0e0e0;
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* =================================================================
   DESKTOP CONTAINER
   ================================================================= */

#desktop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: calc(100vh - 48px);
    overflow: hidden;
}

/* =================================================================
   TASKBAR
   ================================================================= */

#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(to bottom, #2a3f5f 0%, #1a2a3f 100%);
    border-top: 2px solid #4a5f7f;
    display: flex;
    align-items: center;
    padding: 0 8px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

/* Start Button */
#start-button {
    background: linear-gradient(to bottom, #3a5f8f 0%, #2a4f7f 100%);
    border: 2px outset #4a6f9f;
    color: #ffffff;
    padding: 8px 20px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    transition: all 0.1s;
    margin-right: 8px;
}

#start-button:hover {
    background: linear-gradient(to bottom, #4a6f9f 0%, #3a5f8f 100%);
}

#start-button:active {
    border-style: inset;
    background: linear-gradient(to bottom, #2a4f7f 0%, #3a5f8f 100%);
}

/* Taskbar Icons */
#taskbar-icons {
    display: flex;
    gap: 4px;
    flex: 1;
}

.taskbar-icon {
    background: linear-gradient(to bottom, #3a5f8f 0%, #2a4f7f 100%);
    border: 2px outset #4a6f9f;
    color: white;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 12px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.taskbar-icon:hover {
    background: linear-gradient(to bottom, #4a6f9f 0%, #3a5f8f 100%);
}

.taskbar-icon.active {
    border-style: inset;
    background: linear-gradient(to bottom, #2a4f7f 0%, #3a5f8f 100%);
}

/* Taskbar Clock */
#taskbar-clock {
    margin-left: auto;
    padding: 0 12px;
    font-size: 16px;
    color: #ffffff;
    font-weight: bold;
    font-family: monospace;
    user-select: none;
}

/* =================================================================
   START MENU
   ================================================================= */

#start-menu {
    position: fixed;
    bottom: 52px;
    left: 8px;
    width: 280px;
    background: #2a3f5f;
    border: 2px outset #4a5f7f;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.6);
    display: none;
    z-index: 10000;
}

#start-menu.active {
    display: block;
}

.menu-header {
    background: linear-gradient(to right, #1a4f8f 0%, #2a5f9f 100%);
    color: white;
    padding: 12px;
    font-weight: bold;
    border-bottom: 2px solid #4a5f7f;
}

.menu-items {
    padding: 4px;
}

.menu-item {
    padding: 10px 12px;
    cursor: pointer;
    color: #e0e0e0;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-item:hover {
    background: #3a5f8f;
    border: 1px solid #5a7f9f;
}

/* =================================================================
   WINDOW STYLES - CDE INSPIRED
   ================================================================= */

.window {
    position: absolute;
    background: #2a3f5f;
    border: 3px outset #4a6f9f;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    min-width: 300px;
    min-height: 200px;
    z-index: 100;
}

.window.active {
    z-index: 1000;
    border-color: #5a7faf;
}

.window.minimized {
    display: none;
}

.window.maximized {
    border: none;
    box-shadow: none;
}

/* Window Title Bar */
.window-titlebar {
    background: linear-gradient(to bottom, #3a5f8f 0%, #2a4f7f 100%);
    border-bottom: 2px solid #1a3f6f;
    padding: 4px;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.window.active .window-titlebar {
    background: linear-gradient(to bottom, #4a6f9f 0%, #3a5f8f 100%);
}

.window-title {
    color: white;
    font-weight: bold;
    font-size: 13px;
    padding: 4px 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    flex: 1;
}

/* Window Buttons */
.window-buttons {
    display: flex;
    gap: 2px;
}

.window-button {
    width: 24px;
    height: 24px;
    background: linear-gradient(to bottom, #5a7f9f 0%, #4a6f8f 100%);
    border: 2px outset #6a8faf;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 11px;
}

.window-button:hover {
    background: linear-gradient(to bottom, #6a8faf 0%, #5a7f9f 100%);
}

.window-button:active {
    border-style: inset;
}

/* Resize Handle */
.window-resize {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 0%, transparent 50%, #4a6f8f 50%, #4a6f8f 100%);
}

/* =================================================================
   WINDOW CONTENT
   ================================================================= */

.window-content {
    flex: 1;
    overflow: auto;
    background: #1a2a3f;
    padding: 16px;
    color: #e0e0e0;
}

/* Typography */
.window-content h1,
.window-content h2,
.window-content h3 {
    color: #7fadff;
    margin-bottom: 12px;
}

.window-content p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.window-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 18px 0;
    border: 1px solid #2a3f5f;
}

/* Lists */
.window-content ul,
.window-content ol {
    margin: 12px 0 12px 22px;
    padding-left: 18px;
    list-style-position: outside;
}

.window-content li {
    margin-bottom: 8px;
    line-height: 1.6;
    padding-left: 4px;
}

.window-content li::marker {
    color: #7fadff;
}

/* Bold text */
.window-content strong,
.window-content b {
    color: #00ff88;
    font-weight: 600;
}

/* Blockquotes */
.window-content blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 4px solid #5a9fff;
    background: rgba(42, 63, 95, 0.4);
    color: #cfd8ff;
    font-style: italic;
}

/* Code */
.window-content code {
    background: #0f1425;
    padding: 2px 6px;
    border: 1px solid #2a3f5f;
    border-radius: 3px;
    color: #00ff88;
    font-family: monospace;
    font-size: 0.95em;
}

.window-content pre {
    background: #0a0e27;
    padding: 14px;
    margin: 16px 0;
    border: 2px inset #2a3f5f;
    overflow-x: auto;
}

.window-content pre code {
    background: transparent;
    padding: 0;
    border: none;
}

/* Links - Exclude Meow Gallery elements */
.window-content a:not([class*="meow-"]):not(.meow-gallery *) {
    color: #5a9fff;
    text-decoration: none;
}

.window-content a:not([class*="meow-"]):not(.meow-gallery *):hover {
    text-decoration: underline;
}

/* Scrollbar Styling */
.window-content::-webkit-scrollbar {
    width: 16px;
}

.window-content::-webkit-scrollbar-track {
    background: #1a2a3f;
    border: 1px inset #2a3f5f;
}

.window-content::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #3a5f8f 0%, #2a4f7f 100%);
    border: 2px outset #4a6f9f;
}

.window-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #4a6f9f 0%, #3a5f8f 100%);
}

/* =================================================================
   TERMINAL STYLES
   ================================================================= */

.terminal {
    width: 100%;
    max-width: 100%;
    height: 285px;
    background: #000;
    border: 2px inset #3a5f8f;
    padding: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    font-family: monospace;
}

#terminal-output {
    margin: 0;
    height: 100%;
    overflow-y: auto;
    white-space: pre;
    color: #00ff88;
}

.blink {
    display: inline-block;
    width: 10px;
    animation: blink 1s steps(2, start) infinite;
    color: #00ff00;
}

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

/* =================================================================
   LOADING SCREEN
   ================================================================= */

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0e27;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.5s;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: #7fadff;
}

.spinner {
    border: 4px solid #2a3f5f;
    border-top: 4px solid #5a9fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* =================================================================
   MEOW GALLERY STYLES
   ================================================================= */

/* Main gallery container */
.meow-gallery,
.mgl-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
    padding: 0;
}

/* Gallery items */
.meow-gallery-item,
.mgl-item {
    border: 2px inset #2a3f5f;
    overflow: hidden;
    background: #1a2a3f;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.meow-gallery-item:hover,
.mgl-item:hover {
    transform: scale(1.02);
    border-color: #4a6f9f;
}

.meow-gallery-item img,
.mgl-item img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    border: none;
}

/* Gallery link styling - override default link styles */
.meow-gallery a,
.mgl-gallery a {
    display: block;
    text-decoration: none;
}

/* Masonry layout support */
.meow-gallery.masonry,
.mgl-gallery.masonry {
    grid-auto-rows: 10px;
}

.meow-gallery.masonry .meow-gallery-item,
.mgl-gallery.masonry .mgl-item {
    grid-row-end: span 20;
}

/* Grid layout variations */
.meow-gallery.columns-2 { grid-template-columns: repeat(2, 1fr); }
.meow-gallery.columns-3 { grid-template-columns: repeat(3, 1fr); }
.meow-gallery.columns-4 { grid-template-columns: repeat(4, 1fr); }
.meow-gallery.columns-5 { grid-template-columns: repeat(5, 1fr); }

/* Justified layout */
.meow-gallery.justified {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.meow-gallery.justified .meow-gallery-item {
    flex-grow: 1;
    height: 200px;
}

.meow-gallery.justified .meow-gallery-item img {
    height: 100%;
    width: auto;
    object-fit: cover;
}

/* Caption styling */
.meow-gallery-caption,
.mgl-caption {
    padding: 8px;
    background: #2a3f5f;
    color: #e0e0e0;
    font-size: 12px;
    text-align: center;
}

/* =================================================================
   UTILITY CLASSES
   ================================================================= */

.table-wrapper {
    height: 700px;
    overflow-y: auto;
}

/* Blog post list spacing */
.posts-list {
    margin-top: 20px;
}

/* =================================================================
   RESPONSIVE ADJUSTMENTS
   ================================================================= */

@media (max-width: 768px) {
    /* Mobile styles would go here if needed */
    body.mobile-mode {
        /* Mobile-specific styles */
    }
}

