/* ===== BASE ===== */
* { box-sizing: border-box; }

body{
    margin:0;
    font-family: Tahoma, Verdana, sans-serif;
    background:url('https://i.imgur.com/Zk6TR5k.jpg') no-repeat center center fixed;
    background-size:cover;

    /* чтобы контент не прятался под taskbar */
    padding-bottom: 56px;
}

/* ===== TOPBAR ===== */
.topbar {
    background: linear-gradient(to bottom, #5c9ded, #2f6fd1);
    padding: 10px 15px;
    color: white;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    border-bottom: 2px solid #1c3f94;
}

/* ===== LAYOUT ===== */
.container {
    display: flex;
    gap: 15px;
    padding: 15px;
    align-items: flex-start;
}

/* ===== SIDEBAR ===== */
.xp-sidebar {
    width: 220px;
    background: linear-gradient(to bottom, #eaf3ff 0%, #c7dcff 100%);
    border: 2px solid #2b579a;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 #ffffff55;
}

.xp-header {
    background: linear-gradient(to bottom, #7ba7e9 0%, #3f73c4 100%);
    color: #fff;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 1px 1px 1px #1b3f7a;
    border-bottom: 1px solid #2b579a;
}

.xp-menu {
    padding: 8px 0;
}

.xp-menu a {
    display: block;
    padding: 8px 14px;
    font-size: 14px;
    color: #003399;
    text-decoration: none;
}

.xp-menu a:hover {
    background: linear-gradient(to bottom, #fff6c4 0%, #ffd95e 100%);
    border-top: 1px solid #e3b400;
    border-bottom: 1px solid #e3b400;
}

/* ===== CONTENT ===== */
.content {
    flex: 1;
    min-width: 0;
}

/* ===== XP WINDOW ===== */
.xp-window{
    background: linear-gradient(to bottom, #eaf3ff 0%, #c7dcff 100%);
    border: 2px solid #2b579a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 3px 3px 8px rgba(0,0,0,0.5);
}

.xp-titlebar{
    height: 32px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 0 8px;

    /* стиль как у xp-menu */
    background: linear-gradient(to bottom, #7ba7e9 0%, #3f73c4 100%);
    border-bottom: 1px solid #7aa3e5;
}

.xp-title{
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

.xp-controls{
    display:flex;
    gap: 6px;
    flex-shrink: 0;
}

.xp-btn{
    width: 24px;
    height: 20px;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    font-size: 12px;
    font-weight:bold;

    background: linear-gradient(to bottom, #fff6c4 0%, #ffd95e 100%);
    border: 1px solid #e3b400;
    border-radius: 4px;
}

.xp-btn:hover{
    background: linear-gradient(to bottom, #ffffff 0%, #ffe27a 100%);
}

.xp-btn.close{
    background: linear-gradient(to bottom, #ffb3b3 0%, #ff5c5c 100%);
    border: 1px solid #cc0000;
    color: #fff;
}

.xp-btn.close:hover{
    background: linear-gradient(to bottom, #ff8080 0%, #ff3333 100%);
}

.xp-body{
    padding: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.xp-button{
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    background: linear-gradient(to bottom, #fff6c4 0%, #ffd95e 100%);
    border: 1px solid #e3b400;
    border-radius: 6px;
}

.xp-button:hover{
    background: linear-gradient(to bottom, #ffffff 0%, #ffe27a 100%);
}

/* ===== TASKBAR ===== */
.taskbar{
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 33px;
    padding: 0 0px;
    background: linear-gradient(to bottom,#3a8dde 0%,#1f57b0 50%,#0c3c8c 100%);
    display:flex;
    align-items:center;
    gap: 10px;
    box-shadow: inset 0 1px 0 #6fbaff;
    z-index: 999;
}

.start-button{
    height: 34px;
    padding: 0 14px;
    display:flex;
    align-items:center;
    gap: 6px;
    background: linear-gradient(to bottom,#4cd964 0%,#2fa43f 50%,#1e7f2d 100%);
    border-radius: 0 6px 6px 0;
    border: 1px solid #0b5e16;
    color: white;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    box-shadow: inset 0 1px 2px #7fffa0;
    flex-shrink: 0;
}

.start-button:hover{
    background:linear-gradient(to bottom,#5efc7a,#2fbf47,#1e7f2d);
}

.quick-launch{
    display:flex;
    align-items:center;
    gap: 8px;
}

.icon{
    width: 24px;
    height: 24px;
    background:#fff;
    border-radius:3px;
    border:1px solid #0c3c8c;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:14px;
    cursor:pointer;
}

.icon:hover{ background:#cde6ff; }

.tray{
    margin-left:auto;
    display:flex;
    align-items:center;
    gap:8px;
    color:white;
    font-size:13px;
    flex-shrink: 0;
    padding-right: 15px;
}

.tray-icon{
    width:18px;
    height:18px;
    background:#fff;
    border-radius:3px;
    border:1px solid #0c3c8c;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:11px;
}

/* ===== MOBILE ADAPT ===== */
@media (max-width: 800px){
    .topbar{
        font-size: 16px;
        padding: 10px 12px;
    }

    .container{
        flex-direction: column;
        padding: 12px;
        gap: 12px;
    }

    .xp-sidebar{
        width: 100%;
    }

    .xp-menu{
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 10px;
    }

    .xp-menu a{
        border: 1px solid rgba(43,87,154,.35);
        border-radius: 6px;
        background: rgba(255,255,255,.55);
        text-align: center;
        padding: 10px 8px;
    }

    .xp-menu a:hover{
        border-top: 1px solid #e3b400;
        border-bottom: 1px solid #e3b400;
    }

    .xp-title{
        font-size: 13px;
        max-width: 58vw;
    }

    .xp-body{
        padding: 12px;
        font-size: 14px;
    }

    /* taskbar компактнее */
    .taskbar{
        height: 34px;
        padding: 0px;
        gap: 8px;
    }

    .start-button i{
        display: none; /* оставляем иконку+картинку, убираем текст "ПУСК" */
    }

    .quick-launch{
        gap: 6px;
    }

    /* если мало места — скрываем быстрый запуск */
    @media (max-width: 420px){
        .quick-launch{ display: none; }
        .xp-menu{ grid-template-columns: 1fr; }
        .xp-title{ max-width: 50vw; }
    }
}

/* ===== START MENU (Windows XP) ===== */
.start-menu{
    position: fixed;
    left: 6px;
    bottom: 33px; /* ровно над taskbar (height 33px) */
    width: 380px;
    border-radius: 10px 10px 6px 6px;
    overflow: hidden;
    border: 2px solid #2b579a;
    box-shadow: 3px 6px 18px rgba(0,0,0,0.55);
    z-index: 1000;

    display: none;
}

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

.start-menu-top{
    height: 58px;
    display:flex;
    align-items:center;
    gap: 10px;
    padding: 10px 12px;
    color:#fff;
    font-weight: bold;
    text-shadow: 1px 1px 1px #1b3f7a;
    background: linear-gradient(to bottom, #2f6fd1 0%, #1c4ea8 100%);
    border-bottom: 1px solid #153b86;
}

.start-avatar{
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: rgba(255,255,255,0.85);
    display:flex;
    align-items:center;
    justify-content:center;
    border: 1px solid rgba(0,0,0,0.25);
    font-size: 18px;
}

.start-user{
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.start-menu-body{
    display:flex;
    background: linear-gradient(to bottom, #eaf3ff 0%, #c7dcff 100%);
}

.start-left{
    width: 58%;
    padding: 8px;
    background: rgba(255,255,255,0.55);
    border-right: 1px solid rgba(43,87,154,0.35);
}

.start-right{
    width: 60%;
    padding: 8px;
}

.start-item,
.start-ritem{
    display:flex;
    align-items:center;
    gap: 8px;
    padding: 7px 10px;
    font-size: 13px;
    color:#003399;
    text-decoration:none;
    border-radius: 6px;
}

.start-item:hover,
.start-ritem:hover{
    background: linear-gradient(to bottom, #fff6c4 0%, #ffd95e 100%);
    border: 1px solid #e3b400;
    padding: 6px 9px; /* компенсируем border */
}

.start-item span,
.start-ritem span{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.start-sep{
    height: 1px;
    margin: 8px 6px;
    background: rgba(43,87,154,0.35);
}

.start-menu-bottom{
    background: linear-gradient(to bottom, #dfeeff 0%, #bcd6ff 100%);
    border-top: 1px solid rgba(43,87,154,0.35);
    padding: 8px;
    display:flex;
    justify-content:flex-end;
}

.start-power{
    padding: 6px 10px;
    cursor:pointer;
    font-size: 13px;
    font-weight: bold;
    color: #003399;
    background: linear-gradient(to bottom, #fff6c4 0%, #ffd95e 100%);
    border: 1px solid #e3b400;
    border-radius: 6px;
}

.start-power:hover{
    background: linear-gradient(to bottom, #ffffff 0%, #ffe27a 100%);
}

.start-ritem.danger{
    color:#b00000;
    font-weight: bold;
}

.start-button.active{
    filter: brightness(1.1);
    box-shadow: inset 0 1px 2px #7fffa0, 0 0 0 2px rgba(255,255,255,0.25);
}

/* мобильная адаптация для меню */
@media (max-width: 420px){
    .start-menu{
        width: calc(100% - 12px);
        left: 6px;
        right: 6px;
    }
}
/* ===== END START MENU ===== */

/* ===== Windows Media Player (XP mock) ===== */
.wmp-window{
    max-width: 720px;
}

.wmp-titlebar{
    background: linear-gradient(to bottom, #4c79d8 0%, #2b55b3 100%);
    border-bottom: 1px solid #1f4496;
}

.wmp-body{
    padding: 12px;
}

.wmp-screen{
    border: 2px solid #2b579a;
    border-radius: 8px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.20), rgba(0,0,0,0.05));
    padding: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.wmp-visual{
    height: 130px;
    border-radius: 8px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.15));
    display:flex;
    align-items:center;
    justify-content:center;
    font-size: 34px;
    color: rgba(255,255,255,0.85);
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.15);
}

.wmp-track{
    margin-top: 10px;
    font-size: 13px;
    color: #003399;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(43,87,154,.25);
    border-radius: 6px;
    padding: 8px 10px;
}

.wmp-controls{
    margin-top: 10px;
    display:flex;
    align-items:center;
    gap: 10px;
    flex-wrap: wrap;
}

.wmp-btn{
    width: 44px;
    height: 32px;
    cursor:pointer;
    font-size: 14px;
    font-weight: bold;
    background: linear-gradient(to bottom, #fff6c4 0%, #ffd95e 100%);
    border: 1px solid #e3b400;
    border-radius: 8px;
}

.wmp-btn:hover{
    background: linear-gradient(to bottom, #ffffff 0%, #ffe27a 100%);
}

.wmp-play{
    width: 54px;
}

.wmp-progress{
    flex: 1;
    min-width: 220px;
    display:flex;
    flex-direction: column;
    gap: 6px;
}

.wmp-bar{
    height: 10px;
    background: rgba(255,255,255,0.65);
    border: 1px solid rgba(43,87,154,.35);
    border-radius: 999px;
    overflow:hidden;
}

.wmp-fill{
    height: 100%;
    background: linear-gradient(to bottom, #7ba7e9 0%, #3f73c4 100%);
}

.wmp-time{
    display:flex;
    justify-content: space-between;
    font-size: 12px;
    color: #003399;
    padding: 0 2px;
}

.wmp-volume{
    display:flex;
    align-items:center;
    gap: 6px;
    font-size: 12px;
    color: #003399;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(43,87,154,.25);
    border-radius: 8px;
    padding: 6px 8px;
}

.wmp-volbar{
    width: 90px;
    height: 8px;
    background: rgba(255,255,255,0.65);
    border: 1px solid rgba(43,87,154,.35);
    border-radius: 999px;
    overflow:hidden;
}

.wmp-volfill{
    height: 100%;
    background: linear-gradient(to bottom, #5efc7a 0%, #2fbf47 60%, #1e7f2d 100%);
}

.wmp-footer{
    margin-top: 10px;
    display:flex;
    gap: 8px;
    flex-wrap: wrap;
}

.wmp-mini{
    font-size: 12px;
    color:#003399;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(43,87,154,.25);
    border-radius: 999px;
    padding: 6px 10px;
}
/* ===== END WMP ===== */

.wmp-visual.playing{
    animation: wmpPulse 0.6s infinite alternate;
}
@keyframes wmpPulse{
    from{ transform: scale(1); opacity: 0.85; }
    to{ transform: scale(1.03); opacity: 1; }
}
.wmp-bar{ cursor: pointer; }
.wmp-volbar{ cursor: pointer; }

/* ===== DRAG HELPERS ===== */
.xp-titlebar{
    cursor: move;
    user-select: none;
}
body.dragging{
    user-select: none;
}

/* ===== XP CLIPPY ASSISTANT ===== */
.clippy{
    position: fixed;
    right: 18px;
    bottom: 46px; /* над taskbar */
    width: 92px;
    height: 130px;
    z-index: 2005;
    pointer-events: auto;
}

.clippy.hidden{ display:none; }

.clippy-body{
    width: 70px;
    height: 180px;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    filter: drop-shadow(2px 3px 5px rgba(0,0,0,0.45));
}

.clippy-svg{
    width: 65px;
    height: 80px;
    display:block;
}

.clippy.talking .clippy-body{
    animation: clippyWiggle 0.35s ease-in-out 2;
}

@keyframes clippyWiggle{
    0%{ transform: rotate(0deg) translateY(0); }
    25%{ transform: rotate(-3deg) translateY(-1px); }
    50%{ transform: rotate(3deg) translateY(0); }
    75%{ transform: rotate(-2deg) translateY(-1px); }
    100%{ transform: rotate(0deg) translateY(0); }
}

.clippy.dragging .clippy-body{ cursor: grabbing; }

/* bubble */
.clippy-bubble{
    position: absolute;
    right: 85px;
    bottom: 35px;
    width: 270px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #2b579a;
    box-shadow: 3px 6px 18px rgba(0,0,0,0.55);
    background: linear-gradient(to bottom, #eaf3ff 0%, #c7dcff 100%);
    display: none;
}

.clippy-bubble.open{ display:block; }

.clippy-bubble-top{
    height: 30px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 0 8px;
    background: linear-gradient(to bottom, #7ba7e9 0%, #3f73c4 100%);
    border-bottom: 1px solid #7aa3e5;
    color:#fff;
    text-shadow: 1px 1px 1px #1b3f7a;
}

.clippy-bubble-title{
    font-size: 13px;
    font-weight: bold;
}

.clippy-bubble-close{
    width: 24px;
    height: 20px;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    font-size: 12px;
    font-weight:bold;

    background: linear-gradient(to bottom, #ffb3b3 0%, #ff5c5c 100%);
    border: 1px solid #cc0000;
    border-radius: 4px;
    color:#fff;
}

.clippy-bubble-close:hover{
    background: linear-gradient(to bottom, #ff8080 0%, #ff3333 100%);
}

.clippy-bubble-body{
    padding: 10px 12px;
    font-size: 13px;
    color:#003399;
    line-height: 1.35;
    background: rgba(255,255,255,0.55);
    border-bottom: 1px solid rgba(43,87,154,.25);
}

.clippy-bubble-actions{
    display:flex;
    gap: 8px;
    justify-content:flex-end;
    padding: 8px 10px;
}

.clippy-action{
    padding: 6px 10px;
    cursor:pointer;
    font-size: 12px;
    font-weight: bold;
    color: #003399;
    background: linear-gradient(to bottom, #fff6c4 0%, #ffd95e 100%);
    border: 1px solid #e3b400;
    border-radius: 6px;
}

.clippy-action:hover{
    background: linear-gradient(to bottom, #ffffff 0%, #ffe27a 100%);
}

/* tail */
.clippy-tail{
    position: absolute;
    right: -10px;
    bottom: 18px;
    width: 18px;
    height: 18px;
}

/* mobile: bubble fits screen */
@media (max-width: 520px){
    .clippy-bubble{
        width: calc(80vw - 24px);
        right: 0;
        left: -280px; /* чтобы не улетала за край, т.к. clippy справа */
        max-width: 360px;
    }
}
