body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 25%, #3b82f6 50%, #6366f1 75%, #8b5cf6 100%);
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(59, 130, 246, 0.4) 0%, transparent 50%);
    z-index: -1;
}

.main-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 32px 64px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.view-tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.view-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(14, 165, 233, 0.2);
}

.view-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 50px;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    margin: 0 0.25rem;
}

.view-tab:hover {
    background: rgba(14, 165, 233, 0.1);
    color: #0369a1;
}

.view-tab.active {
    background: linear-gradient(145deg, #ced9f2, #0284c7);
    color: white;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

@media (max-width: 640px) {
    .view-tabs-container {
        display: none;
    }
}

.tree-container {
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    min-height: 800px;
    padding: 2rem 0;
    white-space: nowrap;
    scroll-behavior: smooth;
    background: transparent;
    position: relative;
    touch-action: pan-x pan-y;
}

.tree {
    min-width: max-content;
    padding-top: 30px;
    display: inline-block;
}

.tree-container::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    background: transparent;
}

@media (min-width: 768px) {
    .tree-container {
        padding: 0;
    }
}

.tree ul {
    padding-top: 20px;
    position: relative;
    transition: all 0.5s ease;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
}

.tree li {
    text-align: center;
    list-style-type: none;
    position: relative;
    padding: 20px 5px 0 5px;
    transition: all 0.5s ease;
    min-width: 190px;
}

@media (max-width: 768px) {
    .tree li {
        padding: 15px 5px 0 5px;
        min-width: 210px;
    }
}

.tree li::before, .tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 3px solid #ced9f2;
    width: 50%;
    height: 20px;
    opacity: 0.7;
}

.tree li::after {
    right: auto;
    left: 50%;
    border-left: 3px solid #ced9f2;
}

.tree li:only-child::after, .tree li:only-child::before {
    display: none;
}
.tree li:only-child {
    padding-top: 0;
}
.tree li:first-child::before, .tree li:last-child::after {
    border: 0 none;
}
.tree li:last-child::before {
    border-right: 3px solid #ced9f2;
    border-radius: 0 8px 0 0;
}
.tree li:first-child::after {
    border-radius: 8px 0 0 0;
}

.tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 3px solid #ced9f2;
    width: 0;
    height: 20px;
    opacity: 0.7;
}

/* Person Cards (for individual family members in tree) */
.tree-card:not(.family-tree-card) {
    border: 2px solid rgba(14, 165, 233, 0.2);
    padding: 5px;
    text-decoration: none;
    color: #374151;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    display: inline-block;
    border-radius: 16px;
    width: 150px;
    min-height: 200px;
    height: 230px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    overflow: visible;
    padding-bottom: 30px; /* Space for the add button */
    vertical-align: top;
}

@media (max-width: 768px) {
    .tree-card {
        min-width: 200px;
        max-width: 240px;
        padding: 5px;
    }
}

.tree-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ced9f2, #0284c7);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tree-card:hover::before {
    transform: scaleX(1);
}

.tree-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 10px 20px -5px rgba(14, 165, 233, 0.3);
    border-color: rgba(14, 165, 233, 0.4);
}

.person-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    white-space: normal;
}

.person-details {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
    line-height: 1.4;
    white-space: normal;
}

.person-age-2025 {
    font-size: 0.8rem;
    font-weight: 500;
    color: #ced9f2;
    background: rgba(14, 165, 233, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    display: inline-block;
    margin: 0.25rem 0;
    white-space: normal;
}

/* Vertical mode (default) - couples horizontally aligned */
.couple-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    flex-direction: row;
}

@media (max-width: 768px) {
    .couple-container {
        gap: 10px;
    }
}

