/* YBANal - VK-inspired Dark Theme */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --bg-card: #1e1e1e;
    --text-primary: #e1e3e6;
    --text-secondary: #8b949e;
    --accent-blue: #16A7FF;
    --accent-blue-hover: #72bef4;
    --accent-red: #ff4444;
    --accent-green: #00d084;
    --border-color: #303030;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
    --radius: 8px;
    --header-height: 60px;
}

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

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

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--accent-blue-hover);
}

/* Header */
.top-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary) !important;
}

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

.header-nav {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    padding: 8px 16px;
    color: var(--text-secondary) !important;
    border-radius: var(--radius);
    font-weight: 500;
    transition: all 0.15s;
}

.nav-link:hover, .nav-link.active {
    background: var(--bg-tertiary);
    color: var(--text-primary) !important;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* User Menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-name {
    color: var(--text-primary);
    font-weight: 500;
}

.user-name.admin-user {
    color: var(--accent-red);
}

.admin-badge {
    background: var(--accent-red);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px 0;
    min-width: 180px;
    box-shadow: var(--shadow);
}

.user-menu:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: var(--text-primary) !important;
    transition: background 0.15s;
}

.dropdown-menu a:hover {
    background: var(--bg-tertiary);
}

/* Buttons */
.btn {
    padding: 8px 20px;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
}

.btn-login {
    background: var(--accent-blue);
    color: white !important;
}

.btn-login:hover {
    background: var(--accent-blue-hover);
}

.btn-register {
    background: var(--bg-tertiary);
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
}

.btn-register:hover {
    background: var(--bg-secondary);
}

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

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

.btn-danger {
    background: var(--accent-red);
    color: white;
}

.btn-success {
    background: var(--accent-green);
    color: white;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - var(--header-height) - 100px);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

textarea.form-input {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

/* Articles */
.article-list {
    display: grid;
    gap: 20px;
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color 0.15s;
}

.article-card:hover {
    border-color: var(--accent-blue);
}

.article-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.article-meta {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 10px;
}

.article-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Chat */
.chat-container {
    height: 600px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 15px;
}

.chat-message {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.chat-message .username {
    font-weight: 600;
    margin-bottom: 5px;
}

.chat-message .username.admin {
    color: var(--accent-red);
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area textarea {
    flex: 1;
    min-height: 50px;
}

/* Comments */
.comments-section {
    margin-top: 30px;
}

.comment {
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
}

.comment-author.admin {
    color: var(--accent-red);
}

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

/* Admin Panel */
.admin-sidebar {
    width: 250px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    position: fixed;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
}

.admin-content {
    margin-left: 250px;
    padding: 30px;
}

.admin-nav-item {
    display: block;
    padding: 10px 15px;
    color: var(--text-secondary) !important;
    border-radius: var(--radius);
    margin-bottom: 5px;
    transition: all 0.15s;
}

.admin-nav-item:hover, .admin-nav-item.active {
    background: var(--bg-tertiary);
    color: var(--text-primary) !important;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
}

.table tr:hover {
    background: var(--bg-secondary);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(0, 208, 132, 0.15);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

.alert-error {
    background: rgba(255, 68, 68, 0.15);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

.alert-info {
    background: rgba(22, 167, 255, 0.15);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
}

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    text-align: center;
    color: var(--text-secondary);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-desc {
    margin-top: 5px;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-nav {
        display: none;
    }

    .admin-sidebar {
        display: none;
    }

    .admin-content {
        margin-left: 0;
    }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* TinyMCE override */
.tox .tox-editor-container {
    background: var(--bg-secondary);
}

.tox .tox-edit-area__iframe {
    background: var(--bg-secondary);
}
