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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --bg-color: #f9fafb;
    --surface-color: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 80px;
}

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

/* Экраны */
.screen {
    display: none;
    min-height: calc(100vh - 80px);
    padding: 20px 0;
}

.screen.active {
    display: block;
}

/* Лендинг */
header {
    text-align: center;
    margin-bottom: 60px;
}

.logo-image {
    max-width: 200px;
    height: auto;
    margin: 0 auto 20px;
    display: block;
}

.logo {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

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

.feature {
    text-align: center;
    padding: 30px;
    background: var(--surface-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feature h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Кнопки */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

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

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

.btn-large {
    padding: 16px 32px;
    font-size: 1.125rem;
}

.btn-telegram {
    background: #0088cc;
    color: white;
}

.btn-vk {
    background: #0077ff;
    color: white;
}

/* Авторизация */
.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.auth-icon {
    font-size: 1.5rem;
}

.auth-note {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 20px;
}

/* Загрузка файлов */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--surface-color);
    margin: 30px 0;
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background: #f3f4f6;
}

.drop-zone.dragover {
    border-color: var(--primary-color);
    background: #eef2ff;
}

.drop-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.file-list {
    margin: 20px 0;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--surface-color);
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.file-name {
    flex: 1;
    margin-right: 15px;
}

.file-remove {
    color: var(--danger-color);
    cursor: pointer;
    font-size: 1.2rem;
}

/* Выбор собеседника */
.persons-list {
    margin: 30px 0;
}

.person-item {
    padding: 20px;
    background: var(--surface-color);
    border-radius: 8px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    box-shadow: var(--shadow);
}

.person-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.person-item.selected {
    border-color: var(--primary-color);
    background: #eef2ff;
}

.person-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.person-preview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

/* Прогресс */
.progress-container {
    text-align: center;
    margin: 40px 0;
}

.analysis-animation {
    max-width: 300px;
    width: 100%;
    height: auto;
    margin: 0 auto 30px;
    display: block;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s;
}

/* Акинатор */
.akinator-container {
    margin: 40px 0;
}

.akinator-question {
    background: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.akinator-question-text {
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.akinator-answers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.akinator-answer {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.akinator-answer:hover {
    border-color: var(--primary-color);
}

.akinator-answer.selected {
    border-color: var(--primary-color);
    background: #eef2ff;
}

/* Результаты */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.gifts-list {
    display: grid;
    gap: 20px;
}

.gift-card {
    background: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.gift-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.gift-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.gift-reason {
    background: #f3f4f6;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.gift-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.gift-price {
    font-weight: 600;
    color: var(--success-color);
}

.gift-category {
    padding: 5px 12px;
    background: #eef2ff;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--primary-color);
}

.gift-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gift-link {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

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

.prompt-container {
    background: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

#universalPrompt {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 15px;
}

/* Профиль */
.profile-section {
    background: var(--surface-color);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.profile-section h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

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

.balance-item {
    padding: 15px;
    background: #f3f4f6;
    border-radius: 8px;
}

.balance-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.balance-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.referral-link-container {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

#referralLink {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: monospace;
}

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

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f3f4f6;
    border-radius: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.packages-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.package-card {
    padding: 20px;
    background: #f3f4f6;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.package-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.package-name {
    font-weight: 600;
    margin-bottom: 10px;
}

.package-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.package-requests {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Навигация */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    display: none; /* Скрыта по умолчанию */
    justify-content: space-around;
    padding: 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.bottom-nav.visible {
    display: flex; /* Показываем только после авторизации */
}

.nav-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.nav-btn:hover {
    color: var(--primary-color);
}

/* Вишлист */
.wishlist-items {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.wishlist-item {
    padding: 20px;
    background: #f3f4f6;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.wishlist-item h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.wishlist-reason {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.wishlist-meta {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.wishlist-meta span {
    padding: 5px 12px;
    background: white;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo-image {
        max-width: 150px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .gift-meta {
        flex-direction: column;
    }
    
    .packages-list {
        grid-template-columns: 1fr;
    }
    
    .analysis-animation {
        max-width: 200px;
    }
}

/* Утилиты */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

