/* Основной контейнер */
.children-profiles-gallery {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Фильтр категорий */
.children-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.children-filter-btn {
    padding: 10px 20px;
    background: #f0f0f0;
    border: 2px solid transparent;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
    white-space: nowrap;
}

.children-filter-btn:hover {
    background: #e0e0e0;
}

.children-filter-btn.active {
    background: #007cba;
    color: #ffffff;
    border-color: #005a87;
}

/* Липкий фильтр */
.children-filter.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 10px 20px;
    margin: 0;
}

/* Сетка профилей */
.children-grid {
    display: grid;
    gap: 25px;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

/* Динамические колонки */
.children-profiles-gallery[data-columns="1"] .children-grid {
    grid-template-columns: repeat(1, 1fr);
}

.children-profiles-gallery[data-columns="2"] .children-grid {
    grid-template-columns: repeat(2, 1fr);
}

.children-profiles-gallery[data-columns="3"] .children-grid {
    grid-template-columns: repeat(3, 1fr);
}

.children-profiles-gallery[data-columns="4"] .children-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Карточка профиля */
.children-card {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
    display: flex;
    flex-direction: column;
}

.children-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.children-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Фото */
.children-photo {
    position: relative;
    width: 100%;
    padding-top: 75%; /* Соотношение 4:3 */
    overflow: hidden;
    background-color: #f5f5f5;
}

/* Книжная ориентация */
.children-profiles-gallery[data-orientation="portrait"] .children-photo {
    padding-top: 133.33%; /* Соотношение 3:4 */
}

.children-photo img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease;
}

.children-card:hover .children-photo img {
    transform: translate(-50%, -50%) scale(1.05);
}

.photo-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 16px;
    text-align: center;
    padding: 20px;
}

/* Контент */
.children-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.children-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
    margin: 0 0 8px 0;
}

.children-age-gender {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.children-location {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.children-siblings {
    font-size: 13px;
    color: #007cba;
    margin-bottom: 8px;
    font-weight: 500;
}

.children-description {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    word-wrap: break-word;
}

/* Индикатор загрузки */
.children-loader {
    text-align: center;
    padding: 20px;
}

.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Сообщение о пустом результате */
.no-profiles {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
    grid-column: 1 / -1;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Адаптивность */
@media (max-width: 768px) {
    .children-profiles-gallery[data-columns="3"] .children-grid,
    .children-profiles-gallery[data-columns="4"] .children-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .children-filter {
        gap: 8px;
    }
    
    .children-filter-btn {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    .children-title {
        font-size: 16px;
    }
    
    .children-description {
        font-size: 13px;
    }
    
    .children-content {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .children-profiles-gallery[data-columns="2"] .children-grid,
    .children-profiles-gallery[data-columns="3"] .children-grid,
    .children-profiles-gallery[data-columns="4"] .children-grid {
        grid-template-columns: 1fr;
    }
    
    .children-title {
        font-size: 15px;
    }
    
    .children-description {
        font-size: 12px;
    }
    
    .children-filter-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}