/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: #333;
    overflow-x: hidden;
}

/* Страница авторизации */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

/* Растягиваем чат авторизации на всю высоту и ширину экрана, убираем боковые отступы */
.auth-page .container-fluid,
.auth-page .row,
.auth-page .col-12,
.auth-page .col-md-6,
.auth-page .col-lg-4 {
    height: 100vh;
}

.auth-page .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.auth-page .row {
    margin-left: 0;
    margin-right: 0;
    align-items: stretch !important;
}

.auth-page .col-12,
.auth-page .col-md-6,
.auth-page .col-lg-4 {
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
    flex: 0 0 100%;
}

.chat-bot-container {
    background: white;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    max-width: 100%;
    width: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 20px;
    border-radius: 0;
    text-align: center;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}

.chat-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.chat-messages {
    flex: 1;
    padding: 16px 14px 10px 14px;
    overflow-y: auto;
    max-height: none;
    background: radial-gradient(circle at top, #ffffff 0%, #f7f7ff 45%, #f2f2ff 100%);
}

.message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease-in;
}

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

.bot-message {
    text-align: left;
}

.bot-message p {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 12px 16px;
    border-radius: 18px;
    display: inline-block;
    max-width: 80%;
    margin: 0;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.user-message {
    text-align: right;
}

.user-message p {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 18px;
    display: inline-block;
    max-width: 80%;
    margin: 0;
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-radius: 0 0 20px 20px;
    border-top: 1px solid #e0e0e0;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-block {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-weight: 500;
    border: none;
    transition: all 0.3s;
    text-decoration: none;
    display: block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    background: white;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
}

.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

/* Индикатор проверки поля (ник / email) */
.field-indicator {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: transparent;
}

.field-indicator--loading {
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    animation: spin 0.8s linear infinite;
}

.field-indicator--success {
    background: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

.field-indicator--error {
    background: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.field-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

.auth-back-btn {
    color: #667eea;
    text-decoration: none;
    line-height: 1;
}

.auth-back-btn i {
    font-size: 20px;
}

.auth-header-back-btn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff;
    text-decoration: none;
    padding: 6px 8px;
    line-height: 1;
}

.auth-header-back-btn i {
    font-size: 22px;
}

.register-link {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.register-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.register-link a:hover {
    text-decoration: underline;
}

/* Форма входа */
.auth-form-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 100%;
    width: 100%;
}

.auth-form-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 20px;
    text-align: center;
}

.auth-form-header h3 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
}

.auth-form-body {
    padding: 30px 24px;
    background: white;
}

.auth-form-footer {
    text-align: center;
}

.auth-form-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.auth-form-footer a:hover {
    text-decoration: underline;
}

/* Главная страница */
.main-page {
    background: #ffffff;
    min-height: 100vh;
    padding-bottom: 80px;
}

.main-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: -1;
}

.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    padding: 10px 0;
    background: #ffffff !important;
    border-bottom: 1px solid #f0f0f0;
}

.bottom-navbar {
    position: fixed;
    bottom: 10px;
    left: 10px;
    right: 10px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(240, 240, 240, 0.5);
    border-radius: 20px;
}

.navbar .container-fluid {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: #666;
    text-decoration: none;
    border: none;
    background: none;
    padding: 10px 16px;
    transition: all 0.3s;
    font-size: 12px;
    width: 80px;
    height: 80px;
}

.nav-btn i {
    font-size: 48px;
}

.nav-logo {
    width: 48px;
    height: 48px;
    display: block;
    object-fit: contain;
}

.nav-btn:hover,
.nav-btn.active {
    color: #667eea;
}

.nav-btn span {
    display: none;
}

.nav-btn[data-module="balance"] {
    flex-direction: row;
    gap: 6px;
}

.nav-btn .balance-amount-nav {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-top: 0;
}

.main-content {
    padding: 20px;
    min-height: calc(100vh - 140px);
    background: #ffffff;
    max-width: 100%;
}

/* Модули */
.profile-container,
.balance-container,
.search-container,
.favorites-container {
    background: transparent;
}

.home-container {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    box-shadow: none;
    border: none;
}

.profile-header,
.balance-header,
.home-header,
.search-header,
.favorites-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
    background: #ffffff;
}

.profile-header h2,
.balance-header h2,
.home-header h2,
.search-header h2,
.favorites-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.profile-info p {
    margin-bottom: 15px;
    font-size: 16px;
    color: #555;
}

.profile-info strong {
    color: #333;
    margin-right: 10px;
}

