/* любопытной варваре нос на базаре оторвали :). */

body {
    font-family: var(--font-main);
    margin: 0; display: flex; height: 100vh;
    overflow: hidden;
}


.main-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.logo-img { 
    height: auto;
    max-width: 60%;
    align-items: center;
    margin: 40px auto 40px auto;
}

.top-bar {
    display: none;
}

.bottom-taskbar { display: none; }

.sidebar {
    width: 280px; background-color: var(--accent2);
    backdrop-filter: blur(10px);
    display: flex; flex-direction: column;
    padding: 10px; box-sizing: border-box; flex-shrink: 0;
    border-right: var(--border-color) 1px solid;
}

.sidebar-content {
    flex-grow: 1; display: flex; flex-direction: column;
}

.sidebar-btn {
    border: none;
    background: none;
    font-size: 15px; color: var(--text-muted);
    font-weight: 600; cursor: pointer;
    text-align: left; margin-bottom: 5px; width: 100%; display: flex;
    align-items: center; gap: 10px; padding: 6px 10px; height: 45px;
    font-family: var(--font-main);
}

.sidebar-btn img {
    filter: var(--icon-filter);
    transition: filter 0.4s ease;
    margin-left: 2.5px; width: 32px; height: auto;
}

.sidebar-btn img.nav-avatar-icon.is-custom {
    filter: none !important; 
    border-radius: 50%;
    object-fit: cover;
    width: 28px; /* Чуть меньше, чтобы не ломать строку */
    height: 28px;
    border: 1px solid var(--border-color);
}


.sidebar-btn.active-nav span {
    font-weight: bold;
}

.sidebar-btn.selected img {
    filter: var(--icon-active-filter);
}

.sidebar-btn.selected span {
    font-weight: bold;
    color: var(--text-main);
}


/* feed */
.feed-scroll {
    flex-grow: 1; overflow-y: auto; padding: 40px 20px;
    display: flex; flex-direction: column; align-items: center; gap: 40px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px; 
    
    margin-bottom: 8px;
    box-sizing: border-box; 
    position: relative;
    margin-right: 20px;
    gap: 15px;
}

.post-options-btn {
    width: 24px;
    height: 24px;

    background-color: var(--accent3);
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    
    justify-content: center;
    border-radius: 5px;
    align-items: center;
}


.post-options-menu {
    display: none;
    top: 50px;
    right: 0px;
    position: absolute;
    background: var(--accent2);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 100;
    min-width: 150px;
    overflow: hidden;
    justify-content: center;
    align-items: center;
    padding: 5px;
}

.post-options-menu.active {
    display: flex;
}

.post-options-btn img {
    filter: var(--icon-active-filter);
    width: 14px;
}

