/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-hover: #252525;
    --border: #333;
    --text: #e0e0e0;
    --text-muted: #888;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --danger: #ef4444;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

/* Header */
.header {
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.logo-icon {
    font-size: 32px;
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
}

.logo-text p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    color: var(--text);
}

/* Search */
.search-box input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Main */
.main {
    flex: 1;
    padding: 20px 0;
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 16px;
}

/* Create Form */
.create-form {
    margin-bottom: 20px;
}

.create-form input,
.create-form textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    margin-bottom: 12px;
    font-family: inherit;
}

.create-form input:focus,
.create-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.create-form textarea {
    min-height: 120px;
    resize: vertical;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab {
    flex: 1;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Thread Card */
.thread-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.thread-card:hover {
    border-color: var(--primary);
}

.thread-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    padding-right: 40px;
}

.thread-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thread-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.thread-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

.thread-card:hover .delete-btn {
    opacity: 1;
}

.delete-btn:hover {
    color: var(--danger);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Thread Detail */
.back-btn {
    margin-bottom: 16px;
}

.thread-detail {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.thread-detail h1 {
    font-size: 24px;
    margin-bottom: 12px;
}

.thread-detail .meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.thread-detail .content {
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Replies Section */
.replies-section {
    margin-top: 20px;
}

.replies-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.replies-header h2 {
    font-size: 18px;
}

/* Reply Form */
.reply-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.reply-form textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    min-height: 80px;
    resize: vertical;
    margin-bottom: 12px;
    font-family: inherit;
}

.reply-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.reply-form .actions {
    display: flex;
    gap: 10px;
}

/* Reply Card */
.reply-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
}

.reply-card .header {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    position: static;
    background: none;
    border: none;
    padding: 0;
}

.reply-card .author {
    color: var(--text);
    font-weight: 500;
}

.reply-card .content {
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 10px;
}

.reply-card .actions {
    display: flex;
    gap: 10px;
}

.reply-card .btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* Nested Replies */
.nested-replies {
    margin-left: 20px;
    margin-top: 12px;
    padding-left: 16px;
    border-left: 2px solid var(--border);
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 16px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Mobile */
@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .logo-text h1 {
        font-size: 18px;
    }
    
    .thread-meta {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nested-replies {
        margin-left: 10px;
        padding-left: 10px;
    }
    
    .delete-btn {
        opacity: 1;
    }
/* Добавить в конец style.css */
#authInputs input {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
}

#authInputs input:focus {
    border-color: var(--primary);
    outline: none;
}

#userProfile p {
    font-size: 14px;
    color: var(--text);
}

#currentNickDisplay {
    color: var(--primary);
}
.auth-input {
    width: 100%;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    margin-bottom: 10px;
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary);
}
}
