/* ===============================================
   CIPHER — АРХИТЕКТУРА И КАРКАС
   Геометрия основных блоков (только ID)
   =============================================== */

/* ИНТЕРФЕЙС ПРИЛОЖЕНИЯ */
#app-interface {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
}

#app-interface > * {
    pointer-events: auto;
}

/* Background Layer */
#app-interface::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/ios-13-stock-ipados-red-black-background-amoled-hd-3208x3208-799.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    filter: blur(15px);
}

/* ===============================================
   GLOBAL HEADER
   height: 65px
   position: absolute
   отступы: top: 20px, left: 30px, right: 30px
   =============================================== */

.global-header {
    position: absolute;
    top: 20px;
    left: 30px;
    right: 30px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 50;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}



/* ===============================================
   SPOTLIGHT SEARCH
   строго по центру хедера
   left: 50%; transform: translateX(-50%)
   ширина: 350px
   =============================================== */

.spotlight-search {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    max-width: 250px;
    z-index: 60;
}

.spotlight-input-wrapper {
    width: 250px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    transition: all 0.2s ease;
}

.spotlight-input-wrapper:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.spotlight-input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(104, 155, 230, 0.5);
    box-shadow: 0 0 0 3px rgba(104, 155, 230, 0.15);
}

.spotlight-icon {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

#spotlight-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    outline: none;
    min-width: 0;
}

#spotlight-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.spotlight-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(30, 30, 35, 0.95);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.spotlight-dropdown.active {
    width: 250px;
    max-height: 300px;
    opacity: 1;
    visibility: visible;
    padding: 8px;
}

.spotlight-results {
    max-height: 284px;
    overflow-y: auto;
}

.spotlight-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.spotlight-result-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.spotlight-result-item i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.spotlight-result-item .result-icon-blue {
    color: var(--primary-blue);
}

.spotlight-result-item .result-icon-muted {
    color: var(--text-muted);
}

.spotlight-result-item span {
    font-size: 14px;
    color: var(--text-primary);
}

/* ===============================================
   SIDEBAR — DOCK-STYLE ISLAND
   left: 30px, top: 105px (20px + 65px + 20px)
   =============================================== */

.sidebar-dock {
    position: absolute;
    left: 30px;
    top: 105px;
    width: 60px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 10px 0;
    z-index: 40;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.sidebar-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.sidebar-btn.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.sidebar-btn i {
    width: 22px;
    height: 22px;
}

/* CENTRAL CONTENT — УДАЛЁН
   Заменён на независимое позиционирование .content-view
*/

/* CHATS COLUMN */
.chats-column {
    width: 400px;
    min-width: 320px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    flex-direction: column;
    overflow: hidden;
}

.chats-column-header {
    padding: 20px 20px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chats-column-header h2 {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.chats-list-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
}

/* MESSAGES COLUMN */
.messages-column {
    flex: 1;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    margin-left: 12px;
    overflow: hidden;
}

.messages-column-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.messages-header {
    height: 65px;
    min-height: 65px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.back-button {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.12);
}

.back-button i {
    width: 20px;
    height: 20px;
}

.chat-header-info {
    flex: 1;
}

#chat-partner-name {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-status-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.messages-composer {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 14px;
    align-items: center;
}

.messages-composer input {
    flex: 1;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    transition: all 0.2s ease;
}

.messages-composer input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.messages-composer input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* SIDE PANELS - Legacy (deprecated, replaced by glass-panel-centered) */
.side-panel {
    display: none;
}

.side-panel.active {
    display: none; /* Перекрывается glass-panel-centered */
}

/* PROFILE PANEL SPECIFIC - в glass-panel-centered */
.profile-info {
    text-align: center;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.profile-avatar i {
    width: 36px;
    height: 36px;
    color: var(--text-primary);
}

.profile-details {
    text-align: left;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
}

.profile-details p {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.profile-details strong {
    color: var(--text-primary);
}

.logout-button {
    width: 100%;
    padding: 14px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 12px;
    color: var(--text-error);
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.logout-button:hover {
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.3);
}

.logout-button i {
    width: 18px;
    height: 18px;
}

/* EMPTY STATE */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
}

.empty-state.is-hidden {
    display: none;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-state-icon i {
    width: 28px;
    height: 28px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.empty-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(104, 155, 230, 0.15);
    border: 1px solid rgba(104, 155, 230, 0.3);
    border-radius: 12px;
    color: var(--primary-blue);
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.empty-action-btn:hover {
    background: rgba(104, 155, 230, 0.2);
    border-color: rgba(104, 155, 230, 0.5);
}

.empty-action-btn i {
    width: 18px;
    height: 18px;
}

/* TOAST NOTIFICATION */
.glass-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(30, 30, 35, 0.9);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 14px 24px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* SPOTLIGHT BACKDROP */
.spotlight-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.164);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 200;
}

.spotlight-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ===============================================
   PREMIUM POST COMPOSER STYLES
   =============================================== */

.post-composer-premium {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    min-height: 200px;
    max-height: none;
    transition: min-height 0.3s ease;
}

.post-composer-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 20%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 80%, 
        transparent 100%);
}

