/* suite/static/style.css - КОМПАКТНАЯ ВЕРСИЯ */

/* Очень темная тема */
:root {
    --bg-primary: #0c0c0c;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-surface: #151515;
    --bg-card: #1e1e1e;
    
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-tertiary: #666666;
    --text-placeholder: #666666;
    
    --border: #333333;
    --border-light: #404040;
    
    --accent: #ff2b24;
    --accent-hover: #fffc3f;
    --accent-light: #ec3030;
    
    --telegram: #1b1b1b;
    --discord: #1b1b1b;
    --success: #0f62cf;
    --warning: #0bdaf5;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 69px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Сброс и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Фоновый эффект */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(30, 30, 30, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(20, 20, 20, 0.15) 0%, transparent 50%),
        linear-gradient(135deg, #0c0c0c 0%, #111111 100%);
    z-index: -2;
}

/* Кнопки в шапке */
.header-buttons {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-size: 18px;
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

#backBtn {
    background: var(--accent);
    border-color: var(--accent);
}

#backBtn:hover {
    background: var(--accent-hover);
}

.telegram-btn {
    background: var(--telegram);
    border-color: var(--telegram);
}

.discord-btn {
    background: var(--discord);
    border-color: var(--discord);
}

/* Контейнеры */
.app-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.center-container {
    width: 100%;
    max-width: 900px;
}