.balance-amount {
    text-align: center;
    padding: 30px 0;
}

.balance-amount-card {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 24px;
    margin-bottom: 30px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.balance-icon-wrapper {
    margin-bottom: 20px;
}

.balance-icon {
    font-size: 64px;
    color: #ffffff;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.3)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    }
    50% {
        transform: scale(1.05) rotate(5deg);
        filter: drop-shadow(0 6px 12px rgba(255, 255, 255, 0.5)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    }
}

.balance-label {
    display: block;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-value {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.invite-section {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.invite-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.invite-bonus {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    color: #666;
}

.invite-bonus i {
    font-size: 24px;
    color: #667eea;
}

.invite-bonus strong {
    color: #667eea;
    font-weight: 700;
}

.referral-section {
    margin-top: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.referral-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.referral-link-wrapper {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 16px;
}

.referral-link-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

.referral-link-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.referral-copy-btn {
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.referral-copy-btn i {
    font-size: 18px;
}

.referral-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.referral-stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.referral-stat-item .stat-label {
    font-size: 14px;
    color: #666;
}

.referral-stat-item .stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

.referral-history-section {
    margin-top: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.referral-history-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.referral-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.referral-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.referral-history-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.referral-history-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.referral-history-date {
    font-size: 12px;
    color: #999;
}

.referral-history-amount {
    font-size: 16px;
    font-weight: 700;
    color: #28a745;
}

.welcome-message {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    margin-bottom: 20px;
}

.welcome-message p {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

/* Стили для карточек категорий */
.categories-section {
    padding: 0px 0;
}

.categories-title {
    font-size: 1.2rem;
    font-weight: 600;
    text-align: left;
    margin-bottom: 20px;
    color: #333;
    padding-left: 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.category-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px;
    padding: 35px 25px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    border: none;
    min-height: 160px;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.category-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.category-card:hover::before {
    opacity: 1;
}

.category-card:hover::after {
    opacity: 1;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    filter: brightness(1.05);
}

.category-card.placeholder-card {
    cursor: default;
}

.category-card.placeholder-card:hover {
    transform: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.category-name {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    text-align: left;
    margin: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.5px;
}

.category-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-align: left;
    margin: 0;
    position: relative;
    z-index: 1;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.category-badge {
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Стили для секции проектов категории */
.category-projects-section {
    margin-top: 20px;
}

.category-projects-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    padding: 8px;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.back-btn:hover {
    color: #764ba2;
    transform: translateX(-3px);
}

.back-btn i {
    font-size: 18px;
}

.category-projects-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .categories-title {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    .categories-grid {
        gap: 15px;
        max-width: 100%;
        grid-template-columns: 1fr;
    }
    
    .category-card {
        padding: 28px 20px;
        min-height: 140px;
        border-radius: 20px;
    }
    
    .category-name {
        font-size: 18px;
    }
    
    .category-description {
        font-size: 13px;
    }
    
    .category-badge {
        padding: 6px 16px;
        font-size: 12px;
    }
    
    .category-projects-header {
        gap: 10px;
        margin-bottom: 15px;
        padding-bottom: 12px;
    }
    
    .category-projects-title {
        font-size: 1.2rem;
    }
    
    .back-btn {
        padding: 6px;
    }
    
    .back-btn i {
        font-size: 16px;
    }
    
    /* Адаптивность для карточек проектов с фото */
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .project-info-overlay {
        padding: 12px 15px;
    }
    
    .project-name {
        font-size: 12px;
    }
    
    .project-favorite-btn {
        width: 36px;
        height: 36px;
    }
    
    .project-favorite-btn i {
        font-size: 18px;
    }
}

.search-box,
.home-search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.home-search-box {
    margin: 15px 0 20px 0;
    flex-direction: column;
}

.home-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 2px;
    transition: all 0.3s ease;
}

.home-search-input-wrapper:focus-within {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    padding: 2px;
}

/* Брендинг перед поиском (главная) */
.search-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 10px 0 6px;
}

.search-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
}

.search-brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: block;
}

.search-brand-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #333;
    line-height: 1;
}

/* Поиск: кнопка-иконка + скрываемое поле */
.search-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    padding: 0;
    color: #666;
    text-decoration: none;
}

.search-toggle-btn i {
    font-size: 20px;
    line-height: 1;
}

.search-input-wrap {
    flex: 1;
    width: 100%;
}

.search-input-wrap.is-hidden {
    display: none;
}

.home-search-box .form-control {
    background: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 40px 12px 16px;
    transition: all 0.3s ease;
    flex: 1;
    outline: none;
}

.home-search-box .form-control:focus {
    box-shadow: none;
    outline: none;
}

.home-search-box .form-control::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.home-search-clear-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.home-search-clear-btn:hover {
    color: #667eea;
    transform: scale(1.1);
}

.home-search-clear-btn i {
    font-size: 18px;
}

.home-search-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-search-btn:hover {
    color: #667eea;
    transform: scale(1.1);
}

.home-search-btn i {
    font-size: 20px;
}

.search-box .form-control {
    flex: 1;
}

/* Фильтр по категориям */
.categories-filter-container {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
}

.categories-filter-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #667eea #f0f0f0;
    -webkit-overflow-scrolling: touch;
}

.categories-filter-scroll::-webkit-scrollbar {
    height: 6px;
}

.categories-filter-scroll::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.categories-filter-scroll::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.categories-filter-scroll::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.category-filter-btn {
    flex-shrink: 0;
    padding: 10px 20px;
    border: 2px solid #f0f0f0;
    border-radius: 20px;
    background: #ffffff;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f8f9fa;
}

.category-filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.category-filter-btn span {
    display: inline-block;
}

.search-results {
    min-height: 200px;
}

#projectsGrid .project-card {
    display: flex;
}

.favorites-list {
    min-height: 200px;
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 16px;
}

.profile-actions {
    margin-top: 20px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

/* Адаптивность */
@media (max-width: 768px) {
    .chat-bot-container {
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
    }

    .chat-header {
        border-radius: 0;
        padding: 16px;
    }

    .chat-input-container {
        border-radius: 0;
        padding: 16px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .nav-btn span {
        font-size: 10px;
    }
    
    .nav-btn i {
        font-size: 36px;
    }

    .nav-logo {
        width: 36px;
        height: 36px;
    }
    
    .top-navbar,
    .bottom-navbar {
        padding: 8px 0;
    }
    
    .nav-btn {
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .chat-bot-container {
        margin: 0;
        min-height: 100vh;
    }
    
    .chat-header h3 {
        font-size: 1.2rem;
    }
    
    .nav-btn span {
        font-size: 9px;
    }
    
    .nav-btn i {
        font-size: 32px;
    }

    .nav-logo {
        width: 32px;
        height: 32px;
    }
}

/* Анимации загрузки - оптимизированные */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    min-height: 300px;
    will-change: contents;
}

.loading p {
    display: none;
}

.spinner {
    display: none;
}

.spinner-logo {
    width: 56px;
    height: 56px;
    display: block;
    animation: spin 0.8s linear infinite;
    transform-origin: 50% 50%;
    will-change: transform;
}

.spinner-logo.spinner-logo--small {
    width: 40px;
    height: 40px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Мини-лоадер для обновления списка избранного */
.loading-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: 200px;
}

.spinner-small {
    border: 3px solid rgba(102, 126, 234, 0.1);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 0.8s linear infinite;
    will-change: transform;
}

/* Оптимизация производительности */
.profile-container,
.balance-container,
.home-container,
.search-container,
.favorites-container,
.settings-container,
.profile-settings-container,
.about-container {
    will-change: contents;
    transform: translateZ(0);
}

/* Настройки */
.settings-container {
    background: transparent;
}

.settings-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
    background: #ffffff;
}

.settings-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.settings-block {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-block:hover {
    background: #f8f9fa;
    border-color: #667eea;
    transform: translateX(5px);
}

.settings-block.logout-block:hover {
    background: #fff5f5;
    border-color: #dc3545;
}

.settings-block.logout-block .settings-block-header {
    color: #dc3545;
}

.settings-block.logout-block .settings-block-header i {
    color: #dc3545;
}

.settings-block-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.settings-block-header i:first-child {
    font-size: 24px;
    color: #667eea;
    width: 30px;
    text-align: center;
}

.settings-block-info {
    flex: 1;
}

.settings-block-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.settings-block-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.settings-arrow {
    color: #999;
    font-size: 18px;
}

/* Настройки профиля */
.profile-settings-container {
    background: #ffffff;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    border: 1px solid #f5f5f5;
}

/* Дар бораи РАНГА */
.about-container {
    background: #ffffff;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    border: 1px solid #f5f5f5;
}

.about-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
}

.about-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.about-content {
    padding: 10px 0;
}

.about-logo-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.about-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.about-logo-section h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #667eea;
}

.about-info-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-info-block {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
}

.about-info-block h4 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-info-block h4 i {
    color: #667eea;
    font-size: 1.2rem;
}

.about-info-block p {
    margin: 0;
    color: #555;
    line-height: 1.6;
}

.about-info-block ul {
    margin: 0;
    padding-left: 20px;
    color: #555;
}

.about-info-block ul li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.profile-settings-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
}

.back-btn {
    color: #667eea;
    text-decoration: none;
    padding: 5px 10px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0;
}

.back-btn:hover {
    color: #764ba2;
}

.profile-settings-header h2,
.profile-settings-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h4 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-actions .btn {
    padding: 12px;
    border-radius: 10px;
    font-weight: 500;
}

/* Админ панель */
.admin-container {
    background: #ffffff;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    border: 1px solid #f5f5f5;
}

.admin-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
}

.admin-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: #f0f0f0;
    color: #667eea;
}

.stat-icon.admin-icon {
    background: #fff3cd;
    color: #ffc107;
}

.stat-icon.balance-icon {
    background: #d1ecf1;
    color: #0c5460;
}

.stat-icon.new-icon {
    background: #d4edda;
    color: #155724;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

.admin-section {
    margin-top: 30px;
}

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

.admin-section-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
}

.users-table-container {
    overflow-x: auto;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.users-table thead {
    background: #f8f9fa;
}

.users-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #666;
    border-bottom: 2px solid #f0f0f0;
}

.users-table td {
    padding: 12px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    color: #333;
}

.users-table tbody tr:hover {
    background: #f8f9fa;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.admin-badge {
    background: #fff3cd;
    color: #856404;
}

.user-badge {
    background: #d1ecf1;
    color: #0c5460;
}

.users-table .btn {
    padding: 5px 10px;
    margin-right: 5px;
    font-size: 12px;
}

.pagination-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.pagination {
    margin: 0;
}

.page-link {
    color: #667eea;
    border-color: #f0f0f0;
}

.page-link:hover {
    color: #764ba2;
    background: #f8f9fa;
}

.page-item.active .page-link {
    background: #667eea;
    border-color: #667eea;
}

.settings-block.admin-block {
    border: 2px solid #ffc107;
    background: #fffbf0;
}

.settings-block.admin-block:hover {
    border-color: #ffc107;
    background: #fff8e1;
}

.settings-block.admin-block .settings-block-header i:first-child {
    color: #ffc107;
}

/* Админ меню */
.admin-menu {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
}

.admin-menu-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ffffff;
}

