/* static/style.css */

:root {
    --bg-color: #050505;
    --card-bg: #111;
    --neon-blue: #00f3ff;
    --neon-purple: #bc13fe;
    --text-main: #fff;
    --text-muted: #888;
    --border-color: #333;
}

body { 
    background: var(--bg-color); 
    color: var(--text-main); 
    font-family: 'Montserrat', sans-serif; 
    margin: 0; 
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* --- НАВИГАЦИЯ --- */
nav { 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 15px 20px; 
    background: #000; 
    border-bottom: 2px solid var(--neon-purple); 
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo { 
    font-weight: 900; 
    font-size: 22px; 
    cursor: pointer; 
    letter-spacing: 1px;
} 
.logo span { color: var(--neon-blue); }

.links { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; }
.links button { 
    background: #222;
    border: 1px solid var(--border-color);
    color: #fff; 
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer; 
    transition: all 0.2s ease;
    white-space: nowrap;
}
.links button:hover { 
    background: var(--neon-blue); 
    color: #000; 
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}
#adminBtn {
    background: var(--neon-purple) !important;
    border-color: var(--neon-purple) !important;
    color: #fff !important;
}
#adminBtn:hover {
    box-shadow: 0 0 10px rgba(188, 19, 254, 0.4);
}

/* --- КОНТЕЙНЕР --- */
.app { 
    max-width: 600px; 
    margin: 0 auto; 
    padding: 20px; 
    padding-bottom: 80px;
}

/* --- СТРАНИЦЫ --- */
.page { display: none; } 
.page.active { display: block; animation: fade 0.3s ease-in-out; }
@keyframes fade { from{opacity:0; transform: translateY(10px);} to{opacity:1; transform: translateY(0);} }

/* --- АВТОРИЗАЦИЯ --- */
.auth-box { 
    background: var(--card-bg); 
    padding: 30px; 
    border-radius: 15px; 
    border: 1px solid var(--border-color); 
    text-align: center; 
    margin-top: 20px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.tab { 
    flex: 1; 
    background: none; 
    border: none; 
    color: #555; 
    padding: 15px; 
    font-weight: 900; 
    font-size: 16px;
    cursor: pointer; 
    transition: 0.2s;
}
.tab.active { color: var(--neon-blue); border-bottom: 3px solid var(--neon-blue); }

/* Поля ввода */
input[type="text"], input[type="password"], textarea { 
    width: 100%; 
    padding: 15px; 
    margin: 10px 0; 
    background: #000; 
    border: 1px solid var(--border-color); 
    color: #fff; 
    box-sizing: border-box; 
    border-radius: 8px; 
    font-size: 16px; 
    font-family: 'Montserrat', sans-serif;
    transition: 0.2s;
}
input:focus, textarea:focus { 
    border-color: var(--neon-blue); 
    outline: none; 
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.3);
}

/* Чекбокс правил */
.rules-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 15px 0;
    font-size: 14px;
    color: #aaa;
    text-align: left;
}
.rules-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--neon-blue);
}
.rules-container a {
    color: var(--neon-blue);
    text-decoration: none;
    border-bottom: 1px dashed var(--neon-blue);
    margin: 0 3px;
    transition: 0.2s;
}
.rules-container a:hover {
    color: #fff;
    border-bottom-color: #fff;
}

/* Статус аватарки */
#avatar-status {
    color: #00f3ff;
    font-size: 13px;
    margin-top: 5px;
    font-weight: bold;
    display: none; /* Скрыт по умолчанию */
    animation: fadeIn 0.3s;
}

/* Кнопки действий */
button.btn-main, button.btn-sec { 
    width: 100%; 
    padding: 16px; 
    margin-top: 15px; 
    font-weight: 900; 
    font-size: 16px;
    cursor: pointer; 
    border-radius: 8px; 
    border: none; 
    text-transform: uppercase; 
    transition: transform 0.1s, box-shadow 0.2s;
}
button.btn-main:active, button.btn-sec:active { transform: scale(0.98); }

.btn-main { 
    background: var(--neon-blue); 
    color: #000; 
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4); 
} 
.btn-main:hover {
    background: #fff;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.6);
}

.btn-sec { 
    background: var(--neon-purple); 
    color: #fff; 
    box-shadow: 0 0 10px rgba(188, 19, 254, 0.4); 
}
.btn-sec:hover {
    background: #d55eff;
    box-shadow: 0 0 15px rgba(188, 19, 254, 0.6);
}

/* --- АВАТАРКИ (ГЛАВНОЕ ИСПРАВЛЕНИЕ) --- */
.avatar {
    width: 40px; 
    height: 40px; 
    border-radius: 50%; /* Идеальный круг */
    object-fit: cover; /* Обрезка без искажений */
    border: 2px solid var(--border-color); 
    cursor: pointer; 
    transition: 0.2s;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
    flex-shrink: 0; /* Не сжимать аватарку */
}
.avatar:hover { 
    border-color: var(--neon-blue); 
    transform: scale(1.05);
}

.avatar-lg { 
    width: 100px; 
    height: 100px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 3px solid var(--neon-purple); 
    margin: 0 auto 15px auto; 
    display: block; 
    box-shadow: 0 0 15px rgba(188, 19, 254, 0.3);
}

