/* GEDCOM Family Tree - Main Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
}

/* Navbar Customization */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.85);
    transition: color 0.2s;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
}

/* Card Enhancements */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #f1f3f5;
    font-weight: 600;
    font-size: 0.9rem;
}

.card-body {
    font-size: 0.875rem;
}

.card-body .table {
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn i {
    margin-right: 0.25rem;
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
}

table.dataTable thead th {
    font-weight: 600;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

table.dataTable tbody tr:hover {
    background-color: #f1f3f5;
}

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
}

.alert-dismissible .btn-close {
    padding: 1.25rem 1.5rem;
}

/* Footer */
footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

/* Loading Spinner */
.spinner-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Badge Customization */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px #dee2e6;
    transform: translateX(-50%);
}

/* Individual/Family Cards */
.person-card {
    border-left: 4px solid var(--primary-color);
}

.person-card.male {
    border-left-color: #0d6efd;
}

.person-card.female {
    border-left-color: #d63384;
}

.person-card.unknown {
    border-left-color: var(--secondary-color);
}

/* Image Gallery */
.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.media-item:hover {
    transform: scale(1.05);
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Breadcrumbs */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.2em;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles here if needed */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item::before {
        left: 20px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    footer,
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    a[href]:after {
        content: none;
    }
}

/* Utility Classes */
.hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important;
}

.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Other Names List in Quick Facts */
.card-body ul li {
    font-size: 0.8rem;
}

.card-body ul li .badge-sm {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

/* Custom color utilities */
.text-purple {
    color: #6f42c1 !important;
}

/* Featured Biography Cards */
.featured-bio-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.biography-excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #666;
}

[data-theme="dark"] .biography-excerpt {
    color: #aaa;
}

/* Popular Names Section */
.list-group-item {
    transition: background-color 0.2s ease;
}

.list-group-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Hero Section Styles */
.hero-section {
    position: relative;
    min-height: 400px;
    background-color: var(--primary-color);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-overlay {
    position: relative;
    width: 100%;
    background: transparent;
    padding: 3rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content,
[data-theme="light"] .hero-content,
body:not([data-theme]) .hero-content {
    position: relative;
    z-index: 1;
    color: #ffffff !important;
    max-width: max-content;
    background: rgba(0, 0, 0, 0.5);
    padding: 2.5rem 3.5rem;
    border-radius: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: inline-block;
}

[data-theme="dark"] .hero-content {
    background: rgba(0, 0, 0, 0.6);
}

/* Force all text inside hero-content to be white */
.hero-content,
.hero-content *,
[data-theme="light"] .hero-content,
[data-theme="light"] .hero-content *,
body:not([data-theme]) .hero-content,
body:not([data-theme]) .hero-content * {
    color: #ffffff !important;
}

.hero-content h1,
.hero-content h1.display-4,
[data-theme="light"] .hero-content h1,
[data-theme="light"] .hero-content h1.display-4,
body:not([data-theme]) .hero-content h1,
body:not([data-theme]) .hero-content h1.display-4 {
    font-weight: 700;
    color: #ffffff !important;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
    margin-bottom: 1.5rem;
}

.hero-content h1 i,
.hero-content h1 .bi,
[data-theme="light"] .hero-content h1 i,
[data-theme="light"] .hero-content h1 .bi,
body:not([data-theme]) .hero-content h1 i,
body:not([data-theme]) .hero-content h1 .bi {
    color: #ffffff !important;
}

.hero-content p,
.hero-content p.lead,
[data-theme="light"] .hero-content p,
[data-theme="light"] .hero-content p.lead,
body:not([data-theme]) .hero-content p,
body:not([data-theme]) .hero-content p.lead {
    font-size: 1.5rem;
    font-weight: 400;
    color: #ffffff !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    margin-bottom: 1rem;
}

.hero-content p.hero-subtitle,
[data-theme="light"] .hero-content p.hero-subtitle,
body:not([data-theme]) .hero-content p.hero-subtitle {
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
    font-size: 1.1rem;
}

.hero-content .btn-light {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    font-weight: 500;
    padding: 0.75rem 2rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
    background-color: #ffffff;
    border-color: #ffffff;
    color: #212529 !important;
}

.hero-content .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
    background-color: #f8f9fa;
    color: #212529 !important;
}

.hero-content .btn-light i {
    color: #212529 !important;
}

/* Responsive hero section */
@media (max-width: 768px) {
    .hero-section {
        min-height: 300px;
    }
    
    .hero-overlay {
        padding: 2rem 1rem;
    }
    
    .hero-content {
        padding: 2rem 2rem;
        max-width: 90%;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .hero-content .lead {
        font-size: 1rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
}

