/* ===========================
   404sidequest — styles.css
   Windows XP teema, alkuperäinen
   =========================== */

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: 'Tahoma', sans-serif;
}

/* ===== TYÖPÖYTÄ ===== */
.desktop {
    background-image: url('img/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #1a6b3a;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
    align-content: flex-start;
    height: calc(100vh - 40px);
    width: auto;
    padding: 20px;
}

/* ===== IKONIT ===== */
.icon {
    width: 80px;
    height: 100px;
    background: transparent;
    border: none;
    text-align: center;
    margin: 10px;
    padding: 0;
    cursor: pointer;
    display: inline-block;
    overflow: hidden;
    position: relative;
}

.icon::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
}

.icon img {
    width: 50px;
    height: 50px;
    pointer-events: none;
}

.icon p {
    color: white;
    margin: 5px 0;
    pointer-events: none;
    user-select: none;
    font-size: 11px;
    text-shadow: 1px 1px 2px #000, -1px -1px 2px #000;
    word-break: break-word;
    line-height: 1.3;
}

/* ===== TASKBAR ===== */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: #0078D4;
    display: flex;
    align-items: center;
    border-top: 2px solid #358dcc;
    z-index: 500;
}

.start-button {
    height: 40px;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background-color: #008080;
    cursor: pointer;
    user-select: none;
}

.start-button img {
    height: 40px;
    object-fit: contain;
}

.system-tray {
    position: absolute;
    right: 0;
    width: 100px;
    height: 40px;
    background-color: #3497e2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time {
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-size: 14px;
}

.quick-launch {
    display: flex;
    align-items: center;
    margin-left: 2%;
    background-color: #0b5a96;
    height: 80%;
    padding: 0 5px;
    border-radius: 5px;
    gap: 5px;
    overflow: hidden;
    max-width: calc(100% - 250px);
}