/* Логотип */
.header-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.logo-image {
    width: 86px;
    height: 63px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.logo-text {
    font-family: 'Gilroy-ExtraBold', sans-serif;
    font-weight: 800;
    font-size: 36px;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Поисковая строка */
.search-container {
    width: 100%;
    margin-bottom: 25px;
}

.search-wrapper {
    display: flex;
    flex-direction: column;
    height: 66px;
    padding: 6px 8px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(90deg, #ffffff 0%, #e4edff 100%);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.search-wrapper:focus-within {
    transform: translateY(-2px);
    box-shadow: 
        var(--shadow-lg),
        0 0 0 4px rgba(79, 70, 229, 0.1);
}

.search-body {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.search-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #000000;
    font-size: 16px;
    font-weight: 500;
    outline: none;
    min-width: 0;
    font-family: 'Gilroy-SemiBold', sans-serif;
    padding: 0 10px;
}

.search-input::placeholder {
    color: #00000099;
    font-weight: 500;
    font-family: 'Gilroy-SemiBold', sans-serif;
}

.search-button {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-xl);
    background: var(--bg-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.search-button:hover {
    background: var(--accent);
    transform: scale(1.05);
}

.search-button i {
    color: white;
    font-size: 16px;
}

/* Маленькие круглые подсказки */
.suggestions-container {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.suggestions-container.active {
    max-height: 200px;
    opacity: 1;
}

.mini-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    max-width: 200px;
    white-space: nowrap;
}

.mini-chip:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.player-mini-chip:hover {
    background: rgba(229, 70, 118, 0.2);
    border-color: var(--accent);
}

.clan-mini-chip:hover {
    background: rgba(88, 101, 242, 0.2);
    border-color: var(--discord);
}

.mini-chip-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-chip-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Контент */
.content-container {
    min-height: 400px;
    transition: var(--transition);
}

.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 24px;
    opacity: 0.2;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.2; }
    50% { opacity: 0.3; }
    100% { opacity: 0.2; }
}

.welcome-message h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.welcome-message p {
    font-size: 16px;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Карточка игрока */
.player-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.player-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.player-avatar {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.player-title {
    flex: 1;
}

.player-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.player-title .player-id {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-top: 4px;
}

.player-role {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    margin-top: 4px;
}

.clan-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

/* Рейтинг в клане */
.clan-rank-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.clan-rank-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.clan-rank-section h3 i {
    color: #FFD700;
}

.rank-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rank-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.rank-number {
    font-size: 24px;
    line-height: 1;
}

.rank-label {
    font-size: 10px;
    opacity: 0.9;
    margin-top: 2px;
}

.rank-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rank-details div {
    font-size: 13px;
    color: var(--text-secondary);
}

.rank-details strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Статистика */
.stats-section {
    margin-bottom: 24px;
}

.stats-section:last-child {
    margin-bottom: 0;
}

.stats-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-section h3 i {
    color: var(--accent);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.stat-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-item:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    opacity: 0;
    transition: var(--transition);
}

.stat-item:hover::before {
    opacity: 1;
}

.stat-icon {
    font-size: 18px;
    color: var(--accent);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Карточка клана */
.clan-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    animation: slideUp 0.5s ease;
}

.clan-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.clan-avatar {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--discord), #7289da);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.clan-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.clan-tag-large {
    color: var(--discord);
    font-weight: 800;
    font-size: 18px;
}

.clan-title .clan-id {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* Участники клана - сетка 2-3 в ряд */
.clan-members-section {
    margin-top: 24px;
}

.clan-members-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.clan-members-section h3 i {
    color: var(--discord);
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.member-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    background: rgba(255, 255, 255, 0.03);
}

.member-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.role-admin {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
}

.role-moder {
    background: linear-gradient(135deg, var(--warning), #fbbf24);
}

.role-member {
    background: linear-gradient(135deg, var(--success), #34d399);
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-role {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Загрузка */
.loading-state {
    text-align: center;
    padding: 80px 20px;
    animation: fadeIn 0.5s ease;
}

.loading-icon {
    font-size: 48px;
    margin-bottom: 24px;
    color: var(--accent);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.loading-state h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.loading-state p {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* Ошибка */
.error-state {
    text-align: center;
    padding: 80px 20px;
    color: #ef4444;
    animation: fadeIn 0.5s ease;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 24px;
}

.error-state h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.error-state p {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* Добавьте эти стили в существующий файл */

/* ==================== МОБИЛЬНАЯ ОПТИМИЗАЦИЯ ==================== */

/* Уменьшение отступов на мобилках */
@media (max-width: 768px) {
    /* Уменьшаем общие отступы */
    .app-container {
        padding: 20px 12px;
    }
    
    /* Уменьшаем логотип */
    .logo-text {
        font-size: 24px;
    }
    
    .logo-image {
        width: 60px;
        height: 44px;
    }
    
    /* Уменьшаем высоту поиска */
    .search-wrapper {
        height: 56px;
        margin-bottom: 20px; /* Увеличили отступ снизу */
    }
    
    .search-button {
        width: 48px;
        height: 48px;
    }
    
    /* УВЕЛИЧИВАЕМ ОТСТУП МЕЖДУ ПОИСКОМ И ПОДСКАЗКАМИ */
    .suggestions-container {
        margin-top: 20px; /* Было 15px */
        gap: 8px;
    }
    
    /* Маленькие чипы делаем более компактными */
    .mini-chip {
        padding: 6px 14px;
        font-size: 13px;
        max-width: 180px;
    }
    
    /* Уменьшаем шрифт ввода */
    .search-input {
        font-size: 14px;
    }
    
    .search-input::placeholder {
        font-size: 14px;
    }
}

/* Особые стили для очень маленьких экранов */
@media (max-width: 480px) {
    /* Еще больше уменьшаем */
    .app-container {
        padding: 15px 10px;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .header-section {
        margin-bottom: 25px;
    }
    
    /* УВЕЛИЧИВАЕМ ОТСТУП ЕЩЕ БОЛЬШЕ */
    .search-wrapper {
        margin-bottom: 25px;
    }
    
    .suggestions-container {
        margin-top: 25px; /* Еще больше отступ */
    }
    
    /* ДЕЛАЕМ МИНИ-ЧИПЫ В ПОЛНУЮ ШИРИНУ */
    .mini-chip {
        max-width: 100%;
        width: 100%;
        text-align: center;
        padding: 8px 16px;
    }
    
    .mini-chip-content {
        justify-content: center;
    }
    
    /* ДЕЛАЕМ РЕЗУЛЬТАТЫ БОЛЕЕ КОМПАКТНЫМИ */
    .content-container {
        min-height: 300px; /* Было 400px */
    }
    
    /* Карточки игроков и кланов */
    .player-card,
    .clan-card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    /* Уменьшаем заголовки */
    .player-title h1,
    .clan-title h1 {
        font-size: 18px;
    }
    
    /* Уменьшаем аватары */
    .player-avatar,
    .clan-avatar {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    /* Статистика - меньше отступов */
    .stats-section {
        margin-bottom: 16px;
    }
    
    .stats-section h3 {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    /* СЕТКА СТАТИСТИКИ - 2 КОЛОНКИ НА ВСЕХ ЭКРАНАХ */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* Уменьшаем блоки статистики */
    .stat-item {
        padding: 10px;
        min-height: 80px; /* Фиксированная высота */
    }
    
    .stat-icon {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .stat-value {
        font-size: 18px;
        margin-bottom: 3px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    /* Рейтинг в клане - компактнее */
    .clan-rank-section {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .rank-badge {
        width: 50px;
        height: 50px;
    }
    
    .rank-number {
        font-size: 20px;
    }
    
    /* Участники клана - более компактные карточки */
    .members-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .member-card {
        padding: 10px;
        gap: 8px;
    }
    
    .member-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .member-name {
        font-size: 13px;
    }
    
    .member-role {
        font-size: 10px;
    }
    
    /* Загрузка и ошибки */
    .loading-state,
    .error-state {
        padding: 40px 15px;
    }
    
    .loading-icon,
    .error-icon {
        font-size: 36px;
    }
    
    .loading-state h2,
    .error-state h2 {
        font-size: 18px;
    }
    
    /* Приветственное сообщение */
    .welcome-message {
        padding: 40px 15px;
    }
    
    .welcome-icon {
        font-size: 48px;
    }
    
    .welcome-message h2 {
        font-size: 18px;
    }
    
    .welcome-message p {
        font-size: 14px;
    }
}

/* Очень маленькие экраны (iPhone SE и подобные) */
@media (max-width: 320px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .members-grid {
        grid-template-columns: 1fr;
    }
    
    .mini-chip {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .search-input {
        font-size: 13px;
    }
}

/* Горизонтальная ориентация на мобилках */
@media (max-height: 500px) and (orientation: landscape) {
    .app-container {
        padding: 10px;
    }
    
    .logo-container {
        flex-direction: row;
        justify-content: center;
        gap: 15px;
    }
    
    .logo-image {
        width: 40px;
        height: 30px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .header-section {
        margin-bottom: 15px;
    }
    
    .search-wrapper {
        height: 48px;
        margin-bottom: 15px;
    }
    
    .content-container {
        min-height: 200px;
    }
    
    .suggestions-container {
        margin-top: 15px;
    }
}

/* Улучшаем touch-интерфейс */
@media (hover: none) and (pointer: coarse) {
    /* Увеличиваем область клика для мобилок */
    .mini-chip,
    .search-button,
    .icon-btn,
    .member-card,
    .stat-item {
        min-height: 44px; /* Минимальная высота для touch */
    }
    
    /* Увеличиваем отступы внутри кликабельных элементов */
    .mini-chip {
        padding: 10px 16px;
    }
    
    /* Убираем hover-эффекты на тач-устройствах */
    .mini-chip:active,
    .search-button:active,
    .icon-btn:active,
    .member-card:active,
    .stat-item:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    /* Анимация нажатия */
    @keyframes touchFeedback {
        0% { transform: scale(1); }
        50% { transform: scale(0.98); }
        100% { transform: scale(1); }
    }
    
    .mini-chip:active,
    .search-button:active {
        animation: touchFeedback 0.2s ease;
    }
}

/* Плавная прокрутка */
html {
    scroll-behavior: smooth;
}

/* Предотвращаем масштабирование при двойном тапе на iOS */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Улучшаем отображение на iOS */
@supports (-webkit-touch-callout: none) {
    .search-input {
        font-size: 16px; /* Предотвращаем авто-зум в iOS */
    }
}