.spouse {
    background: linear-gradient(145deg, #f0f9ff, #e0f2fe);
    border-color: rgba(14, 165, 233, 0.3);
}

.spouse .person-name {
    color: #0369a1;
    font-weight: 500;
}

.deceased {
    background: linear-gradient(145deg, #f3f4f6, #e5e7eb);
    border-color: rgba(107, 114, 128, 0.3);
    white-space: normal;
}

.deceased .person-name, .deceased .person-details {
    color: #6b7280;
}

.life-events {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.25rem;
}

.deceased-info, .birth-info {
    font-size: 0.8rem;
    color: #6b7280;
}

.author {
    background: linear-gradient(145deg, #dbeafe, #bfdbfe);
    border-color: rgba(59, 130, 246, 0.4);
}

.recipient {
    background: linear-gradient(145deg, #fef3c7, #fde68a);
    border-color: rgba(245, 158, 11, 0.4);
}

.language-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 50px;
    padding: 0.75rem;
    box-shadow: 
        0 16px 32px -8px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.flag-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 0.25rem;
}

.flag-btn:hover {
    transform: scale(1.1);
    border-color: #ced9f2;
}

.flag-btn.active {
    border-color: #ced9f2;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.fade-transition {
    transition: opacity 0.3s ease;
}

@media (max-width: 640px) {
    .language-toggle {
        top: 10px;
        right: 10px;
        padding: 0.25rem;
    }
    
    .flag-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}

.scroll-hint {
    display: block;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 1rem;
    animation: pulse 2s infinite;
}

@media (min-width: 768px) {
    .scroll-hint {
        display: none;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    opacity: 0.5;
    pointer-events: none;
}

.person-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #e0f2fe;
    color: #0369a1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 auto 10px;
    border: 3px solid #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.person-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.3);
    border-color: #ced9f2;
}

.person-photo::after {
    content: '📷';
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #ced9f2;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.person-photo:hover::after {
    opacity: 1;
}

.person-photo.has-image::after {
    content: '✏️';
}

.person-photo.has-image {
    color: transparent;
}

/* Photo Menu Styles */
.photo-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(14, 165, 233, 0.2);
    padding: 8px;
    z-index: 1000;
    display: none;
    min-width: 150px;
}

.photo-menu-option {
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #374151;
}

.photo-menu-option:hover {
    background: rgba(14, 165, 233, 0.1);
    color: #0369a1;
}

.photo-menu-option.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* Photo Preview Modal */

.photo-preview-content {
    max-width: 95vw;
    max-height: 95vh;
    position: relative;
    transform: scale(1.5);
    transform-origin: center;
}

.photo-preview-image {
    width: 70vw;
    height: 70vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

/* Ensure the modal can handle larger images */
.photo-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    overflow: auto;
}

.photo-preview-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    z-index: 1001;
    transition: all 0.3s ease;
}

.photo-preview-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .photo-preview-content {
        transform: scale(1.2);
        max-width: 90vw;
        max-height: 90vh;
    }
    
    .photo-preview-image {
        min-width: 250px;
        min-height: 250px;
    }
    
    .photo-preview-close {
        top: 5px;
        right: 5px;
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
}

/* Add Member Form Modal */
.add-member-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.add-member-form {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(14, 165, 233, 0.2);
    border-radius: 12px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: #ced9f2;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(145deg, #ced9f2, #0284c7);
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border: 2px solid rgba(107, 114, 128, 0.2);
}

.btn-secondary:hover {
    background: rgba(107, 114, 128, 0.2);
    color: #4b5563;
}

/* Horizontal Tree Layout */
.tree-container.horizontal {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 60vh;
    padding: 20px;
}

.tree.horizontal ul {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 60px;
    padding-top: 0;
    position: relative;
}

.tree.horizontal ul:first-child {
    padding-left: 0;
}

.tree.horizontal li {
    display: flex;
    align-items: center;
    padding: 15px 0;
    min-width: auto;
    width: 100%;
    position: relative;
}

.tree.horizontal .couple-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-right: 30px;
    flex-shrink: 0;
    position: relative;
}

/* Horizontal connecting lines - Simple and clean */
.tree.horizontal li > ul {
    margin-left: 40px;
    padding-left: 20px;
    border-left: 2px solid #ced9f2;
    position: relative;
}

.tree.horizontal ul:first-child {
    border-left: none;
}

/* Horizontal line from each child to the vertical line */
.tree.horizontal li::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    width: 20px;
    height: 2px;
    background: #ced9f2;
}

/* Don't show connecting line for root element */
.tree.horizontal ul:first-child > li::before {
    display: none;
}

/* Remove default vertical tree styles */
.tree.horizontal li::after {
    display: none;
}

.tree.horizontal ul ul::before {
    display: none;
}

.tree.horizontal li:not(:last-child) {
    margin-bottom: 25px;
}

.tree.horizontal .tree-card {
    max-width: 180px;
    min-width: 160px;
    margin-bottom: 5px;
}

.tree.horizontal .couple-container .tree-card {
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .tree.horizontal .tree-card {
        max-width: 200px;
        min-width: 180px;
    }
    
    .tree.horizontal .couple-container {
        gap: 8px;
        margin-right: 15px;
    }

    .tree.horizontal ul {
        padding-left: 30px;
    }

    .tree.horizontal li > ul {
        margin-left: 30px;
        padding-left: 15px;
    }

.tree.horizontal li::before {
    left: -15px;
    width: 15px;
}
}

/* Action Buttons */
.person-action-btn {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
}

