* { 
    box-sizing: border-box; 
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    background: #f1f1f1; 
    color: #333; 
    margin: 0; 
    padding: 0; 
    -webkit-tap-highlight-color: transparent; 
}

header { 
    background: #23282d; 
    color: #fff; 
    padding: 15px 10px; 
    text-align: center; 
    width: 100%; 
}

header h1 { 
    margin: 0 0 10px 0; 
    font-size: 22px; 
}

header h1 a { 
    color: #fff; 
    text-decoration: none; 
}

/* ИСХОДНАЯ ПЕРВОНАЧАЛЬНАЯ ФОРМА ПОИСКА (ДО ВСЕХ ПРАВОК) */
.search-form { 
    width: 100%; 
    max-width: 500px; 
    margin: 0 auto; 
    display: flex; 
    gap: 5px; 
}

.search-form input[type="text"] { 
    padding: 10px; 
    flex-grow: 1; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    font-size: 16px; 
    outline: none; 
}

.search-form input[type="submit"] { 
    padding: 10px 20px; 
    background: #007cba; 
    border: none; 
    color: #fff; 
    border-radius: 4px; 
    cursor: pointer; 
    font-size: 16px; 
    font-weight: bold; 
}

/* БАЗОВЫЙ МОБИЛЬНЫЙ КОНТЕЙНЕР (INSTAGRAM-STYLE EDGE-TO-EDGE) */
.container { 
    width: 100%; 
    max-width: 1200px; 
    margin: 0 auto; 
    background: #fff; 
    padding: 15px 0; 
    border: none; 
    border-radius: 0; 
}

.container h2 {
    padding: 0 15px;
    font-size: 20px;
    margin-top: 10px;
}

.container p {
    padding: 0 15px;
}

/* СЕТКА МОДЕЛЕЙ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ */
.user-card-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* КАРТОЧКА МОДЕЛИ НА МОБИЛЬНЫХ (Вертикальное монолитное построение) */
.artist-item { 
    padding: 25px 15px; 
    border-bottom: 1px solid #e5e5e5; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    gap: 15px;
    border-radius: 0; 
    margin-bottom: 4px; 
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.artist-main-info { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 12px; 
    z-index: 2; 
    width: 100%;
}

/* СОХРАНЕНО: ОГРОМНЫЙ АВАТАР (275Х275 ПИКСЕЛЕЙ) */
.artist-avatar {
    width: 275px; 
    height: 275px; 
    border-radius: 50%; 
    border: 4px solid #fff; 
    object-fit: cover; 
    background: #222; 
    flex-shrink: 0; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.artist-item a { 
    font-size: 20px; 
    font-weight: bold; 
    color: #fff; 
    text-decoration: none; 
    word-break: break-all; 
    text-align: center;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.95); 
}

.artist-item a:hover { 
    text-decoration: underline; 
}

.followers { 
    color: #fff; 
    font-size: 14px; 
    font-weight: bold; 
    background: rgba(35, 40, 45, 0.9); 
    padding: 6px 16px; 
    border-radius: 20px; 
    white-space: nowrap; 
    z-index: 2; 
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    text-align: center;
}

/* ЛЕНТА ПОСТОВ В СТИЛЕ INSTAGRAM */
.post-card { 
    border: none; 
    border-bottom: 1px solid #e5e5e5; 
    margin: 0 0 10px 0; 
    padding: 10px 0; 
    background: #fff; 
    border-radius: 0; 
    word-break: break-word; 
}

.post-card h2, .post-card p, .post-card small {
    padding: 0 15px;
}

.post-card h2 { 
    font-size: 18px; 
    margin-top: 0; 
}

.post-card p { 
    font-size: 15px; 
    line-height: 1.5; 
}

.post-media { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 2px; 
    margin-top: 10px; 
    justify-content: center; 
}

.post-media img, .post-media video { 
    width: 100%; 
    max-width: 100%; 
    height: auto; 
    border-radius: 0; 
    object-fit: cover; 
}

.pagination { 
    margin: 20px 0; 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 5px; 
}

.pagination a { 
    padding: 10px 14px; 
    background: #ddd; 
    color: #333; 
    text-decoration: none; 
    border-radius: 4px; 
    font-size: 14px; 
    font-weight: bold; 
}

.pagination a.active { 
    background: #23282d; 
    color: #fff; 
}

.pagination a.nav-page { 
    display: none; 
}

.btn-back { 
    display: inline-block; 
    padding: 8px 15px; 
    background: #eee; 
    color: #333; 
    text-decoration: none; 
    border-radius: 4px; 
    font-weight: bold; 
    margin-bottom: 15px; 
    font-size: 14px; 
    margin-left: 15px;
}

#loading-indicator { 
    text-align: center; 
    padding: 15px; 
    font-weight: bold; 
    color: #666; 
    display: none; 
}

/* ==================== МЕДИА-ЗАПРОСЫ ДЛЯ ПЛАНШЕТОВ И ПК ==================== */
@media (min-width: 600px) {
    header h1 { 
        font-size: 28px; 
    }
    
    .container { 
        margin: 20px auto; 
        padding: 25px; 
        border: 1px solid #e5e5e5;
        border-radius: 3px;
    }
    
    /* НА ПK: Многоколоночный CSS GRID со смещением данных под аватар */
    .user-card-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr); 
        gap: 15px;
        padding: 0 15px;
    }

    .artist-item {
        border-radius: 6px;
        margin-bottom: 0;
        width: 100%;
        padding: 30px 15px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .post-card {
        border: 1px solid #e5e5e5;
        border-radius: 4px;
        margin: 15px 0;
        padding: 15px;
    }
    
    .post-card h2, .post-card p, .post-card small { 
        padding: 0; 
    }
    
    .post-card h2 { 
        font-size: 22px; 
    }
    
    .post-media { 
        gap: 10px; 
    }
    
    .post-media img, .post-media video { 
        width: calc(50% - 5px); 
        border-radius: 4px; 
    }
    
    .pagination a.nav-page { 
        display: inline-block; 
    }
}

/* НА МОНИТОРАХ ПК: GRID на 3 колонки в один ряд */
@media (min-width: 950px) {
    .user-card-grid {
        grid-template-columns: repeat(3, 1fr); 
    }
}