/* Top section with user profile */
.composer-top {
    margin-bottom: 16px;
}

.user-profile-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-gradient {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8A2BE2 0%, #00D4FF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
}

.avatar-gradient::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8A2BE2 0%, #00D4FF 100%);
    opacity: 0.5;
    filter: blur(8px);
    z-index: -1;
}

.initials {
    color: white;
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-family);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.user-data {
    display: flex;
    align-items: center;
    height: 48px;
}

.name-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.name {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-family);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #51cf66;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.status-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-family: var(--font-family);
}

/* Input section */
.input-wrapper {
    margin-bottom: 5px;
}

#post-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    resize: none;
    min-height: 20px;
    font-family: var(--font-family);
    font-size: 1.1rem;
    line-height: 1.5;
    outline: none;
    padding: 0;
    margin-top: 20px;
    margin-bottom: 20px;
}

#post-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
}

/* Bottom section with tools and button */
.composer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.action-tools {
    display: flex;
    gap: 8px;
}

.icon-tool {
    width: 33px;
    height: 33px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.icon-tool:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.icon-tool i {
    width: 18px;
    height: 18px;
}

/* Tooltip */
.icon-tool[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    margin-bottom: 8px;
    z-index: 10;
}

.icon-tool[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    margin-bottom: 4px;
    z-index: 10;
}

.send-group {
    display: flex;
    align-items: center;
    gap: 12px;
}



.glow-button {
    width: 140px;
    height: 33px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glow-button.is-active {
    background: #51cf66;
    border-color: #51cf66;
    color: white;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

.glow-button.is-active:hover {
    background: #40be55;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    transform: translateY(-1px);
}

.glow-button.is-active:active {
    transform: translateY(0);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.4);
}

.glow-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#posts-feed {
    margin-top: 20px;
}

/* ===============================================
   PREMIUM POST ANIMATIONS
   =============================================== */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.premium-post {
    opacity: 0;
    transform: translateY(20px);
}

.premium-post:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* SCROLLBARS */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* VIEW STATES */
.view {
    display: none;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.view.active {
    display: flex;
}

.is-hidden {
    display: none !important;
}



/* CHAT ITEM — ONLINE INDICATOR */
.chat-item .online-indicator {
    display: none;
}

.chat-item .online-indicator.is-online {
    display: block;
}

/* CHATS SKELETON (for loading state) */
#chats-skeleton {
    display: none;
}

#chats-skeleton.active {
    display: block;
}

/* ===============================================
   CHAT VIEW FLEX (replaces inline style)
   =============================================== */

.chat-view-flex {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ===============================================
   SIDE PANEL PLACEHOLDER (replaces inline style)
   =============================================== */

.side-panel-placeholder {
    color: var(--text-muted);
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

/* ===============================================
   MAIN CONTENT AREA — УДАЛЁН
   Заменён на независимое позиционирование .content-view
   =============================================== */
