/* Families Page Specific Styles */

.families-page {
    background-color: #f8f9fa;
    min-height: calc(100vh - 200px);
}

.page-header {
    text-align: center;
    padding: 2rem 0;
    background: white;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Search and Filters */
.search-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    gap: 2rem;
    align-items: end;
    flex-wrap: wrap;
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
    min-width: 300px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background-color: var(--secondary-color);
}

.clear-search {
    padding: 12px 16px;
    color: var(--accent-color);
    text-decoration: none;
    border: 1px solid var(--accent-color);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.clear-search:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Search Results Info */
.search-results-info {
    background: #e8f4fd;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.search-results-info p {
    margin: 0;
    color: var(--primary-color);
    font-weight: 500;
}

/* Families Grid */
.families-grid-container {
    min-height: 500px;
}

.families-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.family-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    padding: 2rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.family-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.family-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.family-header h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.marriage-info {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.marriage-icon, .location-icon {
    margin-right: 0.3rem;
}

/* Family Members */
.family-members {
    margin-bottom: 1.5rem;
}

.parents, .children {
    margin-bottom: 1.5rem;
}

.parents h4, .children h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.parents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.parent {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.parent:hover {
    background: #e9ecef;
}

.parent-photo, .child-photo {
    margin-bottom: 0.5rem;
}

.parent-photo img, .child-photo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.photo-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0 auto;
    color: white;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.photo-placeholder.male {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.photo-placeholder.female {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.photo-placeholder:not(.male):not(.female) {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.parent-info h5, .child-info h6 {
    margin: 0.5rem 0 0.3rem 0;
}

.parent-info h5 a, .child-info h6 a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.parent-info h5 a:hover, .child-info h6 a:hover {
    color: var(--accent-color);
}

.dates, .birth-year {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

/* Children */
.children-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.child {
    text-align: center;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.child:hover {
    background: #e9ecef;
}

.child-photo img {
    width: 50px;
    height: 50px;
}

.child .photo-placeholder {
    width: 50px;
    height: 50px;
    font-size: 0.9rem;
}

.child-info h6 {
    font-size: 0.9rem;
    margin: 0.3rem 0;
}

.more-children {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    border-radius: 8px;
    color: #666;
    font-weight: 600;
    font-size: 0.9rem;
}

.no-children {
    text-align: center;
    color: #999;
    font-style: italic;
    margin: 1rem 0;
}

/* Family Actions */
.family-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid;
    cursor: pointer;
    background: none;
}

.btn-small.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-small.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.btn-small.btn-secondary {
    background-color: transparent;
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-small.btn-secondary:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 10px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.close {
    color: #aaa;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--accent-color);
}

.modal-body {
    padding: 2rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.no-results h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-results p {
    color: #666;
    margin-bottom: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.page-link {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-decoration: none;
    color: var(--primary-color);
    background-color: white;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-link.current {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 700;
}

.pagination-info {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Active Navigation */
.nav-menu a.active {
    color: var(--accent-color);
    font-weight: 700;
}

/* Responsive Design */
@media (max-width: 768px) {
    .families-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .search-form {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .search-input-group {
        min-width: auto;
    }
    
    .parents-grid {
        grid-template-columns: 1fr;
    }
    
    .children-list {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .family-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-header, .modal-body {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .family-card {
        padding: 1.5rem;
    }
    
    .page-header {
        padding: 1rem 0;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .search-filters {
        padding: 1rem;
    }
    
    .children-list {
        grid-template-columns: repeat(3, 1fr);
    }
}