.delete-menu-item {
    width: 150px;
    background: var(--accent3);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: 10px;
    padding: 8px 12px;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.delete-menu-item img {
    filter: var(--icon-active-filter);
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    min-height: 32px;
}

.post-title {
    font-size: 1.5rem;
    color: var(--text-main);
    margin: 25px 50px 30px 30px;
    text-transform: uppercase;
    font-family: var(--font-title);
    text-shadow: 2px 3px #d400ffc0;
    line-height: 1.2;
}

.post-text {
    color: var(--text-main);
    font-size: 1.2rem;
    line-height: 1.2;
    margin-right: 30px;
    margin-bottom: 25px;
    margin-left: 30px;
}

.post-date {
    margin-left: auto;
    font-size: 15px;
    color: #808080;
    font-weight: 600;
}

.post-layout { width: 100%; max-width: 930px; position: relative; }

.post-window { width: 100%; overflow: visible !important; 
    background-color: var(--accent2);
    border: 1px solid; border-color: var(--border-color);
    border-radius: 25px;
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    width: 100%;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-color, var(--text-main));
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* misc */
.bg-lights {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    background-color: var(--bg-body);
    overflow: hidden;
    transition: background-color 0.5s ease;
}

.light-sphere {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw; height: 60vw;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
}

.s1 {
    background: radial-gradient(circle, var(--sphere-1) 0%, transparent 70%);
    animation: orbit1 20s infinite linear;
}

.s2 {
    background: radial-gradient(circle, var(--sphere-2) 0%, transparent 70%);
    animation: orbit2 25s infinite linear;
}

.s3 {
    background: radial-gradient(circle, var(--sphere-3) 0%, transparent 70%);
    animation: orbit3 18s infinite linear;
}

.button {
    width: 100%;
    background: var(--accent3);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.button:hover {
    background: var(--accent2);
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox.active img {
    animation: zoomIn 0.2s ease-out;
}

.lightbox img {
    width: auto;
    height: auto;
    min-width: 60%;
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
}

.carousel-container {
    position: relative;
    padding: 2px;
    background: #b0b0b0;
}

.carousel-img {
    width: 100%;
    height: auto;
    display: block;
}

.overlay {
    display: flex;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.carousel-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px;
    background: #c0c0c0;
    border-top: 1px solid #808080;
    font-family: "Arial", sans-serif;
    font-size: 12px;
}

.carousel-btn {
    min-width: 30px;
    height: 20px;
    padding: 0;
    cursor: pointer;
}

.carousel-counter {
    font-weight: bold;
}

.media-viewport {
    background-color: #b0b0b0; margin-bottom: 15px;
}

.image-container img {
    width: 100%; height: auto; display: block;
}

.image-viewport {
    background-color: #b0b0b0; margin-bottom: 15px;
}

.admin-input {
    width: 100%;
    background: var(--accent2);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 15px;
    color: var(--text-main);
    font-family: var(--font-main);
    outline: none;
    box-sizing: border-box;
}

.admin-input:focus {
    border-color: var(--text-main);
    box-shadow: 0 0 10px rgba(212, 0, 255, 0.2);
}

.admin-add-btn {
    background: var(--accent2);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
    transition: 0.3s;
}

.admin-add-btn:hover {
    color: var(--text-main);
    border-color: var(--text-main);
    transform: translateY(-2px);
}

.admin-add-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
}

.admin-post-btns {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    margin-right: 15px;
}

.admin-post-btns button {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-main);
    padding: 5px 10px;
    cursor: pointer;
    transition: 0.2s;
}

.editor-block {
    border: 1px dashed #444;
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 15px;
    background: rgba(255,255,255,0.02);
}

.blocks-scroll-area {
    width: 350px;
    height: 200px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.blocks-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.news-checkbox-label-custom {
    display: flex; 
    align-items: center; 
    gap: 8px; 
    margin-bottom: 15px; 
    cursor: pointer; 
    color: var(--text-muted); 
    font-size: 0.9rem;
}

.editor-block-header {
    display: flex; justify-content: space-between;
    margin-bottom: 10px; align-items: center;
}

.block-type-label {
    font-size: 10px; color: #666; font-weight: bold; letter-spacing: 1px;
}

.block-delete-btn {
    background: none; border: none;
    color: #ff4d4d; cursor: pointer; font-size: 13px;
}


.new-posts-checker {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 15px 16px;
    border-radius: 10px;
    background: var(--green-accent);
    color: var(--text-main);
    border: none;
    cursor: pointer;
    font-weight: bold;
    display: none;
    font-family: var(--font-main);
}

.pull-to-refresh-loader {
    position: fixed;
    top: -80px;
    left: 0;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.1s ease, opacity 0.2s ease;
}

.ptr-spinner {
    width: 45px;
    height: 45px;
    background: var(--green-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ptr-spinner::after {
    content: "";
    width: 20px;
    height: 20px;
    border: 3px solid var(--text-muted);
    border-top-color: var(--text-main);
    border-radius: 50%;
}

.ptr-refreshing .ptr-spinner::after {
    animation: ptr-spin 0.8s linear infinite;
}

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    min-width: 200px;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 18px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    opacity: 0;
    pointer-events: auto;
}

.toast-item.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--green-accent);
    border-radius: 6px;
    font-size: 12px;
}

.toast-text {
    font-size: 14px;
    font-weight: 500;
}



@media (max-width: 800px) {
    body { flex-direction: column; }

    .sidebar { display: none !important; }

    .new-posts-checker {
        margin-top: 60px;
    }

    .top-bar {
        display: flex;
        position: fixed;
        top: 0;
        z-index: 1010;

        background-color: var(--accent2);
        backdrop-filter: blur(10px);

        height: 60px;
        
        padding: 0 8px;
        margin-bottom: auto;
        align-items: center;
        border-bottom: 2px solid var(--border-color);
    }


    .logo-img { 
        image-rendering: pixelated;
        height: auto;
        max-width: 25%;
        align-items: center;
        margin: 40px auto 40px auto;
    }

    .bottom-taskbar {
        display: flex;
        position: fixed;
        bottom: 0; left: 0;
        width: 100%; height: 65px;
        padding: 5px;
        box-sizing: border-box;
        z-index: 1010;
        border-top: var(--border-color) 2px solid;
        backdrop-filter: blur(10px);
        gap: 5px;
        background-color: var(--accent2);
    }
    
    .bottom-taskbar .sidebar-btn {
        margin-bottom: 0;
        height: 100%;
        flex: 1;
        flex-direction: column; 
        justify-content: center;
        align-items: center;
        border: none;
        font-size: 10px; 
        color: var(--text-muted);
        font-weight: 600;
        gap: 5px;
        padding: 2px 2px;
        text-align: center;
        border-radius: 12px;
        transition: all 0.3s ease
    }

    .bottom-taskbar .sidebar-btn.selected {
        color: var(--text-main);
    }

    .bottom-taskbar img {
        margin-left: 0;
        filter: var(--icon-filter);
        transition: filter 0.4s ease;
        width: 28px; height: auto;
    }   

    .bottom-taskbar .sidebar-btn.selected img {
        filter: var(--icon-active-filter);
        transform: scale(1.1);
    }

    .bottom-taskbar .sidebar-btn.selected span {
        font-weight: bold;
        color: var(--text-main);
    }

    .main-container { height: calc(100dvh - 60px); }
    .feed-scroll { padding: 80px 0px 140px 0px; align-items: center; justify-content: flex-start; -webkit-overflow-scrolling: touch; }
    .feed-scroll::-webkit-scrollbar { display: none; }
    .post-layout { width: 100%; max-width: 100%; box-sizing: border-box; display: flex; justify-content: center; }
    .post-text { font-size: 1rem; }
    .post-window { margin: 0 auto; border-radius: 0px; border: none; }
    .post-date { text-align:right; font-size:15px; }
    .media-viewport { width: 100%; height: auto; }
}