/* ========================================
   V0.13 - FAMILY WEBSITE WITH FAMILY TREE
   Learning Goal: Family Tree Implementation with Excel Upload and Horizontal Layout
   ======================================== */

/* Import all styles from V0.12 */
/* ========================================
   BASIC STYLES AND RESET
   ======================================== */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    overflow-x: hidden;
}

/* Landing page specific background */
.container {
    background-image: url('images/landingpagebg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* App container background (post-login screens) */
.app-container {
    background-image: url('images/whitebg1.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
}

/* Main content area styling */
#mainContent {
    min-height: calc(100vh - 54px); /* Account for header height */
    position: relative;
}

/* Optional overlay for better text readability on the white background */
#mainContent::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(1px);
    z-index: -1;
    pointer-events: none;
}

/* ========================================
   LANDING PAGE STYLES
   ======================================== */
.container {
    min-height: 100vh;
    position: relative;
}

/* Header Styles */
header {
    padding: 15px 50px 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 100;
    background: white;
    height: 54px;
    width: 100%;
    box-sizing: border-box;
}

/* Header styles for app container (post-login) */
.app-container header {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0px;
    font-weight: 600;
    font-size: 18px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.logo-creative {
    color: #a9a9a9; /* Light grey */
}

.logo-family {
    color: #000000; /* Black */
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Navigation links in header-nav */
.header-nav a {
    color: #262626;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    padding: 10px 15px;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent;
    border: none;
    cursor: pointer;
}

.header-nav a:hover {
    color: #5a5a7a;
}

.header-nav > a:hover::after,
.services-link:hover::after {
    content: '';
    position: absolute;
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 58%;
    height: 2px;
    background: #5a5a7a;
    border-radius: 2px;
}

/* Prevent dropdown items from getting the header nav underline */
.dropdown-content a:hover::after {
    display: none !important;
}

.btn-contact {
    background-color: transparent;
    border: none;
    color: #262626;
    padding: 10px 25px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.btn-contact:hover {
    color: #5a5a7a;
}

.btn-contact:hover::after {
    content: '';
    position: absolute;
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 58%;
    height: 2px;
    background: #5a5a7a;
    border-radius: 2px;
}

/* Hero Section */
.hero-section {
    min-height: calc(100vh - 90px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 50px;
    position: relative;
    gap: 40px;
}

.hero-content {
    max-width: 500px;
    z-index: 5;
    position: relative;
    flex-shrink: 0;
}

h1 {
    font-size: 35px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 40px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

h2 {
    font-size: 2.2rem;
    color: #3498db;
    margin-bottom: 35px;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.hero-content p {
    font-size: 16px;
    line-height: 1.7;
    color: #000000;
    margin-bottom: 45px;
    max-width: 480px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.btn-signup {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #262626;
    width: 100px;
    height: 30px;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-signup:hover {
    background-color: #0067B8;
    border-color: #0067B8;
    color: white;
    border-radius: 0;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 103, 184, 0.3);
}

.btn-login {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #262626;
    width: 100px;
    height: 30px;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-login:hover {
    background-color: #0067B8;
    border-color: #0067B8;
    color: white;
    border-radius: 0;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 103, 184, 0.3);
}

/* IMAGE SECTION */
.image-section {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    max-width: 400px;
}

.image-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    padding: 8px;
    backdrop-filter: blur(2px);
}

.image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0.06) 30%,
        rgba(255, 255, 255, 0.03) 60%,
        rgba(255, 255, 255, 0.01) 80%,
        transparent 100%);
    border-radius: 20px;
    pointer-events: none;
}

.landing-image {
    width: 100%;
    height: auto;
    border-radius: 15px;
    display: block;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Decorative Elements */
.hero-decoration {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border: 1px solid rgba(255,255,255,0.1);
}

.circle-1 {
    width: 400px;
    height: 400px;
    top: 10%;
    right: -100px;
    background: linear-gradient(135deg, rgba(180,180,200,0.08) 0%, rgba(200,200,220,0.03) 100%);
}

.circle-2 {
    width: 300px;
    height: 300px;
    top: 50%;
    right: 10%;
    background: linear-gradient(135deg, rgba(160,160,180,0.06) 0%, rgba(180,180,200,0.02) 100%);
}

.circle-3 {
    width: 200px;
    height: 200px;
    top: 70%;
    right: 30%;
    background: linear-gradient(135deg, rgba(140,140,160,0.04) 0%, rgba(160,160,180,0.01) 100%);
}

/* ========================================
   MODAL STYLES
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 20px 0;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 20px auto;
    padding: 0;
    border-radius: 0;
    max-width: 400px;
    width: 400px;
    min-height: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}

#loginModal .modal-content {
    min-height: 350px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid rgba(52, 152, 219, 0.1);
    position: relative;
}

.modal-header h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.close {
    position: absolute;
    top: 25px;
    right: 30px;
    font-size: 2rem;
    font-weight: 300;
    color: #7f8c8d;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close:hover {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    transform: rotate(90deg);
}

.auth-form {
    padding: 15px 25px 25px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    position: absolute;
    left: 15px;
    top: 12px;
    color: #7f8c8d;
    font-weight: 400;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.8);
    padding: 0 5px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(52, 152, 219, 0.1);
    border-radius: 0;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group select:focus + label,
.form-group select:not([value=""]) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -8px;
    left: 10px;
    font-size: 12px;
    color: #3498db;
    font-weight: 500;
}

.form-group input::placeholder {
    color: transparent;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(52, 152, 219, 0.1);
    border-radius: 0;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
}

.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group textarea::placeholder {
    color: transparent;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.btn-submit {
    width: 100%;
    background: #0067B8;
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #005A9F 0%, #004A87 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 103, 184, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

.switch-form {
    text-align: center;
    margin-top: 25px;
    color: #7f8c8d;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.switch-form a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.switch-form a:hover {
    text-decoration: underline;
}

/* Contact Modal Styles */
#contactModal .modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-width: 400px;
    width: 400px;
    min-height: 400px;
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    animation: modalSlideIn 0.3s ease-out;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#contactModal .modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid rgba(52, 152, 219, 0.1);
    border-radius: 0;
}

#contactModal .modal-header h3 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.modal-body {
    padding: 0;
}

.contact-info {
    padding: 15px 25px 25px;
    display: grid;
    gap: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.contact-item {
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(52, 152, 219, 0.1);
    border-radius: 0;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: #3498db;
    border-left-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.15);
}

.contact-item h4 {
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.contact-item p {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ========================================
   SERVICES DROPDOWN STYLES
   ======================================== */

.services-dropdown {
    position: relative;
    z-index: 1001;
}

.services-link {
    color: #262626;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    padding: 10px 15px;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent;
    border: none;
    cursor: pointer;
}

.services-link:hover {
    color: #5a5a7a;
}

.services-link.active {
    color: #5a5a7a;
    font-weight: 600;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    min-width: 180px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 1002;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 5px;
}

.dropdown-content a {
    color: #262626;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 12px;
    transition: all 0.3s ease;
    border-radius: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
}

.dropdown-content a:hover {
    color: #5a5a7a;
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

/* User Menu Dropdown Styles */
.user-menu-dropdown {
    position: relative;
    display: inline-block;
}

.user-menu-logo {
    color: #666;
    transition: all 0.3s ease;
}

.user-menu-logo:hover {
    color: #5a5a7a;
    transform: translateY(-2px);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    min-width: 160px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    overflow: hidden;
    margin-top: 8px;
    animation: dropdownSlideIn 0.3s ease-out;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(255, 255, 255, 0.95);
}

.btn-logout {
    background: #8e8e93;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    width: 100%;
    border: none;
    box-shadow: none;
}

.btn-logout:hover {
    background: #636366;
    transform: translateY(-1px);
}

/* ========================================
   FAMILY TREE STYLES (NEW IN V0.13)
   ======================================== */

/* Family Tree Page */
.family-tree-content {
    position: relative;
    z-index: 5;
    padding: 40px 50px 60px;
    max-width: 100%;
    margin: 0 auto;
    min-height: calc(100vh - 140px);
}

.family-tree-header {
    text-align: center;
    margin-bottom: 40px;
}

.family-tree-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 700;
}

.family-tree-header p {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.tree-actions-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: 20px 0;
    padding: 0;
}

/* Family Tree Button Styling - Green like Service Recommendation */
.family-tree-btn {
    background: linear-gradient(135deg, #27ae60 0%, #219a52 100%) !important;
    color: white !important;
    border: none !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3) !important;
}

.family-tree-btn:hover,
.family-tree-btn.active {
    background: linear-gradient(135deg, #219a52 0%, #1e8449 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4) !important;
}

/* Import and Export buttons */
.btn-import, .btn-export {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #a7c1e8; /* Darker shade */
    border: 0;
    border-radius: 15px;
    box-shadow: rgba(167, 193, 232, 0.5) 0 15px 30px -5px;
    color: #3a3a3a; /* Darker text color */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    font-weight: 500; /* Slightly bolder */
    padding: 3px;
    margin: 0 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    white-space: nowrap;
    z-index: 10;
    min-width: 180px;
}

.btn-import span, .btn-export span {
    background-color: #a7c1e8; /* Darker shade */
    padding: 15px 30px;
    border-radius: 30px;
    width: 100%;
    height: 100%;
    transition: 300ms;
}

.btn-import:hover span, .btn-export:hover span {
    background: none;
}

.btn-import:hover, .btn-export:hover {
    background-image: linear-gradient(135deg, #7fb0e3 0%, #5d92ca 100%); /* Darker hover gradient */
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(95, 151, 214, 0.4); /* Darker shadow */
    color: #ffffff; /* White text on hover */
}

.family-tree-content .service-categories {
    margin-bottom: 30px;
}

.family-tree-container {
    position: relative;
    overflow-x: auto;
    padding: 40px 20px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
}

.tree-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content; /* Allow table to expand */
    min-width: 100%;
}

.tree-table th {
    background: #e9ecef;
    color: #495057;
    padding: 12px 20px;
    font-weight: 600;
    text-align: center;
    border: none;
}

.tree-table td {
    padding: 10px;
    vertical-align: middle;
    text-align: center;
    border: none;
}

.empty-cell {
    min-width: 150px;
    height: 60px;
}

.person-cell {
    min-width: 180px;
}

.node {
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    color: #333;
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid #d1d1d1;
    box-shadow: 4px 4px 8px #bebebe, -4px -4px 8px #ffffff;
    font-size: 1rem;
    font-weight: 600;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative; /* For tooltip positioning */
}

.node:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 12px #bebebe, -6px -6px 12px #ffffff;
}

.node.male {
    background: linear-gradient(145deg, #e0f7fa, #b2ebf2);
    border-color: #80deea;
}

.node.female {
    background: linear-gradient(145deg, #fce4ec, #f8bbd0);
    border-color: #f48fb1;
}

.node.male:hover {
    background: linear-gradient(145deg, #b2ebf2, #80deea);
}

.node.female:hover {
    background: linear-gradient(145deg, #f8bbd0, #f48fb1);
}

/* Tooltip for DOB */
.node .tooltip {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%; /* Position the tooltip above the node */
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.node:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.connection-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow clicks to pass through */
    z-index: 1; /* Bring to front */
}

.connection-path {
    fill: none;
    stroke: #555; /* Darker color for visibility */
    stroke-width: 2.5px; /* Slightly thicker */
    stroke-linecap: round;
}

/* Family Tree Upload Modal */
.family-tree-upload-modal {
    max-width: 800px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.upload-instructions {
    background: rgba(52, 152, 219, 0.05);
    border: 1px solid rgba(52, 152, 219, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.upload-instructions h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.upload-instructions p {
    color: #7f8c8d;
    margin-bottom: 15px;
    line-height: 1.6;
}

.upload-instructions ul {
    color: #555;
    margin-bottom: 15px;
    padding-left: 20px;
}

.upload-instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.upload-instructions .tip {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.2);
    border-radius: 8px;
    padding: 12px;
    color: #27ae60;
    font-weight: 500;
    margin: 0;
}

/* Data Preview */
.data-preview {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(52, 152, 219, 0.2);
    border-radius: 8px;
    padding: 15px;
    background: rgba(248, 249, 250, 0.8);
    margin-bottom: 20px;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.preview-table th,
.preview-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(52, 152, 219, 0.1);
}

.preview-table th {
    background: #9b59b6;
    color: white;
    font-weight: 600;
    text-align: center;
}

.preview-table td {
    color: #555;
}

/* Empty State for Family Tree */
.family-tree-empty {
    text-align: center;
    padding: 80px 40px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.family-tree-empty .empty-icon {
    font-size: 5rem;
    margin-bottom: 25px;
    opacity: 0.7;
}

.family-tree-empty h3 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.family-tree-empty p {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Sample Family Tree */
.sample-tree-info {
    background: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.sample-tree-info h4 {
    color: #27ae60;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.sample-tree-info p {
    color: #2c3e50;
    margin: 0;
    font-size: 0.9rem;
}

/* ========================================
   ALL EXISTING STYLES FROM V0.12 CONTINUE HERE
   ======================================== */

/* Home Page Content */
.home-content {
    position: relative;
    z-index: 5;
    padding: 60px 50px;
    max-width: 1200px;
    margin: 0 auto;
}

.welcome-section {
    text-align: center;
    margin-bottom: 60px;
}

.welcome-section h1 {
    font-size: 3rem;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 700;
}

.welcome-section p {
    font-size: 1.2rem;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

/* Family Content Sections */
.family-content {
    display: grid;
    gap: 50px;
    max-width: 1000px;
    margin: 0 auto;
}

.family-intro {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.family-intro h2 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
}

.family-intro p {
    font-size: 1.1rem;
    color: #7f8c8d;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

.family-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.highlight-item {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.highlight-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.highlight-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.highlight-item h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.highlight-item p {
    color: #7f8c8d;
    line-height: 1.6;
}

.family-quote {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.family-quote blockquote {
    font-size: 1.3rem;
    color: #2c3e50;
    font-style: italic;
    line-height: 1.6;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.family-quote blockquote::before {
    content: '"';
    font-size: 4rem;
    color: #3498db;
    position: absolute;
    top: -20px;
    left: -30px;
    font-family: serif;
}

.family-quote blockquote::after {
    content: '"';
    font-size: 4rem;
    color: #3498db;
    position: absolute;
    bottom: -40px;
    right: -30px;
    font-family: serif;
}

/* Recommendations Page */
.recommendations-content {
    position: relative;
    z-index: 5;
    padding: 40px 50px 60px;
    max-width: 1400px;
    margin: 0 auto;
}

.recommendations-header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.recommendations-header h1 {
    font-size: 3rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 700;
}

.recommendations-header p {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 25px;
    line-height: 1.6;
}

.btn-add-recommendation {
    background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-add-recommendation:hover {
    background: linear-gradient(135deg, #219a52 0%, #1e8449 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

.recommendations-categories {
    margin-bottom: 40px;
}

.category-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(52, 152, 219, 0.1);
    color: #2c3e50;
    border: 2px solid transparent;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.filter-btn:hover,
.filter-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.recommendation-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.recommendation-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.recommendation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.card-title {
    flex: 1;
}

.card-title h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 5px;
    font-weight: 600;
}

.card-category {
    font-size: 0.9rem;
    color: #3498db;
    font-weight: 500;
}

.card-rating {
    font-size: 1.1rem;
    margin-left: 15px;
}

.card-content {
    margin-bottom: 15px;
}

.card-location {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-location::before {
    content: '📍';
    font-size: 1rem;
}

.card-description {
    color: #555;
    line-height: 1.5;
    font-size: 0.95rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(52, 152, 219, 0.1);
}

.card-price {
    color: #27ae60;
    font-weight: 600;
    font-size: 1rem;
}

.card-contact {
    color: #7f8c8d;
    font-size: 0.85rem;
}

.card-meta {
    font-size: 0.8rem;
    color: #bdc3c7;
    text-align: right;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-state p {
    color: #7f8c8d;
    margin-bottom: 25px;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

/* Recommendation Modal Styles */
.recommendation-modal {
    max-width: 700px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.recommendation-form {
    padding: 20px 30px 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

/* About Page Styles (From V0.12) */
.about-content {
    position: relative;
    z-index: 5;
    padding: 40px 50px 60px;
    max-width: 1400px;
    margin: 0 auto;
}

.about-header {
    text-align: center;
    margin-bottom: 50px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.about-header h1 {
    font-size: 3rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 700;
}

.about-header p {
    font-size: 1.2rem;
    color: #7f8c8d;
    line-height: 1.6;
}

/* Service Pages Styles */
.service-content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    min-height: calc(100vh - 140px);
    position: relative;
    z-index: 2;
}

.service-header {
    text-align: center;
    margin-bottom: 3rem;
}

.service-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.service-header p {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.service-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.service-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.service-rating {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.service-location,
.service-contact,
.service-price,
.service-added-by {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.service-description {
    margin: 1rem 0;
    line-height: 1.6;
    color: #34495e;
}

/* About Us Page Styles from V0.12 */
.family-story-section {
    margin-bottom: 50px;
}

.story-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    position: relative;
}

.story-content h2 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 25px;
    font-weight: 600;
}

.story-text {
    margin-bottom: 25px;
}

.story-text p {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
}

.btn-edit {
    align-items: center;
    background-color: #ccdefc;
    border: 0;
    border-radius: 15px;
    box-shadow: rgb(204,222,252) 0 15px 30px -5px;
    box-sizing: border-box;
    color: #777879;
    display: flex;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    justify-content: center;
    line-height: 1em;
    max-width: 100%;
    min-width: 140px;
    padding: 3px;
    text-decoration: none;
    font-weight: 600;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    white-space: nowrap;
    cursor: pointer;
    position: absolute;
    top: 40px;
    right: 40px;
}

.btn-edit:active,
.btn-edit:hover {
    outline: 0;
}

.btn-edit span {
    background-color: #ccdefc;
    padding: 15px 30px;
    border-radius: 30px;
    width: 100%;
    height: 100%;
    transition: 300ms;
}

.btn-edit:hover span {
    background: none;
}

.btn-edit:hover {
    background-image: linear-gradient(135deg, #8ac5e741 0%, #b9dee069 100%);
}

.btn-upload {
    align-items: center;
    background-color: #ccdefc;
    border: 0;
    border-radius: 15px;
    box-shadow: rgb(204,222,252) 0 15px 30px -5px;
    box-sizing: border-box;
    color: #777879;
    display: flex;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    justify-content: center;
    line-height: 1em;
    max-width: 100%;
    min-width: 140px;
    padding: 3px;
    text-decoration: none;
    font-weight: 600;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    white-space: nowrap;
    cursor: pointer;
}

.btn-upload:active,
.btn-upload:hover {
    outline: 0;
}

.btn-upload span {
    background-color: #ccdefc;
    padding: 15px 30px;
    border-radius: 30px;
    width: 100%;
    height: 100%;
    transition: 300ms;
}

.btn-upload:hover span {
    background: none;
}

.btn-upload:hover {
    background-image: linear-gradient(135deg, #8ac5e741 0%, #b9dee069 100%);
}

/* Family Gallery Section */
.family-gallery-section {
    margin-bottom: 50px;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.gallery-header h2 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 5px;
    font-weight: 600;
}

.gallery-header p {
    font-size: 1.1rem;
    color: #7f8c8d;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.gallery-item.uploaded-image {
    border: 2px solid #3498db;
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.15);
}

.gallery-item.uploaded-image::before {
    content: "📤";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 5px 8px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 2;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 20px;
    color: white;
}

.image-caption {
    font-size: 1rem;
    font-weight: 500;
}

/* Family Values Section */
.family-values-section {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.family-values-section h2 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 30px;
    font-weight: 600;
    text-align: center;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.value-item {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.value-item:hover {
    transform: translateY(-5px);
    border-color: #3498db;
    box-shadow: 0 15px 35px rgba(52, 152, 219, 0.15);
}

.value-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.value-item h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.value-item p {
    color: #7f8c8d;
    line-height: 1.6;
    font-size: 1rem;
}

/* Modal Styles for About Us */
.image-upload-modal {
    max-width: 600px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.upload-form {
    padding: 20px 30px 30px;
}

.upload-area {
    border: 3px dashed #bdc3c7;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #7f8c8d;
}

.upload-area h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.upload-area p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.btn-select {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-select:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
    transform: translateY(-2px);
}

.upload-preview {
    margin-top: 25px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.upload-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-cancel {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #7f8c8d;
}

.btn-upload-final {
    background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-upload-final:hover {
    background: linear-gradient(135deg, #219a52 0%, #1e8449 100%);
    transform: translateY(-2px);
}

/* Edit Story Modal */
.edit-story-modal {
    max-width: 800px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.story-form {
    padding: 30px 40px 40px;
}

.story-form .form-group {
    margin-bottom: 25px;
    position: relative;
}

.story-form label {
    position: absolute;
    left: 15px;
    top: 12px;
    color: #7f8c8d;
    font-weight: 400;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.8);
    padding: 0 5px;
}

.story-form input,
.story-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(52, 152, 219, 0.1);
    border-radius: 0;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
}

.story-form input:focus,
.story-form textarea:focus {
    outline: none;
    border-color: #3498db;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.story-form input:focus + label,
.story-form input:not(:placeholder-shown) + label,
.story-form textarea:focus + label,
.story-form textarea:not(:placeholder-shown) + label {
    top: -8px;
    left: 10px;
    font-size: 12px;
    color: #3498db;
    font-weight: 500;
}

.story-form input::placeholder,
.story-form textarea::placeholder {
    color: transparent;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.story-form textarea {
    resize: vertical;
    min-height: 180px;
}

.story-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-save {
    background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-save:hover {
    background: linear-gradient(135deg, #219a52 0%, #1e8449 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

/* Service Categories & Filtering Styles */
.service-categories {
    margin: 2rem 0;
    padding: 1rem 0;
    display: block; /* Override flex behavior */
}

.service-categories .category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.service-categories .filter-btn {
    background: rgba(52, 152, 219, 0.1);
    color: #2c3e50;
    border: 2px solid transparent;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    min-width: 90px;
    text-align: center;
}

.service-categories .filter-btn:hover,
.service-categories .filter-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1200px) {
    .hero-decoration {
        width: 50%;
    }
    
    .circle-1 {
        width: 350px;
        height: 350px;
    }
    
    .family-tree {
        gap: 40px;
    }
    
    .generation-column {
        min-width: 180px;
    }
}

@media (max-width: 968px) {
    header, .main-header {
        padding: 15px 30px;
    }
    
    .hero-section, .home-content, .recommendations-content, .family-tree-content {
        padding: 40px 30px;
    }
    
    h1 {
        font-size: 3.5rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .hero-decoration {
        display: none;
    }
    
    .circle-1, .circle-2, .circle-3 {
        display: none;
    }
    
    .category-filters {
        gap: 10px;
    }
    
    .filter-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .recommendations-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
    }
    
    .family-tree {
        gap: 30px;
    }
    
    .generation-column {
        min-width: 160px;
    }
    
    .family-member {
        min-width: 150px;
        max-width: 180px;
        padding: 15px;
    }
    
    .family-tree-header h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .modal {
        padding: 10px 0;
    }
    
    .modal-content {
        margin: 10px auto;
        width: 95%;
        max-height: calc(100vh - 20px);
    }
    
    .recommendation-modal, .family-tree-upload-modal {
        max-height: calc(100vh - 20px);
    }
    
    .modal-header {
        padding: 25px 20px 15px;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .auth-form, .recommendation-form {
        padding: 15px 20px 25px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-signup, .btn-login {
        width: 100%;
        text-align: center;
    }
    
    .home-content, .recommendations-content, .family-tree-content {
        padding: 30px 20px;
    }
    
    .welcome-section h1, .recommendations-header h1, .family-tree-header h1 {
        font-size: 2.2rem;
    }
    
    .welcome-section p, .recommendations-header p {
        font-size: 1rem;
    }
    
    .family-content {
        gap: 30px;
    }
    
    .family-intro, .recommendations-header, .family-tree-header {
        padding: 30px 25px;
    }
    
    .family-intro h2 {
        font-size: 1.8rem;
    }
    
    .family-intro p {
        font-size: 1rem;
    }
    
    .family-highlights {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .highlight-item {
        padding: 25px 20px;
    }
    
    .highlight-icon {
        font-size: 2.5rem;
    }
    
    .highlight-item h3 {
        font-size: 1.2rem;
    }
    
    .family-quote {
        padding: 30px 25px;
    }
    
    .family-quote blockquote {
        font-size: 1.1rem;
    }
    
    .family-quote blockquote::before,
    .family-quote blockquote::after {
        font-size: 3rem;
    }
    
    .family-quote blockquote::before {
        top: -15px;
        left: -20px;
    }
    
    .family-quote blockquote::after {
        bottom: -30px;
        right: -20px;
    }
    
    /* Family Tree Mobile Styles */
    .family-tree-container {
        padding: 20px;
        min-height: 400px;
    }
    
    .family-tree {
        gap: 25px;
    }
    
    .generation-column {
        min-width: 140px;
        gap: 25px;
    }
    
    .generation-header {
        padding: 8px 15px;
        font-size: 12px;
    }
    
    .family-member {
        min-width: 130px;
        max-width: 150px;
        padding: 12px;
    }
    
    .member-name {
        font-size: 1rem;
    }
    
    .member-dates {
        font-size: 0.8rem;
    }
    
    .member-location {
        font-size: 0.75rem;
    }
    
    /* About page mobile adjustments */
    .about-content {
        padding: 30px 20px;
    }
    
    .about-header {
        padding: 30px 25px;
    }
    
    .about-header h1 {
        font-size: 2.2rem;
    }
    
    .story-content {
        padding: 30px 25px;
    }
    
    .btn-edit {
        position: static;
        margin-top: 20px;
        display: block;
        width: 100%;
    }
    
    .gallery-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 25px;
    }
    
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .family-values-section {
        padding: 30px 25px;
    }
    
    /* Upload modal mobile adjustments */
    .upload-instructions {
        padding: 15px;
    }
    
    .upload-instructions h3 {
        font-size: 1.1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 12px;
    }
    
    h1 {
        font-size: 2.8rem;
    }
    
    .hero-content p {
        font-size: 14px;
    }
    
    .welcome-section h1, .recommendations-header h1, .family-tree-header h1 {
        font-size: 1.8rem;
    }
    
    .welcome-section p, .recommendations-header p {
        font-size: 0.9rem;
    }
    
    .modal-header {
        padding: 20px 15px 10px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .auth-form, .recommendation-form {
        padding: 10px 15px 20px;
    }
    
    .form-group input, .form-group select, .form-group textarea {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .btn-submit {
        padding: 15px;
        font-size: 14px;
    }
    
    .home-content, .recommendations-content, .family-tree-content {
        padding: 20px 15px;
    }
    
    .family-intro, .recommendations-header, .family-tree-header {
        padding: 25px 20px;
    }
    
    .family-intro h2 {
        font-size: 1.5rem;
    }
    
    .family-intro p {
        font-size: 0.9rem;
    }
    
    .family-highlights {
        gap: 15px;
    }
    
    .highlight-item {
        padding: 20px 15px;
    }
    
    .highlight-icon {
        font-size: 2rem;
    }
    
    .highlight-item h3 {
        font-size: 1.1rem;
    }
    
    .highlight-item p {
        font-size: 0.9rem;
    }
    
    .family-quote {
        padding: 25px 20px;
    }
    
    .family-quote blockquote {
        font-size: 1rem;
    }
    
    .family-quote blockquote::before,
    .family-quote blockquote::after {
        font-size: 2.5rem;
    }
    
    .family-quote blockquote::before {
        top: -10px;
        left: -15px;
    }
    
    .family-quote blockquote::after {
        bottom: -25px;
        right: -15px;
    }
    
    .contact-info {
        padding: 15px 20px 25px;
    }
    
    .contact-item {
        padding: 12px;
    }
    
    .category-filters {
        padding: 15px;
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .recommendation-card {
        padding: 20px;
    }
    
    .card-title h3 {
        font-size: 1.1rem;
    }
    
    .empty-state {
        padding: 40px 20px;
    }
    
    .empty-icon {
        font-size: 3rem;
    }
    
    /* Family Tree Mobile */
    .family-tree-container {
        padding: 15px;
        min-height: 350px;
    }
    
    .family-tree {
        gap: 20px;
    }
    
    .generation-column {
        min-width: 120px;
        gap: 20px;
    }
    
    .generation-header {
        padding: 6px 12px;
        font-size: 11px;
        margin-bottom: 15px;
    }
    
    .family-member {
        min-width: 110px;
        max-width: 130px;
        padding: 10px;
    }
    
    .member-name {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .member-dates {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }
    
    .member-location {
        font-size: 0.7rem;
    }
    
    .member-status {
        width: 16px;
        height: 16px;
        top: -6px;
        right: -6px;
    }
    
    /* About page mobile */
    .about-content {
        padding: 20px 15px;
    }
    
    .about-header h1 {
        font-size: 1.8rem;
    }
    
    .story-content h2,
    .gallery-header h2,
    .family-values-section h2 {
        font-size: 1.6rem;
    }
    
    .image-gallery {
        grid-template-columns: 1fr;
    }
    
    .gallery-item img {
        height: 200px;
    }
    
    .value-item {
        padding: 25px 15px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-instructions {
        padding: 12px;
    }
    
    .upload-instructions ul {
        padding-left: 15px;
    }
    
    .service-categories {
        margin: 1rem 0;
        padding: 0.8rem;
    }
    
    .service-categories .category-filters {
        gap: 0.5rem;
        justify-content: stretch;
    }
    
    .service-categories .filter-btn {
        flex: 1;
        padding: 8px 12px;
        font-size: 12px;
        min-width: auto;
    }
}

/* Enhanced Family Tree Preview Styles */
.preview-info {
    background: #e8f5e8;
    border: 1px solid #27ae60;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.preview-info h4 {
    color: #27ae60;
    margin: 0 0 8px 0;
    font-size: 16px;
}

.preview-info p {
    color: #2c3e50;
    margin: 0;
    font-size: 14px;
}

.format-explanation {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.format-explanation h5 {
    color: #856404;
    margin: 0 0 10px 0;
    font-size: 14px;
}

.format-explanation ul {
    margin: 0;
    padding-left: 20px;
    color: #856404;
}

.format-explanation li {
    margin-bottom: 5px;
    font-size: 13px;
}

.family-tree-preview h4 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.full-preview-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 20px;
}

.preview-table {
    width: 100%;
}

/* Action box for upload/export */
.action-box {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
}

/* Delete button styles for images */
.btn-delete-image {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.btn-delete-image:hover {
    background: rgba(231, 76, 60, 1);
    transform: scale(1.1);
}

/* Delete button styles for recommendations */
.btn-delete-recommendation {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 8px;
    transition: all 0.3s ease;
    display: block;
}

.btn-delete-recommendation:hover {
    background: rgba(231, 76, 60, 1);
    transform: translateY(-1px);
}

/* Delete button styles for service recommendations */
.btn-delete-service {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
}

.btn-delete-service:hover {
    background: rgba(231, 76, 60, 1);
    transform: translateY(-1px);
}

/* Gallery item positioning for delete button */
.gallery-item {
    position: relative;
}

.gallery-item.uploaded-image {
    position: relative;
}
