/* ========== БАЗОВЫЕ СТИЛИ ========== */

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

html,
body {
    width: 100%;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent; /* Убирает серый фон при тапе на iOS */
}

body {
    padding-top: 61px; /* Вместо 35px, под высоту навбара */
}

/* Утилиты */
.hidden {
    display: none !important;
}

/* Скроллбар - делаем тоньше на мобильных */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* ========== NAVIGATION ========== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    height: 61px;

    z-index: 1000;

    background: var(--nav-bg);

    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.nav-container {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 8px 12px; /* Уменьшил паддинги */
}

/* ========== LOGO ========== */

.logo {
    display: flex;
    align-items: center;

    text-decoration: none;

    user-select: none;
}

.logo-img {
    height: 44px; /* Уменьшил с 52px */
    width: auto;
    display: block;

    transition: opacity 0.2s ease;
}

/* Светлая тема */
.logo-dark {
    display: none;
}

/* Темная тема */
[data-theme="dark"] .logo-light {
    display: none;
}

[data-theme="dark"] .logo-dark {
    display: block;
}

/* ========== RIGHT NAV ========== */

.nav-right {
    display: flex;
    align-items: center;
    gap: 8px; /* Уменьшил с 16px */
}

/* ========== CREATE BUTTON ========== */

.create-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    height: 40px; /* Уменьшил с 44px */

    padding: 0 12px; /* Уменьшил с 16px */

    background: var(--accent);

    color: white;

    text-decoration: none;

    border-radius: 999px;

    font-weight: 500;
    font-size: 13px; /* Уменьшил с 14px */

    transition: background 0.2s ease;
    
    white-space: nowrap;
}

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

.create-btn i {
    font-size: 12px;
}

/* ========== GUEST LINKS ========== */

.nav-link {
    color: var(--text-primary);

    text-decoration: none;

    padding: 6px 12px; /* Уменьшил с 8px 16px */

    border-radius: 999px;

    font-weight: 500;
    font-size: 13px;

    transition: background 0.2s ease;
}

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

.register-link {
    background: var(--accent);
    color: white;
}

.register-link:hover {
    background: var(--accent-hover);
}

/* ========== THEME BUTTON ========== */

.theme-toggle {
    width: 36px; /* Уменьшил с 40px */
    height: 36px; /* Уменьшил с 40px */

    border-radius: 50%;

    border: 1px solid var(--border);

    background: var(--bg-secondary);

    color: var(--text-primary);

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;

    transition: background 0.2s ease;
    
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--hover-bg);
}

.theme-toggle i {
    position: absolute;

    font-size: 16px; /* Уменьшил с 18px */

    transition: opacity 0.2s ease;
}

.theme-toggle .fa-sun {
    opacity: 0;
}

.theme-toggle .fa-moon {
    opacity: 1;
}

[data-theme="dark"] .theme-toggle .fa-sun {
    opacity: 1;
}

[data-theme="dark"] .theme-toggle .fa-moon {
    opacity: 0;
}

/* ========== USER MENU ========== */

.user-menu {
    position: relative;
}

/* Кнопка */
.user-menu-btn {
    display: flex;
    align-items: center;

    gap: 6px; /* Уменьшил с 8px */

    height: 40px; /* Уменьшил с 44px */

    padding: 0 8px 0 0; /* Уменьшил паддинги */

    background: var(--bg-secondary);

    border: 1px solid var(--border);

    border-radius: 999px;

    color: var(--text-primary);

    cursor: pointer;

    transition: background 0.2s ease;
}

.user-menu-btn:hover {
    background: var(--hover-bg);
}

/* Аватар */
.user-menu-btn .user-avatar,
.user-menu-btn .user-avatar-placeholder {
    width: 38px; /* Уменьшил с 42px */
    height: 38px; /* Уменьшил с 42px */

    border-radius: 50%;

    object-fit: cover;

    flex-shrink: 0;

    margin: -1px;
}

.user-menu-btn .user-avatar-placeholder {
    background: var(--wood);

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;

    font-weight: 600;
    font-size: 16px;
}

/* Текст - скрываем на очень маленьких экранах */
.user-menu-btn .menu-text {
    font-size: 13px;
    font-weight: 500;

    white-space: nowrap;
}

@media (max-width: 480px) {
    .user-menu-btn .menu-text {
        display: none;
    }
    
    .user-menu-btn {
        padding: 0;
    }
}

/* Стрелка */
.user-menu-btn i {
    font-size: 10px;

    color: var(--text-secondary);
}

@media (max-width: 480px) {
    .user-menu-btn i {
        display: none;
    }
}

/* ========== DROPDOWN ========== */

.user-dropdown {
    position: absolute;

    top: calc(100% + 8px);
    right: 0;

    min-width: 220px; /* Уменьшил с 260px */

    background: var(--bg-secondary);

    border: 1px solid var(--border);

    border-radius: 16px;

    box-shadow: var(--shadow);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-10px);

    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;

    z-index: 1001;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}

/* Информация */
.user-info {
    padding: 12px; /* Уменьшил с 16px */
}

.user-name {
    font-weight: 600;

    color: var(--text-primary);

    margin-bottom: 4px;
    
    font-size: 14px;
}

.user-email {
    font-size: 11px;

    color: var(--text-secondary);
    
    word-break: break-all;
}

/* Разделитель */
.dropdown-divider {
    height: 1px;

    background: var(--border);

    margin: 4px 0;
}

/* Элементы меню */
.dropdown-item {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 10px 12px; /* Уменьшил с 12px 16px */

    border: none;

    background: none;

    color: var(--text-primary);

    text-decoration: none;

    cursor: pointer;

    font-size: 13px;

    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: var(--hover-bg);
}

.dropdown-item i {
    width: 18px; /* Уменьшил с 20px */

    color: var(--text-secondary);
    
    font-size: 14px;
}

/* Logout */
.logout-item {
    color: #ff3b30;
}

.logout-item i {
    color: #ff3b30;
}

/* Theme toggle item */
.theme-toggle-dropdown {
    display: flex;
    align-items: center;

    gap: 12px;
}

/* ========== MESSAGES ========== */

.message {
    max-width: 1400px;

    margin: 12px; /* Уменьшил с 20px auto */

    padding: 10px 16px; /* Уменьшил с 12px 20px */

    background: var(--bg-secondary);

    border: 1px solid var(--border);

    border-radius: 12px;

    display: flex;
    align-items: center;

    gap: 12px;
    
    font-size: 13px;
}

.message-success {
    border-left: 4px solid #34c759;
}

.message-error {
    border-left: 4px solid #ff3b30;
}

/* ========== MAIN CONTENT ========== */

.main-content {
    width: 100%;
    max-width: 100%;

    margin: 0;
    padding: 0;
}

.page-container {
    width: 100%;

    margin: 0;
    padding: 0;
}

/* ========== МОБИЛЬНЫЕ ДОПОЛНЕНИЯ ========== */

@media (max-width: 768px) {
    .nav-container {
        padding: 8px 10px;
    }
    
    .create-btn span {
        display: none;
    }
    
    .create-btn {
        padding: 0 10px;
    }
    
    .create-btn i {
        font-size: 14px;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 6px 8px;
    }
    
    .logo-img {
        height: 36px;
    }
    
    .theme-toggle {
        width: 32px;
        height: 32px;
    }
    
    .theme-toggle i {
        font-size: 14px;
    }
}