/* ==========================================================================
   SKLO MESSENGER - FULL STYLESHEET
   ========================================================================== */

:root {
    --bg-dark: #030712;
    --accent-blue: #3b82f6;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-muted: rgba(255, 255, 255, 0.4);
    --border-dark: #1e293b;
    --panel-bg: #0f172a;
    --chat-bg: #020617;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--bg-dark);
    height: 100vh;
    width: 100vw;
    font-family: 'Inter', -apple-system, sans-serif;
    overflow: hidden;
    color: #fff;
}

/* ==========================================================================
   1. BACKGROUND EFFECTS (GLOW BLOBS)
   ========================================================================== */
.glow-blob {
    position: fixed;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    filter: blur(50px);
    z-index: 1;
    top: 20%;
    left: 20%;
    animation: blob-float 20s infinite alternate ease-in-out;
    pointer-events: none;
}

.blob-2 {
    background: radial-gradient(circle, rgba(147, 51, 234, 0.1) 0%, transparent 70%);
    top: 50%;
    left: 60%;
    animation-delay: -5s;
}

@keyframes blob-float {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(100px, 50px);
    }
}


/* ==========================================================================
   2. CONNECTION STATUS INDICATOR (HEARTBEAT)
   ========================================================================== */
#connection-indicator {
    position: fixed;
    top: 20px;
    right: 25px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.15em;
    padding: 8px 14px;
    border-radius: 30px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

#connection-indicator.status-pending .status-dot,
#connection-indicator.status-err .status-dot {
    background: #f43f5e;
    box-shadow: 0 0 8px #f43f5e;
    animation: pulse-heartbeat 1.2s infinite ease-in-out;
}

#connection-indicator.status-ok .status-dot {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

@keyframes pulse-heartbeat {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    30% {
        transform: scale(1.4);
        opacity: 0.8;
    }
}


/* ==========================================================================
   3. AUTHENTICATION OVERLAY (GLASSMORPHISM)
   ========================================================================== */
#auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    /* Перекрывает всё приложение */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Идеально чистое матовое стекло (без глючных внутренних рамок) */
.auth-box {
    position: relative;
    width: 380px;
    padding: 45px;
    z-index: 10;
    overflow: hidden;
    /* Важно для блика */

    background: var(--glass-bg);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-radius: 32px;
    border: 1px solid var(--glass-border);

    box-shadow:
        inset 1px 1px 0px rgba(255, 255, 255, 0.1),
        /* Легкий свет на грани */
        0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

/* Бегущий световой блик по стеклу */
.auth-box::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -150%;
    width: 150%;
    height: 200%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(35deg);
    animation: single-shine 2.5s 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

@keyframes single-shine {
    from {
        left: -150%;
    }

    to {
        left: 150%;
    }
}

/* Поля ввода и кнопки в авторизации */
.auth-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 500;
}

.auth-input {
    width: 100%;
    padding: 15px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #fff;
    outline: none;
    position: relative;
    z-index: 5;
    transition: all 0.2s;
}

.auth-input:focus {
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.6);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: var(--accent-blue);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    z-index: 5;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

/* Chromatic Aberration Effect на фокус */
.auth-input:focus,
.btn-primary:hover {
    text-shadow: 1px 0px 1px rgba(255, 0, 0, 0.5), -1px 0px 1px rgba(0, 0, 255, 0.5);
}


/* ==========================================================================
   4. SVG LOGO ANIMATION (ИДЕАЛЬНАЯ ЦЕНТРОВКА)
   ========================================================================== */
.logo-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 35px;
}

.sklo-svg-logo {
    width: 100%;
    max-width: 240px;
    /* Здесь регулируешь размер букв */
    height: auto;
    display: block;
    overflow: visible;
}

.draw-path {
    stroke: #ffffff;
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
    animation: draw-sklo 4s 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes draw-sklo {
    0% {
        stroke-dashoffset: 3000;
        fill: rgba(255, 255, 255, 0);
    }

    75% {
        stroke-dashoffset: 0;
        fill: rgba(255, 255, 255, 0);
    }

    100% {
        stroke-dashoffset: 0;
        fill: rgba(255, 255, 255, 1);
    }
}


/* ==========================================================================
   5. MAIN MESSENGER APP (РАСПОЛОЖЕНИЕ И ВЕРСТКА)
   ========================================================================== */
#main-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    position: relative;
    z-index: 5;
    /* Под оверлеем авторизации */
}

.sidebar {
    width: 320px;
    background: var(--panel-bg);
    border-right: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
}

.sidebar-section {
    padding: 25px;
    border-bottom: 1px solid var(--border-dark);
}

.section-title {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.avatar {
    width: 42px;
    height: 42px;
    background: var(--accent-blue);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.profile-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.alias-text {
    font-size: 15px;
    font-weight: 600;
}

.id-meta {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.profile-actions {
    display: flex;
    gap: 8px;
}

.header {
    padding: 20px 35px;
    border-bottom: 1px solid var(--border-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--panel-bg);
}

.chat-title {
    font-weight: 700;
    font-size: 16px;
}

.safety-number {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
    margin-top: 4px;
}

.crypto-badge {
    font-size: 11px;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.messages {
    flex: 1;
    padding: 35px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-box {
    padding: 14px 18px;
    border-radius: 20px 20px 20px 5px;
    background: var(--border-dark);
    max-width: 70%;
    align-self: flex-start;
    line-height: 1.5;
    font-size: 14.5px;
}

.message-box.self {
    background: var(--accent-blue);
    align-self: flex-end;
    border-radius: 20px 20px 5px 20px;
}

.message-box small {
    display: block;
    color: var(--accent-blue);
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 10px;
    text-transform: uppercase;
}

.message-box.self small {
    color: rgba(255, 255, 255, 0.7);
}

.input-area {
    padding: 25px 35px;
    background: var(--panel-bg);
    border-top: 1px solid var(--border-dark);
    display: flex;
    gap: 15px;
}

.input-area input {
    flex: 1;
    padding: 15px 25px;
    background: var(--chat-bg);
    border: 1px solid var(--border-dark);
    border-radius: 35px;
    color: #fff;
    outline: none;
    font-size: 15px;
    transition: border 0.2s;
}

.input-area input:focus {
    border-color: var(--accent-blue);
}

#send-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

#send-btn:hover:not(:disabled) {
    background: #2563eb;
    transform: scale(1.05);
}

#send-btn:disabled {
    background: #334155;
    color: #64748b;
    cursor: not-allowed;
}

/* Утилиты и Контакты */
.hidden {
    display: none !important;
}

.w100 {
    width: 100%;
}

.mb8 {
    margin-bottom: 8px;
}

.clean-input {
    width: 100%;
    padding: 12px;
    background: var(--chat-bg);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    color: #fff;
    margin-bottom: 10px;
    outline: none;
}

.clean-input:focus {
    border-color: var(--accent-blue);
}

.btn-secondary {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-primary-outline {
    padding: 12px;
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: 0.2s;
}

.btn-primary-outline:hover {
    background: var(--accent-blue);
    color: #fff;
}

.contact-item {
    padding: 12px 0;
    cursor: pointer;
    border-bottom: 1px solid var(--border-dark);
    transition: 0.2s;
}

.contact-item:hover {
    padding-left: 8px;
}

.contact-item strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.contact-item small {
    display: block;
    color: var(--text-muted);
    font-size: 10px;
    font-family: monospace;
}
