/* Переменные */
:root {
    --stroke-color: rgba(0, 33, 109, 1);
    --shadow-color: rgba(255, 255, 255, 0.5);
    --main: 255, 133, 174;
    --muted: rgba(246, 47, 127, 1);
    --light: rgba(255, 215, 229, 1);
    --p-font-size: 20px;
    --font-family: "Balsamiq Sans";
}

/* Базовые стили */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-family), Arial, sans-serif;
    color: var(--stroke-color);
    font-size: var(--p-font-size);
}

a, textarea {
    color: var(--stroke-color);
    text-decoration: none;
}

/* Site Window */
.site-window-header {
    background: linear-gradient(to bottom, var(--muted) 0%, #ffffff 5%, rgba(var(--main), 1) 15%, var(--muted) 100%);
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #ccc;
    border-radius: 8px 8px 0 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.site-window-header-iframe {
    width: 100%;
    height: 30px;
    border: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    margin: 0;
    padding: 0;
    display: block;
}

.site-window-content {
    position: fixed;
    top: 30px;
    bottom: 40px;
    left: 0;
    right: 0;
    padding: 0;
    background-color: #fff;
    overflow: hidden;
    border-left: 3.5px solid var(--muted);
    border-right: 3.5px solid var(--muted);
    box-sizing: border-box;
}

.site-window-content iframe#content_box {
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    padding: 0;
    display: block;
}

.explorer-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.folder-menu {
    width: 200px;
    background-color: var(--light);
    border-right: 1px solid rgba(var(--main), 0.6);
    padding: 10px;
    overflow-y: auto;
    transition: transform 0.3s ease; /* Анимация при скрытии/показе */
}

.folder-item {
    margin-bottom: 10px;
}

.folder-toggle {
    display: inline-block;
    width: 14px;
    height: 14px;
    line-height: 14px;
    text-align: center;
    border: 1px solid rgba(var(--main), 1);
    cursor: pointer;
    margin-right: 5px;
    background: linear-gradient(to bottom, var(--light) 0%, rgba(var(--main), 0.8) 100%);
}

.folder-icon, .subfolder-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 5px;
}

.folder-name, .subfolder-name {
    font-size: 18px;
    vertical-align: middle;
}

.folder-name {
    font-weight: bold;
}

.subfolders {
    margin-left: 50px;
    display: none;
}

.subfolders.active {
    display: block;
}

.subfolder-item {
    margin: 5px 0;
    cursor: pointer;
}

.subfolder-item.active .subfolder-name {
    color: var(--muted);
}

/* Стиль наведения для подпапок */
.subfolder-item:hover, .subfolder-item.active {
    border: 1px solid rgba(var(--main), 0.6);
    background: linear-gradient(to bottom, rgba(var(--main), 0.2) 0%, rgba(var(--main), 0.6) 100%);
    border-radius: 2px;
}

.gallery-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #fff;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.gallery-item {
    text-align: center;
    cursor: pointer;
}

.gallery-item img {
    width: 230px;
    height: 230px;
    object-fit: cover;
    border: 1px solid lightgray;
    border-radius: 8px;
}

.gallery-item span {
    display: block;
    font-size: 16px;
    margin-top: 5px;
    word-wrap: break-word;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
}