.tree-card:hover .person-action-btn {
    opacity: 1;
    visibility: visible;
}

.person-action-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.add-spouse-btn {
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #28a745;
}

.delete-person-btn {
    top: -10px;
    right: -10px;
    background-color: #dc3545;
}

.edit-person-btn {
    top: -40px;
    right: -10px;
    background-color: #007bff;
}

.editable-field {
    border-bottom: 2px dashed rgba(255, 255, 255, 0.5);
    cursor: text;
    padding-bottom: 2px;
}

.editable-field:focus {
    outline: none;
    border-bottom: 2px dashed #0ea5e9;
}

/* Empty state button */
.empty-tree-btn {
    display: none;
    padding: 1.25rem 2.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(145deg, #0ea5e9, #0284c7);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.4);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.empty-tree-btn:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 15px 30px -5px rgba(14, 165, 233, 0.5);
}

/* Trees Page Styles */
/* Enhanced Tree Cards Styling */
.trees-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 1200px) {
    .trees-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Family Tree Cards (for trees page) */
.tree-card.family-tree-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    min-height: 420px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.tree-card.family-tree-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.tree-card.family-tree-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tree-card.family-tree-card:hover::before {
    opacity: 1;
}

.add-tree-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    backdrop-filter: blur(20px);
    border: 2px dashed rgba(255, 255, 255, 0.6);
    color: #1a202c;
    box-shadow: 0 8px 32px rgba(240, 147, 251, 0.3);
}

.add-tree-card:hover {
    background: linear-gradient(135deg, #e879f9 0%, #ef4444 100%);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 60px rgba(240, 147, 251, 0.4);
}

.tree-image {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: rgba(102, 126, 234, 0.6);
    position: relative;
    overflow: hidden;
}

.tree-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
}

.tree-content {
    padding: 24px;
    color: #2d3748;
}

.add-tree-card .tree-content {
    color: #1a202c;
}

.tree-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
    color: #1a202c;
}

.add-tree-card .tree-title {
    color: #1a202c;
    font-weight: 800;
}

.tree-subtitle {
    font-size: 0.95rem;
    color: #718096;
    margin-bottom: 20px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.add-tree-card .tree-subtitle {
    color: #1a202c;
    font-weight: 500;
}

.tree-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.add-tree-card .tree-footer {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.tree-date {
    font-size: 0.8rem;
    color: #a0aec0;
    font-weight: 500;
}

.add-tree-card .tree-date {
    color: #1a202c;
    font-weight: 500;
}

.tree-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.action-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.1);
}

.add-tree-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* Modal Enhancements */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 3% auto;
    padding: 40px;
    border-radius: 24px;
    width: 90%;
    max-width: 550px;
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-height: 60vh;
    overflow-y: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-60px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Header Enhancements */
.main-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.main-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.main-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Family Photo Modal Styles */
.family-photo-modal {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
}

.family-photo-modal-content {
    background: transparent;
    backdrop-filter: blur(20px);
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 95%;
    max-width: 1000px;
    max-height: 95vh;
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.family-photo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.family-photo-header h3 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.family-photo-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.family-photo-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.family-photo-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 400px;
}

.family-photo-image-container img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.family-photo-actions {
    text-align: center;
    padding: 20px 30px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.family-photo-enter-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    text-transform: none;
    letter-spacing: 0.5px;
}

.family-photo-enter-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* Family Photo Menu Styles */
.photo-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    min-width: 150px;
}

.photo-menu-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
}

.photo-menu-option:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.photo-menu-option span:first-child {
    font-size: 16px;
}

/* Trees Page Responsive Design */
@media (max-width: 768px) {
    .trees-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .tree-card.family-tree-card {
        min-height: 450px;
        min-width: 100%;
    }
    
    .tree-content {
        padding: 20px;
    }
    
    .photo-menu {
        min-width: 140px;
    }
    
    .photo-menu-option {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    /* Family Photo Modal Responsive */
    .family-photo-modal-content {
        width: 98%;
        margin: 1% auto;
        max-height: 98vh;
    }
    
    .family-photo-header {
        padding: 15px 20px;
    }
    
    .family-photo-header h3 {
        font-size: 1.2rem;
    }
    
    .family-photo-close {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }
    
    .family-photo-image-container {
        padding: 15px;
        min-height: 300px;
    }
    
    .family-photo-image-container img {
        max-height: 60vh;
    }
    
    .family-photo-actions {
        padding: 15px 20px 20px;
    }
    
    .family-photo-enter-btn {
        padding: 10px 24px;
        font-size: 0.9rem;
    }
}
