/* Global Loader */
#app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 5px solid var(--border-color);
    border-bottom-color: var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* Fallback */
    height: 100dvh;
}

/* Header */
header h1 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    /* Extra bold for brand */
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.header-branding {
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    flex: 1;
}

header {
    background-color: var(--surface-color);
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    z-index: 1000 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.brand-aquino {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #d97706;
    /* Amber-600 - Professional Gold */
    text-shadow: none;
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-right: 2px;
}

.brand-geneaview {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: -0.02em;
}

.header-logo {
    height: 32px;
    /* Matches h1 size roughly + padding */
    width: auto;
    margin-right: 0.75rem;
    object-fit: contain;
}

/* Main Area */
main {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Section Containers */
#upload-section {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    background-color: var(--bg-color);
    background-image: url('../background_login.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
}

#upload-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
}

#tree-section {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
    cursor: grab;
}

#tree-section:active {
    cursor: grabbing;
}

#tree-container {
    width: 100%;
    height: 100%;
}

#profile-section {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: var(--bg-color);
}

.profile-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    min-height: 100%;
    box-shadow: var(--shadow-lg);
}

.profile-header {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1745be 100%);
    height: 220px;
    margin-bottom: 110px;
}

.profile-cover {
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

/* Mobile Layout Optimization */
@media (max-width: 768px) {
    header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-branding {
        display: flex;
        align-items: center;
        width: 100%;
    }




    .profile-header {
        height: 140px;
        margin-bottom: 150px;
    }
}

/* Footer */
/* Footer */
#site-footer {
    width: 100%;
    min-height: 30px;
    /* Changed from fixed height */
    height: auto;
    background-color: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    /* Increased vertical padding */
    box-sizing: border-box;
    font-size: 0.75rem;
    color: #cbd5e1;
    border-top: 1px solid #334155;
    flex-shrink: 0;
    z-index: 2000;
}

#site-footer .footer-text {
    margin-right: 0.5rem;
    text-align: right;
}

#site-footer .footer-text-left {
    color: #94a3b8;
    font-weight: 500;
    text-align: left;
}


#site-footer a.gold-text {
    color: #FFD700;
    text-decoration: none;
    font-weight: bold;
    transition: opacity 0.2s;
}

#site-footer a.gold-text:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Mobile Footer Optimization */
@media (max-width: 480px) {
    #site-footer {
        flex-direction: column;
        gap: 4px;
        padding: 0.75rem;
        text-align: center;
    }

    #site-footer .footer-text,
    #site-footer .footer-text-left {
        width: 100%;
        text-align: center;
        margin: 0;
    }
}