/*
Theme Name: CHIMPMODE Download
Theme URI: https://chimpmode.com
Author: CHIMPMODE
Author URI: https://chimpmode.com
Description: A WooCommerce theme disguised as a 2001-2004 era download manager, floating in a Bryce3D surreal environment.
Version: 1.0.0
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: chimpmode-download
Tags: woocommerce, custom, e-commerce, retro

CHIMPMODE Download - File Transfer Style WooCommerce Theme
Authentic 2001-2004 Download Manager Aesthetic
*/

/* ══════════════════════════════════════
   CSS RESET & BASE
   ══════════════════════════════════════ */

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

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: Tahoma, Verdana, 'Trebuchet MS', Geneva, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: #000;
    background: #d4d0c8;
    min-height: 100vh;
}

a {
    color: #0000cc;
    text-decoration: underline;
}

a:hover {
    color: #0000ff;
}

a:active {
    color: #cc0000;
}

img {
    max-width: 100%;
    height: auto;
}

button, input, select, textarea {
    font-family: Tahoma, Verdana, 'Trebuchet MS', Geneva, Arial, sans-serif;
    font-size: 13px;
}

/* ══════════════════════════════════════
   LAYER 1: BACKGROUND WORLD (Bryce3D)
   ══════════════════════════════════════ */

.bryce-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

/* Image background (default) */
.bryce-background .bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Video background */
.bryce-background .bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

/* GIF background */
.bryce-background .bg-gif {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* Background Sizing: Cover (fills screen, may crop) */
.bryce-background.bg-size-cover .bg-image {
    background-size: cover;
}
.bryce-background.bg-size-cover .bg-gif,
.bryce-background.bg-size-cover .bg-video {
    object-fit: cover;
}

/* Background Sizing: Contain (shows full image, may have bars) */
.bryce-background.bg-size-contain .bg-image {
    background-size: contain;
    background-position: center center;
}
.bryce-background.bg-size-contain .bg-gif,
.bryce-background.bg-size-contain .bg-video {
    object-fit: contain;
}

/* Background Sizing: Stretch (fills screen, may distort) */
.bryce-background.bg-size-stretch .bg-image {
    background-size: 100% 100%;
}
.bryce-background.bg-size-stretch .bg-gif,
.bryce-background.bg-size-stretch .bg-video {
    object-fit: fill;
}

/* Optional dark overlay */
.bryce-background .bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    pointer-events: none;
}

/* ══════════════════════════════════════
   LAYER 2: SOFTWARE WINDOW (Classic App)
   ══════════════════════════════════════ */

.software-window {
    position: relative;
    width: 94%;
    max-width: 880px;
    margin: 20px auto;
    min-height: calc(100vh - 40px);
    background: #ece9d8;
    border-radius: 3px;
    border: 1px solid #0054e3;
    box-shadow:
        0 0 0 1px #002d96 inset,
        1px 1px 0 #fff inset,
        -1px -1px 0 #848484 inset,
        2px 2px 8px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════
   HEADER / TITLE BAR (Windows XP Style)
   ══════════════════════════════════════ */

.window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px 4px 10px;
    height: 36px;
    /* Windows XP blue gradient */
    background: linear-gradient(180deg,
        #0a246a 0%,
        #0f3b8c 8%,
        #1456b8 15%,
        #1a6bce 25%,
        #1e7ae0 50%,
        #1a6bce 75%,
        #1456b8 85%,
        #0f3b8c 92%,
        #0a246a 100%);
    border-bottom: 1px solid #0a246a;
    border-radius: 3px 3px 0 0;
    position: relative;
}

/* Gloss strip across titlebar */
.window-header::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 0;
    right: 0;
    height: 12px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.25) 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%);
    pointer-events: none;
}

.window-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.logo-badge:hover {
    text-decoration: none;
}

