/* Amiga Workbench 1.3 Theme for panayotis.com */

/* ========================================
   FONTS
   ======================================== */
@font-face {
    font-family: 'Topaz';
    src: url('amiga/fonts/Topaz_a500_v1.0.eot');
    src: url('amiga/fonts/Topaz_a500_v1.0.eot?#iefix') format('embedded-opentype'),
         url('amiga/fonts/Topaz_a500_v1.0.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* ========================================
   CSS VARIABLES - Workbench 1.3 Palette
   ======================================== */
:root {
    --wb-blue: #0055AA;
    --wb-orange: #FF8800;
    --wb-white: #FFFFFF;
    --wb-black: #000000;

    /* Derived colors */
    --wb-blue-light: #0066CC;
    --wb-orange-dark: #CC6600;

    /* Layout dimensions */
    --disk-sidebar-width: 100px;
    --window-min-height: 60px;
    --titlebar-height: 20px;
    --gadget-size: 18px;
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Topaz', 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.4;
    background-color: var(--wb-blue);
    color: var(--wb-white);
    padding: 4px 16px;
    cursor: url('amiga/cursor.png'), auto;
    /* Solid blue background like authentic Workbench */
}

/* Use Amiga cursor everywhere (no pointer hand) */
a, button, [role="button"], .wb-disk-icon, .wb-drawer-icon, .wb-app-icon, .wb-gadget-close {
    cursor: url('amiga/cursor.png'), auto;
}

/* Content text uses readable font */
.wb-content-text {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

/* ========================================
   MAIN LAYOUT - Two Column
   ======================================== */
.wb-desktop {
    display: flex;
    min-height: calc(100vh - var(--titlebar-height) - 8px);
}

/* ========================================
   MAIN TITLE BAR (Top of screen)
   ======================================== */
.wb-screen-titlebar {
    height: var(--titlebar-height);
    background: var(--wb-white);
    border-bottom: 1px solid var(--wb-black);
    display: flex;
    align-items: center;
    padding: 0 4px;
}

.wb-screen-title {
    color: var(--wb-black);
    font-size: 14px;
    white-space: nowrap;
}

.wb-screen-gadgets {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

.wb-screen-gadget-back {
    width: 23px;
    height: 20px;
    background: url('amiga/window/button_down.png') no-repeat center;
    background-size: contain;
    image-rendering: pixelated;
}

.wb-screen-gadget-front {
    width: 23px;
    height: 20px;
    background: url('amiga/window/button_up.png') no-repeat center;
    background-size: contain;
    image-rendering: pixelated;
}

/* ========================================
   DISK SIDEBAR (Left column)
   ======================================== */
.wb-disk-sidebar {
    width: var(--disk-sidebar-width);
    flex-shrink: 0;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-left: 8px;
}

.wb-disk-icon {
    display: block;
    text-align: center;
    text-decoration: none;
    color: var(--wb-white);
    font-size: 0;
    line-height: 0;
    padding-bottom: 1px;
}

.wb-disk-icon img {
    display: block;
    margin: 0 auto 4px;
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
}

.wb-disk-icon span {
    font-size: 14px;
    color: var(--wb-white);
    text-shadow: 1px 1px 0 var(--wb-black);
    padding: 0 1px;
    display: inline;
    line-height: 1.2;
    box-shadow: 0 0 0 2px transparent;
}

/* Common icon selected effects (disk and drawer) - handled by JavaScript for images */
.wb-disk-icon.selected span,
.wb-drawer-icon.selected span,
.wb-app-icon.selected span {
    background: var(--wb-white);
    color: var(--wb-blue);
    text-shadow: none;
    padding: 0 1px;
    box-shadow: 0 0 0 2px var(--wb-white);
}

/* ========================================
   CONTENT AREA (Right column)
   ======================================== */
.wb-content-area {
    flex: 1;
    padding-top: 10px;
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ========================================
   WINDOW COMPONENT
   ======================================== */
.wb-window {
    background: var(--wb-blue);
    border: 2px solid var(--wb-white);
    border-right-width: 1px;
    display: flex;
    flex-direction: column;
}

.wb-window.drawer {
    /* Narrow drawer window */
    min-height: var(--window-min-height);
}

.wb-window.content {
    /* Content window fills remaining space - active window */
    flex: 1;
    min-height: 200px;
}

/* Window Title Bar */
.wb-window-titlebar {
    height: var(--titlebar-height);
    background: var(--wb-blue);
    border-bottom: 1px solid var(--wb-white);
    display: flex;
    align-items: center;
    padding: 0 2px;
    gap: 2px;
}

/* Desktop: match mobile titlebar height for consistent rendering */
@media screen and (min-width: 601px) {
    :root {
        --titlebar-height: 24px;
    }
}

/* Title bar stripes - space between title and gadgets */
/* Default: dithered stripes for inactive windows */
.wb-window-titlebar-stripes {
    flex: 1;
    height: 100%;
    background: url('amiga/window/titlebar_background_deselected.png') repeat-x center;
}

/* Last window (deepest level) has solid stripes - it's the "active" one */
.wb-content-area > .wb-window:last-child .wb-window-titlebar-stripes {
    background: url('amiga/window/titlebar_background.png') repeat-x center;
}

.wb-window-title {
    background: var(--wb-white);
    color: var(--wb-blue);
    padding: 1px 4px;
    font-size: 14px;
    white-space: nowrap;
}

.wb-window-gadgets {
    display: flex;
    gap: 2px;
}

.wb-gadget {
    width: 20px;
    height: 20px;
    background: var(--wb-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.wb-gadget-close {
    width: 20px;
    height: 20px;
    background: url('amiga/window/button_close.png') no-repeat center;
    background-size: contain;
    display: block;
}

.wb-gadget-close:hover {
    background-image: url('amiga/window/button_close_selected.png');
}

.wb-gadget-front {
    width: 22px;
    height: 20px;
    background: url('amiga/window/button_up.png') no-repeat center;
    background-size: contain;
}

.wb-gadget-back {
    width: 22px;
    height: 20px;
    background: url('amiga/window/button_down.png') no-repeat center;
    background-size: contain;
}

/* Window Content Area */
.wb-window-content {
    flex: 1;
    padding: 8px;
    overflow: auto;
}

/* Scrollbars (decorative Amiga style) */
.wb-window-scrollbar-v {
    position: absolute;
    right: 0;
    top: var(--titlebar-height);
    bottom: 16px;
    width: 16px;
    background: var(--wb-blue);
    border-left: 2px solid var(--wb-black);
}

.wb-window-scrollbar-h {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 16px;
    height: 16px;
    background: var(--wb-blue);
    border-top: 2px solid var(--wb-black);
}

/* ========================================
   DRAWER ICONS (inside windows)
   ======================================== */
.wb-drawer-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px;
}

.wb-drawer-icon {
    display: block;
    text-align: center;
    text-decoration: none;
    color: var(--wb-white);
    width: 78px;
    font-size: 0;
    line-height: 0;
    padding: 0 2px 1px 2px;
}

.wb-drawer-icon img {
    display: block;
    margin: 0 auto 4px;
    width: auto;
    height: 40px;
    image-rendering: pixelated;
}

.wb-drawer-icon span {
    font-size: 14px;
    text-align: center;
    color: var(--wb-white);
    text-shadow: 1px 1px 0 var(--wb-black);
    word-break: break-word;
    padding: 0 1px;
    display: inline;
    line-height: 1.2;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    box-shadow: 0 0 0 2px transparent;
}


/* App icons (show original icon without frame) */
.wb-app-icon img {
    display: block;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    background: url('amiga/busy.png') no-repeat center center;
    background-size: 32px 32px;
}

/* ========================================
   CONTENT STYLING
   ======================================== */
.wb-window-content h2 {
    color: var(--wb-orange);
    font-size: 18px;
    margin-bottom: 12px;
    text-shadow: 1px 1px 0 var(--wb-black);
}

.wb-window-content h3 {
    color: var(--wb-white);
    font-size: 16px;
    margin-top: 16px;
    margin-bottom: 8px;
}

.wb-window-content p {
    margin-bottom: 12px;
}

.wb-window-content a {
    color: var(--wb-orange);
    text-decoration: none;
}

.wb-window-content a:hover {
    color: var(--wb-white);
    background: var(--wb-orange);
}

.wb-window-content img {
    max-width: 100%;
    height: auto;
}

/* App Store / Play Store badges */
.wb-badges {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.wb-badges img {
    height: 40px;
    width: auto;
}

/* ========================================
   LINKS STYLING
   ======================================== */
a:link, a:visited {
    color: var(--wb-orange);
    text-decoration: none;
}

a:hover {
    color: var(--wb-black);
    background-color: var(--wb-orange);
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */
@media screen and (max-width: 600px) {
    :root {
        --disk-sidebar-width: 100%;
        --titlebar-height: 24px;
    }

    body {
        padding: 4px 8px;
    }

    .wb-desktop {
        flex-direction: column;
    }

    .wb-disk-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start;
        padding-top: 16px;
        padding-bottom: 12px;
        gap: 10px;
        padding-left: 0;
    }

    .wb-disk-icon {
        width: 60px;
    }

    .wb-disk-icon img {
        width: 40px;
        height: 40px;
    }

    .wb-content-area {
        padding-left: 4px;
        padding-top: 0;
    }

    .wb-drawer-icons {
        justify-content: flex-start;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.tooold, .oldbutuseful {
    font-size: 12px;
    font-style: italic;
    color: var(--wb-orange);
    opacity: 0.8;
}
