/* style.css - Discord-подобный дизайн для Conan Exiles Social */
:root {
    --primary: #5865f2;
    --primary-dark: #4752c4;
    --primary-light: #7983f5;
    --bg-dark: #1e1f22;
    --bg-card: #2b2d31;
    --bg-elevated: #2b2d31;
    --bg-input: #1e1f22;
    --border: #1e1f22;
    --text: #dbdee1;
    --text-secondary: #b5bac1;
    --text-muted: #80848e;
    --success: #23a55a;
    --error: #da373c;
    --danger: #da373c;
    --warning: #faa81a;
    --info: #5865f2;
    --gradient: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.5;
    font-size: 16px;
}

/* ============ TOAST УВЕДОМЛЕНИЯ ============ */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-elevated);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: var(--shadow);
    animation: slideIn 0.2s ease;
    font-size: 14px;
    border-left: 4px solid var(--info);
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--error); }
.toast-info { border-left-color: var(--primary); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============ АВТОРИЗАЦИЯ ============ */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
}

.auth-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow);
}

.auth-brand {
    text-align: center;
    margin-bottom: 32px;
}

.auth-brand i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 12px;
}

.auth-brand h1 {
    font-size: 24px;
    font-weight: 600;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-brand p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-input);
    padding: 4px;
    border-radius: 40px;
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.auth-tab:hover {
    background: rgba(88, 101, 242, 0.2);
}

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

.auth-tab.active:hover {
    background: var(--primary-dark);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.input-icon {
    position: relative;
    margin-bottom: 20px;
}

.input-icon i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.input-icon input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 16px;
    transition: border 0.2s;
}

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

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

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

.error-msg {
    margin-top: 16px;
    padding: 10px;
    background: rgba(218, 55, 60, 0.1);
    border-radius: 8px;
    color: var(--error);
    font-size: 14px;
    text-align: center;
}

/* ============ ОСНОВНОЙ ИНТЕРФЕЙС ============ */
.top-nav {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
}

.logo i {
    color: var(--primary);
    font-size: 24px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.nav-link i {
    font-size: 18px;
}

.nav-link:hover {
    background: var(--bg-elevated);
    color: var(--text);
}

.nav-link.active {
    background: var(--bg-elevated);
    color: var(--primary);
}

.badge {
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 20px;
    margin-left: 6px;
    display: inline-block;
}

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

.avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    background-size: cover;
    background-position: center;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.icon-btn:hover {
    background: var(--bg-elevated);
    color: var(--danger);
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
}

/* ============ ОСНОВНОЙ КОНТЕЙНЕР ============ */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.page {
    display: none;
    animation: fadeIn 0.2s ease;
}

.page.active {
    display: block;
}

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

/* ============ СОЗДАНИЕ ПОСТА ============ */
.create-post-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.post-input-area {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.avatar-md {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

#postText {
    flex: 1;
    background: var(--bg-input);
    border: none;
    border-radius: 8px;
    padding: 12px;
    color: var(--text);
    font-family: inherit;
    resize: none;
    font-size: 14px;
}

#postText:focus {
    outline: none;
}

.post-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.image-preview-area {
    flex: 1;
}

.image-preview {
    position: relative;
    display: inline-block;
}

.image-preview img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.remove-preview {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    color: white;
    cursor: pointer;
    font-size: 12px;
}

/* ============ ПОСТЫ ============ */
.post-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: background 0.2s;
}

.post-card:hover {
    background: #2e3036;
}

.post-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.post-author-info {
    flex: 1;
}