.admin-menu-item:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.admin-menu-item.active {
    border-color: #667eea;
    background: #f0f4ff;
}

.admin-menu-item i {
    font-size: 24px;
    color: #667eea;
}

.admin-menu-item span {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

/* Категории */
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    margin-bottom: 10px;
    background: #ffffff;
    transition: all 0.3s ease;
}

.category-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.category-info {
    flex: 1;
}

.category-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}

.category-info p {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #666;
}

.category-actions {
    display: flex;
    gap: 5px;
}

/* Проекты */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Карточка проекта только с фото */
.project-card-image {
    position: relative;
    cursor: pointer;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    aspect-ratio: 16 / 9;
}

.project-card-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.project-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 20px;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.project-card-image:hover .project-image {
    transform: scale(1.05);
}

.project-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
}

.project-image-placeholder i {
    font-size: 48px;
}

.project-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 20px 20px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0 0 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    z-index: 10;
    min-height: 80px;
}

.project-name {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    margin-right: 50px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}


.project-favorite-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
    z-index: 11;
}

.project-favorite-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.15);
}

.project-favorite-btn i {
    font-size: 22px;
    color: #ffffff;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.project-favorite-btn.active i {
    color: #e74c3c;
}

.project-favorite-btn.active:hover i {
    color: #e74c3c;
}