/* --- ПРОФИЛЬ --- */
.profile-header {
    text-align: center; 
    padding: 20px; 
    background: var(--card-bg);
    border-radius: 15px; 
    margin-bottom: 20px; 
    border: 1px solid var(--border-color);
}
.profile-stats { 
    display: flex; 
    justify-content: center; 
    gap: 20px; 
    margin: 10px 0; 
    color: var(--text-muted); 
}
.profile-tabs { 
    display: flex; 
    border-bottom: 1px solid var(--border-color); 
    margin-top: 20px; 
}
.p-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    color: #666;
    font-weight: bold;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
}
.p-tab.active {
    color: #fff;
    border-bottom: 2px solid var(--neon-blue);
}

/* --- ПОСТЫ --- */
.post { 
    background: var(--card-bg); 
    padding: 15px; 
    margin-bottom: 20px; 
    border-radius: 12px; 
    border-left: 4px solid var(--neon-blue); 
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Шапка поста (Аватар + Имя) */
.post-author-info {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.post-author-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden; /* Скрываем лишнее */
}
.post-author-name {
    font-weight: bold;
    color: #fff;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Троеточие (...) */
    max-width: 200px; /* Ограничение ширины */
    cursor: pointer;
}
.post-date {
    font-size: 12px;
    color: #666;
}

.post h3 { 
    margin: 0 0 8px 0; 
    color: var(--neon-blue); 
    font-size: 18px; 
    line-height: 1.3; 
    word-wrap: break-word;
}
.post p { 
    line-height: 1.5; 
    font-size: 15px; 
    margin: 0; 
    word-wrap: break-word; 
    color: #ddd;
}
.post img.main-image { 
    width: 100%; 
    height: auto; 
    border-radius: 8px; 
    margin: 10px 0; 
    display: block;
}

/* Верификация */
.verified-badge { 
    color: var(--neon-blue); 
    margin-left: 4px; 
    font-size: 0.9em; 
    display: inline-block;
    vertical-align: middle;
}

/* --- КОММЕНТАРИИ --- */
.comments-section { 
    margin-top: 15px; 
    padding-top: 10px; 
    border-top: 1px solid #222; 
}
.comment { 
    background: #151515; 
    padding: 10px; 
    margin-bottom: 8px; 
    border-radius: 8px; 
    font-size: 0.9em; 
    border-left: 2px solid #333;
}
.comment-header { 
    display: flex; 
    align-items: center; 
    margin-bottom: 5px; 
}
.comment-author-name {
    font-weight: bold;
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    margin-right: 5px;
}
.comment-text { 
    color: #ddd; 
    word-wrap: break-word; 
    margin-left: 0; 
}
.banned-comment { 
    color: #666; 
    font-style: italic; 
    font-size: 0.9em; 
}

.comment-input-area { 
    display: flex; 
    gap: 10px; 
    margin-top: 10px; 
}
.comment-input { 
    flex: 1; 
    padding: 8px; 
    background: #222; 
    border: 1px solid #333; 
    color: #fff; 
    border-radius: 4px; 
    font-size: 14px;
}
.comment-input:focus {
    border-color: var(--neon-blue);
    outline: none;
}

/* --- АДМИНКА --- */
.admin-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: #1a1a1a; 
    padding: 12px; 
    margin-bottom: 8px; 
    border-radius: 8px; 
    border: 1px solid #333;
}
.adm-btn { 
    padding: 6px 12px; 
    border: 1px solid #444; 
    background: #000; 
    color: #fff; 
    cursor: pointer; 
    margin-left: 5px; 
    border-radius: 6px;
    font-size: 12px;
    transition: 0.2s;
}
.adm-btn:hover { opacity: 0.8; }
.ban { color: #ff4444; border-color: #ff4444; } 
.ver { color: var(--neon-blue); border-color: var(--neon-blue); } 

/* --- РЕДАКТОР --- */
.editor-toolbar { display: flex; gap: 5px; margin-bottom: 5px; }
.tool-btn { 
    background: #222; 
    border: 1px solid #444; 
    color: #fff; 
    padding: 5px 10px; 
    cursor: pointer; 
    border-radius: 4px; 
    font-size: 14px;
}
.tool-btn:hover { background: #333; }

#msg { 
    color: #ff0055; 
    font-weight: bold; 
    min-height: 20px; 
    margin-top: 10px; 
    font-size: 14px; 
    text-align: center;
}

/* --- МОБИЛЬНАЯ АДАПТАЦИЯ --- */
@media (max-width: 480px) {
    nav { padding: 10px 15px; }
    .logo { font-size: 18px; }
    .links button { font-size: 12px; padding: 6px 12px; }
    
    .auth-box { padding: 20px 15px; margin-top: 10px; }
    
    .avatar {
        width: 32px;
        height: 32px;
        margin-right: 8px;
    }
    
    .post-author-name {
        max-width: 140px;
        font-size: 14px;
    }
    
    .comment-author-name {
        max-width: 100px;
        font-size: 12px;
    }
}