.modal-content {
    position: relative;
    margin: 50px auto;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modalImage {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

.modal-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.prev-btn, .next-btn {
    font-size: 24px;
    padding: 10px 10px;
    background-color: rgba(var(--main), 0.2);
    border: none;
    cursor: pointer;
    border-radius: 5px;
    pointer-events: auto;
    z-index: 10001;
}

.prev-btn:hover, .next-btn:hover {
    background-color: rgba(var(--main), 0.4);
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    color: #fff;
    cursor: pointer;
    z-index: 10001;
}

/* Футер */
.footer-iframe {
    width: 100%;
    height: 40px;
    border: none;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 999;
    margin: 0;
}

/* Остальные стили */
.desktop {
    background: linear-gradient(to bottom, rgba(var(--main), 1), #FFFFFF), url('arts/bg/Bg.png');
    background-size: 50%;
    background-repeat: repeat-x;
    background-blend-mode: overlay;
    height: calc(100vh - 40px);
    position: relative;
}

.icon-area {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-auto-rows: 100px;
    gap: 20px;
    padding: 20px;
    box-sizing: border-box;
    justify-content: start;
    align-content: start;
}

.icon {
    width: 100%;
    height: 100%;
    text-align: center;
    cursor: move;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.icon-img {
    width: 64px;
    height: 64px;
}

.icon-text {
    display: block;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px #fff;
    margin-top: 5px;
}

#square_icon {
    border: 4px solid;
    border-radius: 8px;
    width: 54px;
    height: 54px;
}

#start-menu-container {
    position: fixed;
    bottom: 45px;
    left: 0;
    width: 350px;
    height: 450px;
    z-index: 1000;
    display: none;
}

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

.start-panel {
    width: 100%;
    height: 100%;
    background-color: #fff;
    border: 3.5px solid var(--muted);
    border-radius: 12px 12px 5px 5px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.start-header {
    background: linear-gradient(to bottom, var(--muted) 0%, #ffffff 5%, rgba(var(--main), 1) 15%, var(--muted) 100%);
    padding: 5px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #ccc;
    border-radius: 8px 8px 0 0;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border: 2px solid #fff;
    border-radius: 4px;
    margin-right: 10px;
}

.username {
    color: #fff;
}

.start-content {
    display: flex;
    flex: 1;
    overflow-y: auto;
}

.app-list {
    flex: 1;
    padding: 3px;
}

.app-list.pink-bg {
    background-color: var(--light);
    border-left: 1px solid rgba(var(--main), 0.6);
}

.app {
    padding: 2px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    position: relative;
}

.app a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.app-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.app:hover {
    border: 1px solid rgba(var(--main), 0.6);
    background: linear-gradient(to bottom, rgba(var(--main), 0.2) 0%, rgba(var(--main), 0.6) 100%);
    border-radius: 2px;
}

.taskbar {
    background: linear-gradient(to bottom, var(--muted) 0%, #ffffff 5%, rgba(var(--main), 1) 15%, var(--muted) 100%);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3);
    position: fixed;
    bottom: 0;
    width: 100%;
}

.start-button {
    display: flex;
    align-items: center;
    cursor: pointer;
    background: linear-gradient(to bottom, var(--muted) 0%, #ffffff 5%, var(--light) 15%, rgba(var(--main), 1) 100%);
    height: 40px;
    width: 80px;
    padding: 0 10px;
    border-radius: 0 5px 20px 0;
    box-shadow: 1px 1px 2px var(--shadow-color);
    user-select: none;
}

.start-button:hover {
    background: linear-gradient(to bottom, var(--muted) 0%, rgba(var(--main), 1) 8%, var(--muted) 100%);
}

.windows-icon {
    width: 24px;
    height: 24px;
    margin-right: 5px;
}

.start-text, .time {
    color: #FFFFFF;
    text-shadow: 1px 2px 2px var(--muted);
    font-style: italic;
    font-size: 20px;
}

.time {
    width: 120px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, var(--muted) 0%, #ffffff 5%, var(--light) 15%, rgba(var(--main), 1) 100%);
    box-shadow: 1px 1px 2px var(--shadow-color);
    margin-left: auto;
}

.taskbar-icons {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.taskbar-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 10px;
    cursor: pointer;
    position: relative;
}

.taskbar-icon a {
    margin-top: 6px;
}

.taskbar-icon:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 80%;
    background-color: rgba(255, 255, 255, 0.3);
}

.taskbar-icon img {
    width: 24px;
    height: 24px;
}

.icon:hover::after,
.taskbar-icon a:hover::after {
    content: '';
    position: absolute;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 1;
}

.icon:hover::after {
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 1px solid rgba(var(--main), 0.7);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.2);
}

.taskbar-icon a:hover::after {
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.icon::after,
.taskbar-icon::after {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.icon-img,
.taskbar-icon img,
.app-icon {
    transition: none;
}

#bebby-container {
    position: fixed;
    right: 10px;
    bottom: 60px;
    z-index: 1002;
    width: 320px;
    max-width: 320px;
    display: block;
    pointer-events: auto;
}

#bebby-container.hidden {
    display: none;
    pointer-events: none;
}

.bebby-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.bebby-img {
    width: 250px;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.bebby-img:hover {
    animation: tilt-shaking 0.25s infinite;
    user-select: none;
}

@keyframes tilt-shaking {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

.bebby-dialog {
    position: relative;
    background-color: rgba(255, 255, 255, 1);
    border: 4px solid;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 2px 2px 5px rgba(var(--main), 0.5);
    min-width: 50px;
    max-width: 320px;
    word-wrap: break-word;
}

.bebby-dialog a {
    color: rgba(var(--main), 1);
}

.bebby-dialog a:hover {
    text-decoration: wavy underline;
}

.bebby-dialog::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border-width: 10px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.window {
    position: fixed;
    background-color: #fff;
    border: 3.5px solid var(--muted);
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    user-select: none;
    resize: both;
    overflow: hidden;
    min-width: 200px;
    min-height: 100px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.window[data-initial-x][data-initial-y] {
    left: var(--initial-x);
    top: var(--initial-y);
    transform: none;
}

.window.hidden { display: none; z-index: -1; pointer-events: none; }
.window:not(.hidden) { display: flex; }
.window.opening { animation: openAnimation 0.3s ease forwards; }
.window.closed { animation: closeAnimation 0.2s ease forwards; }
.window.minimized {
    height: 30px;
    width: 200px;
    overflow: hidden;
    resize: none;
    animation: minimizeAnimation 0.3s ease forwards;
}
.window.fullscreen {
    width: calc(100vw - 8px) !important;
    height: calc(100vh - 46px) !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    resize: none;
    animation: fullscreenEnter 0.3s ease forwards;
}
.window.restored { animation: fullscreenExit 0.3s ease forwards; }

@keyframes openAnimation {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes closeAnimation {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.8); }
}

@keyframes minimizeAnimation {
    0% { opacity: 1; transform: scale(1); height: auto; }
    100% { opacity: 0; transform: scale(0.5); height: 30px; }
}

@keyframes restoreAnimation {
    0% { opacity: 0; transform: scale(0.5); height: 30px; }
    100% { opacity: 1; transform: scale(1); height: auto; }
}

@keyframes fullscreenEnter {
    0% { width: var(--initial-width); height: var(--initial-height); top: var(--initial-top); left: var(--initial-left); }
    100% { width: 100vw; height: 100vh; top: 0; left: 0; }
}

@keyframes fullscreenExit {
    0% { width: 100vw; height: 100vh; top: 0; left: 0; }
    100% { width: var(--initial-width); height: var(--initial-height); top: var(--initial-top); left: var(--initial-left); }
}

.window-header {
    background: linear-gradient(to bottom, var(--muted) 0%, #ffffff 5%, rgba(var(--main), 1) 15%, var(--muted) 100%);
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #ccc;
    border-radius: 8px 8px 0 0;
    cursor: move;
}

.window-title {
    padding-left: 10px;
    color: #fff;
    font-family: var(--font-family);
    font-size: 16px;
    user-select: none;
}

.window-buttons {
    display: flex;
    align-items: center;
}

.window-button {
    width: 20px;
    height: 20px;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.3s;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
    margin: 3px;
    box-shadow: 0 0 2px #fff;
}

.window-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.window-button.minimize { font-size: 20px; }
.window-button.restore { font-size: 14px; }

.window-button.close {
    background: linear-gradient(to bottom, #E9121E 0%, #FF9399 15%, #E9121E 100%);
}

.window-button.close:hover {
    background: linear-gradient(to top, #E9121E 0%, #FF9399 15%, #E9121E 100%);
}

.window-content {
    flex: 1;
    padding: 10px;
    overflow: hidden;
    font-family: var(--font-family);
    font-size: 20px;
    background-color: #fff;
    border-top: 2px solid #ccc;
    border-radius: 0 0 8px 8px;
    box-sizing: border-box;
}

.window-content textarea,
.window-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
    font-size: 20px;
    resize: none;
}

.window-content textarea {
    overflow: auto;
}

/* Header Styling */
.site-window-header {
    background: linear-gradient(to bottom, var(--muted) 0%, #ffffff 5%, rgba(var(--main), 1) 15%, var(--muted) 100%);
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #ccc;
    border-radius: 8px 8px 0 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
}

.browser-tabs {
    display: flex;
    align-items: center;
    height: 100%;
    margin-left: 5px;
}

.tab {
    background: none;
    color: #fff;
    padding: 5px 10px;
    margin-right: 2px;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.tab a {
    color: inherit;
    text-decoration: none;
    display: block;
    width: 100%;
    height: 100%;
}

.tab.active {
    background: linear-gradient(to bottom, rgba(var(--main), 1) 0%, rgba(255, 255, 255, 0.9) 100%);
    color: #fff;
    font-weight: bold;
}

/* Adjust content to account for fixed header */
.site-window-content {
    position: fixed;
    top: 30px;
    bottom: 40px;
    left: 0;
    right: 0;
    padding: 0;
    background-color: #fff;
    overflow: hidden;
    border-left: 3.5px solid var(--muted);
    border-right: 3.5px solid var(--muted);
    box-sizing: border-box;
    margin-top: 0; /* Ensure no overlap with fixed header */
}

/* Existing Content Styling */
.content-container {
    display: flex;
    justify-content: space-between;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
    overflow-y: auto;
    background-color: var(--light);
}

.column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.left-column, .right-column {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
}

.center-column {
    flex: 2;
    min-width: 300px;
    max-width: 500px;
}

.content-window {
    background-color: #fff;
    border: 3.5px solid var(--muted);
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-header {
    background: linear-gradient(to bottom, var(--muted) 0%, #ffffff 5%, rgba(var(--main), 1) 15%, var(--muted) 100%);
    height: 30px;
    display: flex;
    align-items: center;
    padding-left: 10px;
    color: #fff;
    font-family: var(--font-family);
    font-size: 16px;
    border-bottom: 2px solid #ccc;
    border-radius: 8px 8px 0 0;
}

.content-body {
    padding: 10px;
    font-family: var(--font-family);
    font-size: 16px;
    background-color: #fff;
    border-radius: 0 0 8px 8px;
    overflow-y: auto;
}

.main-info .content-body {
    text-align: center;
}

.small-window {
    min-height: 50px;
    max-height: 100px;
}


/* Адаптивность для мобильных устройств */
@media
 (max-width: 768px) {
    .icon-area {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
        padding: 10px;
        z-index: 10;
    }

    .icon {
        width: 80px;
        height: 80px;
    }
    
    .icon-img {
        width: 48px;
        height: 48px;
    }
    
    .icon-text {
        font-size: 12px;
    }
    
    .window {
        width: 90vw !important;
        height: 80vh !important;
        left: 5vw !important;
        top: 10vh !important;
        transform: none !important;
        resize: none;
    }
    
    .window.minimized {
        width: 150px !important;
        height: 30px !important;
    }
    
    .window-content {
        padding: 5px;
    }
    
    .window-content textarea,
    .window-content iframe {
        font-size: 16px;
    }
    
    /* Боковое меню */
    .folder-menu {
        width: 150px; /* Уменьшаем ширину меню */
        padding: 5px;
    }

    .folder-icon, .subfolder-icon {
        width: 20px;
        height: 20px;
    }

    .folder-name, .subfolder-name {
        font-size: 14px;
    }

    .subfolders {
        margin-left: 30px;
    }

    /* Галерея */
    .gallery-area {
        padding: 5px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Уменьшаем размер ячеек */
        gap: 10px;
    }

    .gallery-item img {
        width: 140px;
        height: 140px;
    }

    .gallery-item span {
        font-size: 12px;
    }

    /* Модальное окно */
    .modal-content {
        margin: 20px auto;
    }

    #modalImage {
        max-height: 70vh;
    }

    .prev-btn, .next-btn {
        font-size: 18px;
        padding: 5px;
    }

    .close-modal {
        top: 5px;
        right: 10px;
        font-size: 24px;
    }
    
    .content-container {
        flex-direction: column;
        align-items: center;
    }

    .column {
        width: 90%;
        max-width: none;
    }

    .left-column, .right-column, .center-column {
        min-width: 100%;
        max-width: 100%;
    }

}