.project-favorite-btn:hover i {
    color: #ffffff;
}

.project-card,
.project-card-admin {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.project-card:hover,
.project-card-admin:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.project-card .project-actions {
    cursor: default;
}

.project-card .btn {
    cursor: pointer;
}

.project-logo,
.project-logo-admin {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-logo img,
.project-logo-admin img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info,
.project-info-admin {
    flex: 1;
}

.project-info h4,
.project-info-admin h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.project-info p,
.project-info-admin p {
    margin: 8px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.project-category-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e7f3ff;
    color: #0066cc;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 8px;
}

.project-actions,
.project-actions-admin {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.project-actions .btn,
.project-actions-admin .btn {
    flex: 1;
    font-size: 12px;
    padding: 6px 10px;
}

/* Просмотр проекта */
.project-view-container {
    background: #ffffff;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    border: 1px solid #f5f5f5;
}

.project-view-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
}

.project-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.project-header-logo {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
}


.project-actions-bar {
    margin-bottom: 20px;
}

.project-files-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.file-item {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.file-icon {
    font-size: 32px;
    color: #667eea;
    text-align: center;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    font-size: 14px;
    color: #333;
    word-break: break-word;
}

.file-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.file-actions .btn {
    font-size: 11px;
    padding: 4px 8px;
}

/* Модальное окно проекта - полноэкранное */
#projectViewModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    height: 100vh;
}

#projectViewModal .modal-content {
    margin: 0;
    border: none;
    border-radius: 0;
    height: 100vh;
    background: #000000;
}

.project-fullscreen-modal {
    margin: 0;
    border: none;
    border-radius: 0;
    height: 100vh;
    background: #000000;
}

.project-modal-body-fullscreen {
    padding: 0 !important;
    margin: 0 !important;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.project-preview-iframe-fullscreen {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.project-close-btn-container {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1060;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.project-close-btn-container:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.project-close-btn {
    margin: 0;
    opacity: 1;
    filter: brightness(0) invert(1);
    width: 24px;
    height: 24px;
}

.project-info-preview {
    padding: 40px;
    text-align: center;
    color: #ffffff;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.project-modal-logo {
    width: 150px;
    height: 150px;
    border-radius: 15px;
    object-fit: cover;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .users-table-container {
        font-size: 12px;
    }
    
    .users-table th,
    .users-table td {
        padding: 8px;
        font-size: 12px;
    }
    
    .admin-menu {
        flex-direction: column;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .files-grid {
        grid-template-columns: 1fr;
    }
    
    .project-preview-container {
        height: 60vh;
        min-height: 400px;
    }
}

/* Адаптация для ПК (Desktop) */
@media (min-width: 769px) {
    /* Основной контент - центрирование и ограничение ширины */
    .main-content {
        max-width: 1200px;
        margin: 0 auto;
        padding: 40px;
    }
    
    /* Навигация для ПК */
    .bottom-navbar {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: auto;
        min-width: 400px;
        padding: 15px 30px;
        border-radius: 30px;
    }
    
    .nav-btn {
        padding: 15px 25px;
        width: auto;
        min-width: 80px;
        gap: 8px;
    }
    
    .nav-btn span {
        display: block;
        font-size: 12px;
        margin-top: 4px;
    }
    
    .nav-btn i {
        font-size: 44px;
    }

    .nav-logo {
        width: 44px;
        height: 44px;
    }
    
    /* Контейнер авторизации */
    .chat-bot-container {
        max-width: 500px;
        margin: 0 auto;
    }
    
    /* Сетка категорий для ПК */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1000px;
        gap: 25px;
    }
    
    .category-card {
        padding: 40px 30px;
        min-height: 180px;
    }
    
    .category-name {
        font-size: 22px;
    }
    
    .category-description {
        font-size: 15px;
    }
    
    /* Сетка проектов для ПК */
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    /* Карточки проектов */
    .project-card {
        max-width: 100%;
    }
    
    /* Контейнеры модулей */
    .balance-container,
    .profile-container,
    .settings-container,
    .favorites-container {
        max-width: 800px;
        margin: 0 auto;
    }
    
    /* Реферальная секция */
    .referral-link-wrapper {
        max-width: 600px;
    }
    
    /* История рефералов */
    .referral-history-list {
        max-width: 700px;
    }
    
    /* Поиск */
    .home-search-box {
        max-width: 600px;
        margin: 0 auto 30px;
    }
    
    /* Заголовки */
    .profile-header h2,
    .balance-header h2,
    .home-header h2,
    .search-header h2,
    .favorites-header h2 {
        font-size: 2rem;
    }
    
    /* Баланс карточка */
    .balance-amount-card {
        padding: 40px;
    }
    
    .balance-value {
        font-size: 3rem;
    }
    
    /* Настройки блоки */
    .settings-block {
        padding: 25px;
    }
    
    /* Админ панель */
    .admin-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    /* Таблицы */
    .users-table-container {
        overflow-x: visible;
    }
}

/* Большие экраны (Full HD и выше) */
@media (min-width: 1200px) {
    .main-content {
        max-width: 1400px;
        padding: 50px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1200px;
    }
    
    .balance-container,
    .profile-container,
    .settings-container,
    .favorites-container {
        max-width: 900px;
    }
}

