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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========== ТЕМЫ ========== */
body.dark {
    --bg-primary: #0a0a0f;
    --bg-secondary: rgba(20, 20, 30, 0.8);
    --bg-card: rgba(25, 25, 35, 0.9);
    --bg-sidebar: rgba(15, 15, 22, 0.9);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.05);
    --header-bg: rgba(10, 10, 15, 0.95);
    --shadow: 0 20px 35px -15px rgba(0, 0, 0, 0.5);
    --input-bg: rgba(0, 0, 0, 0.3);
    --toggle-bg: #2d2d44;
    --toggle-knob: #ffffff;
}

body.light {
    --bg-primary: #f8fafc;
    --bg-secondary: rgba(255, 255, 255, 0.9);
    --bg-card: #ffffff;
    --bg-sidebar: rgba(255, 255, 255, 0.95);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.05);
    --header-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 20px 35px -15px rgba(0, 0, 0, 0.1);
    --input-bg: #f1f5f9;
    --toggle-bg: #e2e8f0;
    --toggle-knob: #ffffff;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ========== ШАПКА ========== */
.header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.logo-text {
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

.nav-btn {
    padding: 10px 22px;
    border-radius: 60px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-btn.glass {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.nav-btn.glass:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.nav-btn.primary {
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* ===== ПОЛЗУНОК ДЛЯ ПК ===== */
.theme-toggle-desktop {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 60px;
    padding: 5px 12px;
}

.theme-icon {
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.6;
}

.theme-icon.active {
    opacity: 1;
    text-shadow: 0 0 4px currentColor;
}

.theme-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--toggle-bg);
    transition: 0.3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: var(--toggle-knob);
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.theme-toggle-mobile {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 60px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s;
}

.theme-toggle-mobile:hover {
    transform: scale(1.05);
    border-color: #3b82f6;
}

@media (max-width: 768px) {
    .theme-toggle-desktop {
        display: none;
    }
    .theme-toggle-mobile {
        display: flex;
    }
}

/* ========== ТРИ КОЛОНКИ ========== */
.app {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    gap: 24px;
}

.sidebar {
    width: 300px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    padding: 24px 16px;
    position: sticky;
    top: 94px;
    height: calc(100vh - 110px);
    overflow-y: auto;
    border: 1px solid var(--border);
}

.search-input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 60px;
    border: 1px solid var(--border);
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text-primary);
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.menu-btn {
    width: 100%;
    text-align: left;
    padding: 14px 18px;
    background: transparent;
    border: none;
    border-radius: 18px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary);
}

.menu-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--text-primary);
    transform: translateX(4px);
}

.menu-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(168, 85, 247, 0.1));
    border-left: 3px solid #3b82f6;
    color: var(--text-primary);
}

.menu-btn.scam {
    color: #f87171;
}

.menu-btn.scam.active {
    background: rgba(239, 68, 68, 0.15);
    border-left-color: #ef4444;
}

.submenu {
    margin-left: 52px;
    margin-top: 6px;
    margin-bottom: 12px;
}

.submenu-btn {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.submenu-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(4px);
}

.submenu-btn.active {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.category-title {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.category-count {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 8px;
}

.resources-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.resource-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border-radius: 24px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    cursor: pointer;
}

.resource-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: var(--shadow);
}

.resource-name {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.badge {
    font-size: 11px;
    padding: 5px 14px;
    border-radius: 60px;
    font-weight: 600;
}

.badge-scam {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.badge-safe {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.resource-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.resource-link {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 60px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.resource-link:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5);
}

.comments-sidebar {
    width: 320px;
    background: var(--bg-sidebar);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    padding: 24px;
    position: sticky;
    top: 94px;
    height: calc(100vh - 110px);
    overflow-y: auto;
    border: 1px solid var(--border);
}

.comments-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.comment-placeholder i {
    font-size: 56px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.5;
}

/* ПОДВАЛ */
.footer {
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding: 48px 24px 32px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.footer-col p, .footer-col a {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.8;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: #3b82f6;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-links {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 60px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
    color: var(--text-primary);
    text-decoration: none;
}

.social-links a:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
}

/* Модалка */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 32px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border);
}

.modal-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 20px;
}

.modal-input, .modal-textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text-primary);
}

.modal-textarea {
    min-height: 100px;
    resize: vertical;
}

.modal-close {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 60px;
    cursor: pointer;
    margin-right: 12px;
    color: var(--text-primary);
    font-weight: 500;
}

.modal-submit {
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 60px;
    cursor: pointer;
    font-weight: 600;
}

@media (max-width: 1000px) {
    .comments-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .header-container {
        padding: 12px 16px;
        height: auto;
    }
    .app {
        padding: 16px;
    }
    .resource-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .resource-link {
        align-self: flex-start;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .social-links {
        justify-content: center;
    }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: 24px;
    color: var(--text-muted);
}

::-webkit-scrollbar {
    width: 5px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 10px;
}

/* Для мобильной версии авторизации */
@media (max-width: 768px) {
    .user-menu {
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
}

/* Стили для комментариев */
.comments-list {
    max-height: 400px;
    overflow-y: auto;
}

.comments-list::-webkit-scrollbar {
    width: 3px;
}