.quick-launch-item {
    min-width: 100px;
    height: 80%;
    margin-right: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.quick-launch-item img {
    width: 24px;
    height: 24px;
}

.quick-launch-item span {
    color: white;
    font-size: 13px;
    white-space: nowrap;
}

/* ===== START MENU — Windows XP tyyli ===== */
.start-menu {
    display: none;
    position: fixed;
    bottom: 40px;
    left: 0;
    width: 380px;
    background: white;
    border: 1px solid #0054E3;
    box-shadow: 3px -3px 12px rgba(0,0,0,0.5);
    z-index: 600;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.start-menu.open {
    display: block;
}

.start-menu-header {
    background: linear-gradient(to right, #0054E3, #2E8AE6);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
}

.start-menu-username {
    color: white;
    font-weight: bold;
    font-size: 15px;
    font-family: 'Tahoma', sans-serif;
}

.start-menu-body {
    display: flex;
    min-height: 280px;
}

.start-menu-left {
    flex: 1;
    background: white;
    padding: 6px 0;
    border-right: 1px solid #ccc;
}

.start-menu-right {
    width: 160px;
    background: #D3E5FA;
    padding: 6px 0;
}

.start-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Tahoma', sans-serif;
    font-size: 13px;
    color: #000;
    text-align: left;
    box-sizing: border-box;
}

.start-menu-item:hover {
    background: #316AC5;
    color: white;
}

.start-menu-item img {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.start-menu-item.pinned {
    font-weight: bold;
}

.start-menu-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    color: #000;
    text-align: left;
    box-sizing: border-box;
}

.start-menu-item-right:hover {
    background: #316AC5;
    color: white;
}

.start-menu-item-right img {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.start-menu-separator {
    height: 1px;
    background: #ccc;
    margin: 4px 8px;
}

.start-menu-footer {
    background: linear-gradient(to right, #0054E3, #2E8AE6);
    padding: 6px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.start-footer-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 4px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
}

.start-footer-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ===== YLEISET MODAALIT ===== */
.notepad-modal, .folder-modal, .games-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1000;
    pointer-events: none;
}

.notepad-window, .folder-window, .games-window {
    pointer-events: all;
    min-width: 500px;
    min-height: 400px;
    width: 60%;
    height: 70%;
    margin: 100px auto;
    background: #F0F0F0;
    border: 3px solid #0078D4;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.3);
    border-radius: 5px;
    font-family: 'Tahoma', sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notepad-header, .folder-header, .games-header {
    background: linear-gradient(to bottom, #0078D4, #005FA3);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    border-bottom: 3px solid #005FA3;
    height: 30px;
    font-size: 16px;
    cursor: move;
    user-select: none;
}

.window-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}

.notepad-close, .folder-close, .games-close {
    background: #FF0000;
    color: white;
    border: 1px solid #ffffff;
    width: 25px;
    height: 25px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0;
}

.notepad-close:hover, .folder-close:hover, .games-close:hover {
    background: #CC0000;
}

.notepad-minimize {
    background: #FFB800;
    color: #000;
    border: 1px solid #e0a000;
    width: 25px;
    height: 25px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notepad-minimize:hover {
    background: #FFA500;
}

/* Taskbar-ikkunapainikkeet (avoimet ikkunat) */
.taskbar-windows {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-left: 6px;
    height: 100%;
    flex-wrap: nowrap;
    overflow: hidden;
}

.taskbar-window-btn {
    height: 28px;
    min-width: 120px;
    max-width: 160px;
    background: linear-gradient(to bottom, #3497e2, #1a6fbe);
    border: 1px solid #1a5fa0;
    border-radius: 3px;
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.taskbar-window-btn:hover {
    background: linear-gradient(to bottom, #4aa8f0, #2a80d0);
}

.taskbar-window-btn.minimized {
    background: linear-gradient(to bottom, #1a5fa0, #0d4a8a);
    border-color: #0d3a70;
}

.taskbar-window-btn img {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ===== NOTEPAD CONTENT ===== */
.notepad-content {
    flex-grow: 1;
    display: flex;
    overflow: hidden;
}

textarea {
    flex-grow: 1;
    width: 100%;
    height: 100%;
    border: none;
    resize: none;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    padding: 10px;
    background: white;
    color: black;
    outline: none;
    overflow-y: auto;
    box-sizing: border-box;
}

#blog-text, #shop-text {
    flex-grow: 1;
    width: 100%;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    padding: 10px;
    background: white;
    color: black;
    overflow-y: auto;
    box-sizing: border-box;
    line-height: 1.6;
}

#shop-text a {
    color: blue;
    text-decoration: underline;
}

#shop-text a:hover {
    color: purple;
}

/* ===== BLOG ===== */
.blog-entry {
    border-bottom: 1px dashed #ccc;
    margin-bottom: 16px;
    padding-bottom: 12px;
}

.blog-date {
    color: #888;
    font-size: 12px;
    margin-bottom: 4px;
}

.blog-title-entry {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 6px;
    color: #0078D4;
}

.blog-body {
    font-size: 13px;
    line-height: 1.6;
}

/* ===== COLLECTION FOLDER ===== */
.folder-content {
    display: flex;
    flex-wrap: wrap;
    padding: 10px;
    gap: 10px;
    overflow-y: auto;
    align-content: flex-start;
    background: white;
}

.folder-image {
    width: 120px;
    height: 168px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: transform 0.15s;
}

.folder-image:hover {
    transform: scale(1.04);
    border-color: #0078D4;
}

.collection-empty {
    color: #888;
    font-family: 'Tahoma', sans-serif;
    font-size: 13px;
    padding: 20px;
    font-style: italic;
}

/* ===== GAMES ===== */
.games-content {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.games-content iframe {
    width: 100%;
    height: 100%;
}

/* ===== KUVAMODAALI ===== */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.image-modal-content {
    margin: 10% auto;
    display: block;
    max-width: 80%;
    max-height: 80vh;
    object-fit: contain;
}

.image-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}

.image-close:hover {
    color: #bbb;
}

/* ===== WINAMP ===== */
#winamp-container {
    position: fixed;
    z-index: 1000;
    pointer-events: auto;
}

#winamp-container * { pointer-events: auto; }

.webamp-media-library,
.webamp-context-menu {
    z-index: 1001;
    pointer-events: auto;
}

/* ===== MOBIILI ===== */
@media (max-width: 768px) {
    .notepad-window, .folder-window, .games-window {
        min-width: unset;
        width: 90%;
        height: 80vh;
        margin: 10vh auto;
    }

    .notepad-content, .folder-content {
        padding: 5px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .notepad-header, .folder-header, .games-header {
        height: 25px;
        font-size: 14px;
        padding: 3px;
    }

    .notepad-close, .folder-close, .games-close {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }

    .taskbar { height: 35px; }
    .start-button, .start-button img { height: 35px; }
    .system-tray { width: 80px; height: 35px; }

    .quick-launch { margin-left: 1%; padding: 0 2px; }
    .quick-launch-item { min-width: 70px; }
    .quick-launch-item span { font-size: 12px; }

    textarea { font-size: 14px; padding: 5px; }

    .folder-image { width: 90px; height: 126px; }

    .image-modal-content { width: 95%; margin: 5% auto; }
    .image-close { top: 10px; right: 20px; font-size: 30px; }

    .icon { width: 96px; height: 120px; margin: 5px; margin-bottom: 0; }
    .icon img { width: 60px; height: 60px; }
    .icon p { font-size: 1.2em; margin: 2px 0; }

    #winamp-container { transform: scale(0.8); transform-origin: top left; }

    .start-menu { width: 280px; }
    .start-menu-body { flex-direction: column; }
    .start-menu-right { width: 100%; }
}

@media (max-width: 480px) {
    .notepad-window, .folder-window, .games-window {
        width: 95%;
        height: 85vh;
        margin: 5vh auto;
    }

    .quick-launch-item { min-width: 50px; }
    .quick-launch-item span { display: none; }
    .system-tray { width: 60px; }
    .time { font-size: 12px; }

    .games-content iframe {
        width: 100%;
        height: calc(100% - 20px);
    }
}