.post-author {
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.post-author:hover {
    color: var(--primary);
}

.admin-badge {
    color: var(--primary);
    font-size: 12px;
}

.post-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.delete-post-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.delete-post-btn:hover {
    color: var(--danger);
    background: var(--bg-elevated);
}

.post-content {
    margin-bottom: 12px;
}

.post-text {
    line-height: 1.5;
    word-wrap: break-word;
    font-size: 15px;
}

.post-image {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.post-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.post-stats {
    display: flex;
    gap: 16px;
    padding: 8px 0;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.stat-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    user-select: none;
}

.stat-btn:hover {
    background: var(--bg-elevated);
}

.stat-btn.liked {
    color: var(--danger);
}

.comments-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.comment {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.avatar-xs {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.comment-content {
    flex: 1;
    background: var(--bg-input);
    padding: 8px 12px;
    border-radius: 12px;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    cursor: pointer;
    user-select: none;
}

.comment-author:hover {
    color: var(--primary);
}

.comment-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.comment-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

.comment-form {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.comment-form input {
    flex: 1;
    background: var(--bg-input);
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 13px;
}

.comment-form button {
    padding: 8px 16px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    user-select: none;
}

.comment-form button:hover {
    background: var(--primary-dark);
}

/* ============ ПРОФИЛЬ ============ */
.profile-header {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background-size: cover;
    background-position: center;
}

.profile-header h1 {
    font-size: 24px;
    margin-bottom: 12px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 20px;
}

.stat {
    text-align: center;
}

.stat strong {
    font-size: 20px;
    color: var(--primary);
}

.profile-bio {
    max-width: 500px;
    margin: 0 auto 20px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: 8px;
    color: var(--text-secondary);
}

.profile-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.follow-btn, .edit-btn {
    padding: 8px 20px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.follow-btn:hover, .edit-btn:hover {
    background: var(--primary-dark);
}

.follow-btn.following {
    background: var(--success);
}

/* ============ ПОИСК ============ */
.search-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 24px;
}

.search-hero i {
    color: var(--text-muted);
}

.search-hero input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 16px;
    outline: none;
}

.search-section {
    margin-bottom: 24px;
}

.search-section h3 {
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.search-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.search-user:hover {
    background: var(--bg-elevated);
}

.search-post {
    padding: 12px;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.search-post:hover {
    background: var(--bg-elevated);
}

.search-post-text {
    margin-bottom: 6px;
    font-size: 14px;
}

.search-post-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============ УВЕДОМЛЕНИЯ ============ */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: 12px;
}

.notification-item.unread {
    background: rgba(88, 101, 242, 0.1);
    border-left: 3px solid var(--primary);
}

.notif-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-input);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.notif-content {
    flex: 1;
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============ АДМИН ПАНЕЛЬ ============ */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-card i {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 8px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
}

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.admin-tab {
    background: transparent;
    border: none;
    padding: 10px 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    user-select: none;
}

.admin-tab:hover {
    color: var(--primary);
}

.admin-tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.admin-panel {
    display: none;
}

.admin-panel.active {
    display: block;
}

.admin-user, .admin-post {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: var(--bg-card);
    border-radius: 10px;
    margin-bottom: 10px;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-user-info, .admin-post-info {
    flex: 1;
}

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

.make-admin-btn, .delete-user-btn, .delete-post-btn-admin {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}

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

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

.delete-user-btn, .delete-post-btn-admin {
    background: var(--danger);
    color: white;
}

.delete-user-btn:hover, .delete-post-btn-admin:hover {
    background: #b02a2e;
}

/* ============ МОДАЛЬНОЕ ОКНО ============ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    display: none;
    cursor: pointer;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    background: transparent;
    border-radius: 12px;
    cursor: default;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    cursor: pointer;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    z-index: 1001;
}

/* ============ СКЕЛЕТОН ============ */
.skeleton-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-card::before {
    content: '';
    display: block;
    height: 80px;
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card) 50%, var(--bg-elevated) 75%);
    border-radius: 8px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.load-trigger {
    height: 10px;
    margin: 20px 0;
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

/* ============ ИСПРАВЛЕНИЯ ДЛЯ КУРСОРОВ ============ */
button,
a,
[onclick],
.clickable,
.nav-link,
.auth-tab,
.stat-btn,
.delete-post-btn,
.comment-form button,
.follow-btn,
.edit-btn,
.search-user,
.search-post,
.post-author,
.icon-btn,
.mobile-menu-btn,
.admin-tab,
.make-admin-btn,
.delete-user-btn,
.delete-post-btn-admin,
.modal-close,
.remove-preview {
    cursor: pointer;
    user-select: none;
}

input,
textarea,
[contenteditable="true"] {
    cursor: text;
}

/* ============ АДАПТИВ ============ */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 260px;
        height: calc(100vh - 60px);
        background: var(--bg-card);
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        transition: left 0.2s;
        z-index: 99;
    }
    
    .nav-links.show {
        left: 0;
    }
    
    .user-menu {
        display: none;
    }
    
    .container {
        padding: 16px;
    }
    
    .profile-stats {
        gap: 16px;
    }
    
    .stat strong {
        font-size: 18px;
    }
    
    .admin-user, .admin-post {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-user-actions {
        justify-content: center;
    }
    
    .toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
}