/* Family Tree - Main Styles */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --card-width: 180px;
    --card-height: 220px;
    --card-border-radius: 10px;
    --bs-card-color: red;
}

/* Base styles */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Navbar customization */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.navbar-brand {
    font-weight: 600;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

/* Search form in navbar */
.search-form {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-form .input-group {
    width: 100%;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.75rem;
}

.search-result-item .placeholder-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    color: #6c757d;
}

.search-result-item .person-info {
    flex: 1;
}

.search-result-item .person-name {
    font-weight: 500;
    margin-bottom: 0;
}

.search-result-item .person-dates {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Edit mode toggle button */
#toggleEditMode {
    transition: all 0.3s ease;
}

#toggleEditMode.active {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: #000;
}

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

/* Card styles */
.card {
    border-radius: var(--card-border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Modal improvements */
.modal-header {
    background-color: var(--primary-color);
    color: white;
    border-top-left-radius: calc(var(--card-border-radius) - 1px);
    border-top-right-radius: calc(var(--card-border-radius) - 1px);
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Photo gallery in modal */
#personDetailGallery img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

#personDetailGallery img:hover {
    border-color: var(--primary-color);
}

/* Form styles */
.form-label {
    font-weight: 500;
}

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

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-overlay.hidden {
    display: none;
}

/* Alert styling */
.alert {
    border-radius: var(--card-border-radius);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-form {
        margin: 1rem 0;
        max-width: 100%;
    }

    .navbar-nav {
        padding-top: 1rem;
    }

    #toggleEditMode {
        margin: 0.5rem 0;
    }
}

/* Utility classes */
.cursor-pointer {
    cursor: pointer;
}

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

/* Admin dashboard */
.admin-stats .card {
    transition: transform 0.2s;
}

.admin-stats .card:hover {
    transform: translateY(-5px);
}

/* Animation for elements */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* Badge improvements */
.badge {
    font-weight: 500;
}

/* Table improvements */
.table th {
    font-weight: 600;
    background-color: #f8f9fa;
}

/* Dropdown menu styling */
.dropdown-item i {
    margin-right: 0.5rem;
    width: 16px;
    text-align: center;
}