.logo-icon {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ffe44d 0%, #ffcc00 50%, #e6b800 100%);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 1px solid #996600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.logo-text {
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

.online-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    background: linear-gradient(180deg, #7cd67c 0%, #4db84d 50%, #3da03d 100%);
    border-radius: 2px;
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    border: 1px solid #2d802d;
    text-shadow: 0 1px 0 rgba(0, 80, 0, 0.5);
}

.online-indicator::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #00ff00;
    border-radius: 50%;
    box-shadow: 0 0 3px #00ff00;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 2px #00ff00; }
    50% { box-shadow: 0 0 5px #00ff00; }
}

.window-header-right {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Window control buttons (XP style) */
.header-icon {
    position: relative;
    width: 28px;
    height: 28px;
    background: linear-gradient(180deg,
        #3c8cdc 0%,
        #2878cc 15%,
        #1e68bc 50%,
        #1458a8 85%,
        #0a4898 100%);
    border: 1px solid #0a246a;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.35),
        inset -1px -1px 0 rgba(0, 0, 0, 0.15);
}

.header-icon:hover {
    background: linear-gradient(180deg,
        #5ca8ec 0%,
        #4898dc 15%,
        #3888cc 50%,
        #2878bc 85%,
        #1868ac 100%);
    text-decoration: none;
}

.header-icon:active {
    background: linear-gradient(180deg,
        #1858a8 0%,
        #1e68b8 50%,
        #2478c8 100%);
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.header-icon svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.cart-icon {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(180deg, #ff5050 0%, #cc2020 100%);
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #990000;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ══════════════════════════════════════
   TOOLBAR (Classic App Toolbar)
   ══════════════════════════════════════ */

.window-toolbar {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 6px;
    background: linear-gradient(180deg,
        #ece9d8 0%,
        #d8d4c4 100%);
    border-bottom: 1px solid #9c9a8c;
    box-shadow: inset 0 1px 0 #fff;
}

/* Status Strip in Toolbar */
.window-toolbar.status-strip {
    justify-content: space-between;
    padding: 3px 8px;
    font-size: 12px;
}

.window-toolbar.status-strip .status-left {
    display: flex;
    align-items: center;
    padding: 0 6px;
    background: #fff;
    border: 1px solid #808080;
    border-top-color: #404040;
    border-left-color: #404040;
    height: 18px;
    line-height: 16px;
}

.window-toolbar.status-strip .status-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.window-toolbar.status-strip .transfer-speed {
    font-weight: normal;
}

.window-toolbar.status-strip .speed-value {
    color: #006600;
    font-weight: bold;
}

/* Legacy toolbar buttons (kept for reference) */
.toolbar-btn {
    width: 26px;
    height: 26px;
    background: linear-gradient(180deg, #fff 0%, #ece9d8 50%, #d8d4c4 100%);
    border: 1px solid #808080;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        inset 1px 1px 0 #fff,
        inset -1px -1px 0 #808080;
}

.toolbar-btn:hover {
    background: linear-gradient(180deg, #fff 0%, #f5f3ea 50%, #ece9d8 100%);
    border-color: #0054e3;
}

.toolbar-btn:active {
    background: linear-gradient(180deg, #d8d4c4 0%, #ccc8b8 100%);
    box-shadow:
        inset 1px 1px 2px rgba(0, 0, 0, 0.2),
        inset -1px -1px 0 #fff;
    padding: 1px 0 0 1px;
}

.toolbar-btn svg {
    width: 16px;
    height: 16px;
    fill: #000;
}

/* ══════════════════════════════════════
   MAIN CONTENT AREA
   ══════════════════════════════════════ */

.window-content {
    flex: 1;
    padding: 8px;
    background: #fff;
    border: 1px solid #7f9db9;
    border-top: none;
    margin: 0 4px;
    overflow-y: auto;
}

/* ══════════════════════════════════════
   DOWNLOAD QUEUE LIST (Homepage)
   ══════════════════════════════════════ */

.download-queue {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #7f9db9;
    border: 1px solid #7f9db9;
}

.download-item {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 8px 10px;
    background: #fff;
    border: none;
    border-radius: 0;
}

.download-item:hover {
    background: #e8f0f8;
}

.download-item:nth-child(even) {
    background: #f5f9fc;
}

.download-item:nth-child(even):hover {
    background: #e8f0f8;
}

.download-thumb {
    width: 68px;
    height: 68px;
    border: 1px solid #7f9db9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Slime green background for product visibility */
    background-color: #ADFF2F;
}

.download-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensure transparent parts show the checkered background */
}

.download-thumb .no-image {
    font-size: 20px;
    color: #808080;
}

/* Hover Preview Popup (Desktop only) */
.image-preview-popup {
    position: fixed;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    /* Slime green background for product visibility */
    background-color: #ADFF2F;
    border: 2px solid #0054e3;
    box-shadow:
        0 0 0 1px #002d96 inset,
        4px 4px 12px rgba(0, 0, 0, 0.4);
    padding: 4px;
}

.image-preview-popup.visible {
    opacity: 1;
}

.image-preview-popup img {
    display: block;
    max-width: 220px;
    max-height: 220px;
    width: auto;
    height: auto;
}

/* Hide on mobile/touch devices */
@media (max-width: 1024px), (hover: none) {
    .image-preview-popup {
        display: none !important;
    }
}

.download-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.download-name {
    font-size: 14px;
    font-weight: bold;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-price {
    font-size: 13px;
    font-weight: bold;
    color: #006600;
}

.download-status {
    font-size: 12px;
    color: #666;
}

/* Progress Bar - Classic style */
.download-progress {
    height: 16px;
    background: #fff;
    border: 1px solid #7f9db9;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.download-progress-bar {
    height: 100%;
    background: linear-gradient(180deg,
        #88dd88 0%,
        #44bb44 15%,
        #22aa22 50%,
        #44bb44 85%,
        #88dd88 100%);
    transition: width 0.3s ease;
    position: relative;
}

/* Segmented progress blocks (classic look) */
.download-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 8px,
        rgba(0, 0, 0, 0.08) 8px,
        rgba(0, 0, 0, 0.08) 10px
    );
}

.download-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 110px;
}

/* ══════════════════════════════════════
   BUTTONS (Classic Beveled Style)
   ══════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: normal;
    border-radius: 0;
    cursor: pointer;
    border: 1px solid;
    text-decoration: none;
    white-space: nowrap;
    min-height: 28px;
}

/* Primary Button - Green download style */
.btn-primary,
.download-now-btn {
    background: linear-gradient(180deg,
        #8fe08f 0%,
        #66cc66 15%,
        #44aa44 50%,
        #339933 85%,
        #228822 100%);
    border-color: #006600;
    color: #fff;
    text-shadow: 0 -1px 0 rgba(0, 50, 0, 0.5);
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.35),
        inset -1px -1px 0 rgba(0, 50, 0, 0.25);
}

.btn-primary:hover,
.download-now-btn:hover {
    background: linear-gradient(180deg,
        #9fe89f 0%,
        #77dd77 15%,
        #55bb55 50%,
        #44aa44 85%,
        #339933 100%);
    text-decoration: none;
}

.btn-primary:active,
.download-now-btn:active {
    background: linear-gradient(180deg,
        #339933 0%,
        #44aa44 50%,
        #55bb55 100%);
    box-shadow: inset 1px 1px 2px rgba(0, 50, 0, 0.3);
    padding: 7px 15px 5px 17px;
}

.btn-primary:focus,
.download-now-btn:focus {
    outline: 1px dotted #000;
    outline-offset: -3px;
}

/* Download button states */
.download-now-btn.downloading {
    background: linear-gradient(180deg,
        #88ccff 0%,
        #4499ee 50%,
        #2277cc 100%);
    border-color: #0055aa;
    cursor: wait;
    pointer-events: none;
}

.download-now-btn.complete {
    background: linear-gradient(180deg,
        #8fe08f 0%,
        #44aa44 50%,
        #228822 100%);
    border-color: #006600;
}

/* Button spinner animation */
.btn-spinner {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
    margin-right: 4px;
}

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

/* Download item active state */
.download-item.is-downloading {
    background: #e8f4ff;
}

.download-item.download-complete {
    background: #e8ffe8;
}

/* Progress bar active animation */
.download-progress.active .download-progress-bar {
    background: linear-gradient(180deg,
        #88ccff 0%,
        #4499dd 50%,
        #2277bb 100%);
}

.download-progress.complete .download-progress-bar {
    background: linear-gradient(180deg,
        #88dd88 0%,
        #44bb44 50%,
        #22aa22 100%);
}

/* Secondary Button */
.btn-secondary {
    background: linear-gradient(180deg,
        #fff 0%,
        #ece9d8 50%,
        #d8d4c4 100%);
    border-color: #808080;
    color: #000;
    box-shadow:
        inset 1px 1px 0 #fff,
        inset -1px -1px 0 #808080;
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #fff 0%, #f5f3ea 50%, #ece9d8 100%);
    border-color: #0054e3;
    text-decoration: none;
}

.btn-secondary:active {
    background: linear-gradient(180deg, #d8d4c4 0%, #ccc8b8 100%);
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.2);
    padding: 7px 15px 5px 17px;
}

/* Warning/Orange Button */
.btn-warning {
    background: linear-gradient(180deg,
        #ffcc66 0%,
        #ff9933 50%,
        #e68800 100%);
    border-color: #996600;
    color: #fff;
    text-shadow: 0 -1px 0 rgba(100, 50, 0, 0.5);
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.35),
        inset -1px -1px 0 rgba(100, 50, 0, 0.25);
}

.btn-warning:hover {
    background: linear-gradient(180deg,
        #ffdd88 0%,
        #ffaa44 50%,
        #ff9933 100%);
    text-decoration: none;
}

/* Info/Blue Button */
.btn-info {
    background: linear-gradient(180deg,
        #88ccff 0%,
        #4499ee 50%,
        #2277cc 100%);
    border-color: #0055aa;
    color: #fff;
    text-shadow: 0 -1px 0 rgba(0, 50, 100, 0.5);
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.35),
        inset -1px -1px 0 rgba(0, 50, 100, 0.25);
}

/* ══════════════════════════════════════
   STATUS BADGES
   ══════════════════════════════════════ */

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid;
}

.status-queued {
    background: linear-gradient(180deg, #e8e8e8 0%, #c0c0c0 100%);
    border-color: #808080;
    color: #404040;
}

.status-downloading {
    background: linear-gradient(180deg, #88ccff 0%, #4499dd 100%);
    border-color: #0066aa;
    color: #fff;
    text-shadow: 0 -1px 0 rgba(0, 40, 80, 0.5);
}

.status-complete {
    background: linear-gradient(180deg, #88dd88 0%, #44aa44 100%);
    border-color: #006600;
    color: #fff;
    text-shadow: 0 -1px 0 rgba(0, 50, 0, 0.5);
}

.status-seeding {
    background: linear-gradient(180deg, #ffcc66 0%, #ff9933 100%);
    border-color: #996600;
    color: #fff;
    text-shadow: 0 -1px 0 rgba(80, 40, 0, 0.5);
}

/* ══════════════════════════════════════
   STATUS BAR / FOOTER
   ══════════════════════════════════════ */

.window-statusbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    height: 26px;
    background: #ece9d8;
    border-top: 1px solid #fff;
    font-size: 12px;
    color: #000;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 6px;
    background: #fff;
    border: 1px solid #808080;
    border-top-color: #404040;
    border-left-color: #404040;
    height: 18px;
    line-height: 16px;
}

.status-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.transfer-speed {
    font-weight: normal;
}

.speed-value {
    color: #006600;
    font-weight: bold;
}

/* ══════════════════════════════════════
   88x31 BADGES STRIP
   ══════════════════════════════════════ */

.badges-strip {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px 8px;
    background: #ece9d8;
    border-top: 1px solid #9c9a8c;
    gap: 6px;
    flex-wrap: wrap;
}

.badges-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.badges-strip img {
    width: 88px;
    height: 31px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    border: 1px solid #808080;
}

.badges-strip img:hover {
    border-color: #0054e3;
}

/* CSS-based placeholder badges (88x31 style) */
.css-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 31px;
    font-size: 8px;
    font-weight: bold;
    text-align: center;
    line-height: 1.1;
    text-transform: uppercase;
    border: 1px solid #808080;
}

.css-badge:hover {
    border-color: #0054e3;
}

.badge-free-smileys {
    background: linear-gradient(180deg, #ffee55 0%, #eecc00 100%);
    border-color: #aa9900;
    color: #553300;
}

.badge-best-viewed {
    background: linear-gradient(180deg, #6699ff 0%, #3366cc 100%);
    border-color: #0033aa;
    color: white;
}

.badge-made-with {
    background: linear-gradient(180deg, #b0b0b0 0%, #808080 100%);
    border-color: #505050;
    color: white;
}

.badge-download {
    background: linear-gradient(180deg, #66dd66 0%, #33aa33 100%);
    border-color: #006600;
    color: white;
}

.badge-certified {
    background: linear-gradient(180deg, #ff6666 0%, #cc2222 100%);
    border-color: #990000;
    color: white;
}

/* ══════════════════════════════════════
   EMPTY STATES
   ══════════════════════════════════════ */

.no-downloads,
.woocommerce-not-active {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    text-align: center;
}

.empty-queue-message,
.notice-message {
    padding: 20px;
    background: #fff;
    border: 1px solid #7f9db9;
}

.empty-icon,
.notice-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.empty-queue-message h2,
.notice-message h2 {
    font-size: 12px;
    font-weight: bold;
    color: #000;
    margin-bottom: 4px;
}

.empty-queue-message p,
.notice-message p {
    color: #666;
    font-size: 11px;
}

/* ══════════════════════════════════════
   WOOCOMMERCE OVERRIDES
   ══════════════════════════════════════ */

.woocommerce-content {
    padding: 8px;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 10px 14px;
    margin-bottom: 10px;
    border: 1px solid;
    font-size: 13px;
}

.woocommerce-message {
    background: #e8ffe8;
    border-color: #44aa44;
    color: #006600;
}

.woocommerce-info {
    background: #e8f4ff;
    border-color: #4499dd;
    color: #004488;
}

.woocommerce-error {
    background: #ffe8e8;
    border-color: #dd4444;
    color: #880000;
}

.woocommerce-error li {
    list-style: none;
}

/* ══════════════════════════════════════
   GROUP BOXES (Classic Windows Style)
   ══════════════════════════════════════ */

.group-box {
    border: 1px solid #7f9db9;
    padding: 12px;
    margin-bottom: 12px;
    position: relative;
    background: #fff;
}

.group-box-title {
    position: absolute;
    top: -9px;
    left: 10px;
    background: #fff;
    padding: 0 6px;
    font-size: 13px;
    font-weight: bold;
    color: #003399;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

@media (max-width: 768px) {
    .software-window {
        width: 100%;
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .window-header {
        border-radius: 0;
        padding: 2px 4px;
    }

    .logo-text {
        font-size: 11px;
    }

    .logo-icon {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }

    .online-indicator {
        font-size: 8px;
        padding: 1px 4px;
    }

    .window-content {
        margin: 0 2px;
    }

    /* Mobile: Add clear separation between download items */
    .download-queue {
        gap: 8px;
        background: transparent;
        border: none;
    }

    .download-item {
        grid-template-columns: 60px 1fr;
        grid-template-rows: auto auto;
        gap: 8px;
        padding: 10px;
        border: 1px solid #7f9db9;
        border-radius: 2px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .download-item:nth-child(even) {
        background: #fff;
    }

    /* Mobile: Larger thumbnails that don't crop */
    .download-thumb {
        width: 60px;
        height: 60px;
    }

    .download-thumb img {
        object-fit: contain;
    }

    .download-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        min-width: unset;
        margin-top: 4px;
        padding-top: 8px;
        border-top: 1px dotted #c0c0c0;
    }

    .download-name {
        font-size: 12px;
    }

    .download-price {
        font-size: 12px;
    }

    .btn {
        padding: 4px 12px;
        font-size: 11px;
        min-height: 24px;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 10px;
    }

    .online-indicator {
        display: none;
    }

    /* Smallest screens: Stack layout with large square image */
    .download-item {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .download-thumb {
        width: 85%;
        aspect-ratio: 1 / 1;
        height: auto;
        margin: 0 auto 12px auto;
    }

    .download-thumb img {
        object-fit: contain;
        width: 100%;
        height: 100%;
    }

    .download-info {
        text-align: center;
    }

    .download-name {
        white-space: normal;
        font-size: 14px;
    }

    .download-price {
        font-size: 14px;
    }

    .download-actions {
        flex-direction: column;
        align-items: stretch;
        border-top: 1px dotted #c0c0c0;
        padding-top: 10px;
        margin-top: 8px;
    }

    .status-badge {
        text-align: center;
    }

    .download-now-btn {
        width: 100%;
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ══════════════════════════════════════
   SCROLLBAR STYLING (Classic Windows)
   ══════════════════════════════════════ */

.window-content::-webkit-scrollbar {
    width: 16px;
}

.window-content::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-left: 1px solid #808080;
}

.window-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #fff 0%, #ece9d8 50%, #d8d4c4 100%);
    border: 1px solid #808080;
    border-radius: 0;
}

.window-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #fff 0%, #f0ede0 100%);
}

.window-content::-webkit-scrollbar-button {
    background: linear-gradient(180deg, #fff 0%, #ece9d8 50%, #d8d4c4 100%);
    border: 1px solid #808080;
    height: 16px;
}

/* ══════════════════════════════════════
   AJAX NAVIGATION LOADING STATE
   ══════════════════════════════════════ */

body.ajax-loading .software-window {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

body.ajax-loading .software-window::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #ccc;
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: ajax-spinner 0.8s linear infinite;
}

@keyframes ajax-spinner {
    to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════
   MINI MEDIA PLAYER (iframe wrapper)
   ══════════════════════════════════════ */

.player-wrapper {
    position: fixed;
    z-index: 9999;
    width: 268px;
    height: 100px;
    bottom: 20px;
    left: 20px;
}

.player-wrapper.dragging {
    opacity: 0.9;
    cursor: grabbing;
}

.player-wrapper.minimized {
    height: 24px;
}

.player-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    pointer-events: auto;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .player-wrapper {
        width: 228px;
    }
}
