/* Family Tree Application Styles */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    line-height: 1.6;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
}

/* Cards */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* Tree Cards */
.tree-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.tree-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.tree-stats {
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* Tables */
.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

/* Forms */
.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
}

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

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.375em 0.75em;
}

/* Member Profile Images */
.member-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border: 3px solid var(--light-color);
}

.member-photo-sm {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

/* Tree Visualization */
.tree-container {
    background: white;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    overflow: auto;
    min-height: 500px;
}

.tree-node {
    background: white;
    border: 2px solid var(--accent-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin: 0.5rem;
    min-width: 150px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tree-node.male {
    border-color: #3498db;
    background-color: #ebf5fb;
}

.tree-node.female {
    border-color: #e74c3c;
    background-color: #fdedec;
}

.tree-node.other {
    border-color: #9b59b6;
    background-color: #f4ecf7;
}

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

.media-item {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    overflow: hidden;
}

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

.media-item .media-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.5rem;
}

/* Statistics Cards */
.stat-card {
    text-align: center;
    padding: 1.5rem;
}

.stat-card h3 {
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.stat-card .text-primary { color: var(--accent-color) !important; }
.stat-card .text-success { color: var(--success-color) !important; }
.stat-card .text-info { color: #17a2b8 !important; }
.stat-card .text-warning { color: var(--warning-color) !important; }

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .media-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }
    
    .member-photo {
        width: 100px;
        height: 100px;
    }
    
    .media-gallery {
        grid-template-columns: 1fr;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

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

.border-left-primary {
    border-left: 4px solid var(--accent-color) !important;
}

.border-left-success {
    border-left: 4px solid var(--success-color) !important;
}

.border-left-warning {
    border-left: 4px solid var(--warning-color) !important;
}

/* Print Styles */
@media print {
    .navbar, .btn, .card-footer, .no-print {
        display: none !important;
    }
    
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    
    .container {
        max-width: 100% !important;
    }
}

/* Notification Styles */
.notification-dropdown {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.notification-item {
    transition: background-color 0.2s;
    padding: 0.75rem 1rem;
}

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

.notification-item.unread {
    background-color: #e7f3ff;
    border-left: 3px solid #0d6efd;
}

.notification-item h6 {
    font-weight: 600;
    color: #212529;
}

.notification-dropdown .dropdown-header {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
}

/* Activity Timeline */
.activity-timeline {
    position: relative;
    padding-left: 30px;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.activity-item {
    position: relative;
    padding-bottom: 20px;
}

.activity-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #0d6efd;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #dee2e6;
}

.activity-item.activity-create::before {
    background: #28a745;
}

.activity-item.activity-update::before {
    background: #ffc107;
}

.activity-item.activity-delete::before {
    background: #dc3545;
}

/* Stats Cards Enhancement */
.stat-card {
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-bottom: 15px;
}

/* Advanced Search */
.advanced-search-panel {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.search-filter-tag {
    display: inline-block;
    background: #e7f3ff;
    border: 1px solid #0d6efd;
    border-radius: 20px;
    padding: 5px 15px;
    margin: 5px;
    font-size: 0.875rem;
}

.search-filter-tag .remove-filter {
    cursor: pointer;
    margin-left: 8px;
    color: #dc3545;
}

/* Export Options */
.export-card {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.export-card:hover {
    border-color: #0d6efd;
    background-color: #f8f9fa;
    transform: translateY(-3px);
}

.export-card i {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Comparison View */
.comparison-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.comparison-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: center;
}

.comparison-body {
    padding: 20px;
}

.comparison-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.comparison-row:last-child {
    border-bottom: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .notification-dropdown {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: 0;
    }
    
    .stat-card {
        margin-bottom: 15px;
    }
    
    .activity-timeline {
        padding-left: 20px;
    }
}