body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #0A0A10;
    font-family: 'DM Sans', sans-serif;
    overflow: hidden; /* Prevent scrolling */
    color: #BABAE6;
}

#app {
    position: relative;
    width: 100%;
    max-width: 480px; /* Mobile width */
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto; /* Center horizontally */
    background-color: #0A0A10; /* Match background */
    overflow: hidden; /* Clip content */
}

#logo-container {
    position: absolute;
    transition: all 1s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

#logo-container.center {
    top: 50%;
    transform: translateY(-50%);
    height: auto;
}

#logo-container.top {
    top: 45%; /* Stay near center, slightly up to avoid buttons */
    transform: translateY(-50%);
}

#logo {
    width: 150px; /* Adjust size */
    height: auto;
    transition: width 1s ease-in-out;
    overflow: visible;
}

#logo-container.top #logo {
    width: 180px; /* Slightly bigger */
    animation: breathing 3s ease-in-out infinite;
    animation-delay: 1s; /* Wait for initial transition */
}

#login-buttons {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none; /* Prevent clicks when hidden */
}

#login-buttons.visible {
    opacity: 1;
    pointer-events: auto;
}

.login-btn {
    padding: 15px;
    border: none;
    border-radius: 50px;
    font-size: clamp(10px, 3.5vw, 14px);
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #BABAE6;
}

.login-btn.google {
    background-color: #1C1C26;
}

.login-btn.amazon {
    background-color: #1C1C26;
}

.login-btn.guest {
    background-color: transparent;
    border: 1px solid #BABAE6;
    color: #BABAE6;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.amazon-logo {
    height: 20px;
    width: auto;
}

.hidden {
    display: none !important;
}

/* SVG Animation Styles */
#logo-text {
    transform-origin: bottom left;
    transform-box: fill-box;
    animation: expandText 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#logo-arrow {
    transform-origin: center;
    transform-box: fill-box;
    animation: shrinkArrow 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes breathing {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Main App Styles */
#main-app {
    width: 100%;
    height: 100%;
    position: relative; /* Establish positioning context */
    display: flex;
    flex-direction: column;
    background-color: #0A0A10;
    color: #BABAE6;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}

#main-app.hidden {
    display: none !important;
}

#main-app.visible {
    opacity: 1;
    pointer-events: auto;
}

.content-area {
    flex: 1;
    padding: 0; /* Removed padding to allow full-width sections */
    padding-bottom: 100px; /* Space for floating nav */
    display: flex;
    flex-direction: column;
    gap: 0; /* Manage gaps in sections */
    overflow-y: auto;
    overflow-x: hidden;
}

.user-info-section {
    background-color: #BABAE6;
    border-radius: 0 0 32px 32px;
    padding: 60px 24px 32px 24px;
    position: relative;
    z-index: 10;
    color: #0A0A10;
    margin-bottom: -32px; /* Overlap content to remove black corners */
}

.user-info-section.hidden {
    display: none !important;
}

.user-name-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: fit-content;
    margin-bottom: 20px;
    background-color: #0A0A10;
    padding: 8px 16px;
    border-radius: 100px;
}

.user-name {
    font-size: clamp(12px, 4vw, 14px);
    font-weight: 700;
    color: #BABAE6;
    margin-bottom: 0; 
}

.user-select-arrow {
    transition: transform 0.2s;
    color: #BABAE6;
}

.user-name-container:active .user-select-arrow {
    transform: translateY(2px);
}

.user-details {
    font-size: clamp(13px, 4.2vw, 15px);
    color: rgba(10, 10, 16, 0.8);
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-weight: 500;
}

.tracking-section-wrapper {
    background-color: transparent;
    border-radius: 32px;
    padding: 20px 12px 32px 12px;
    margin: 0 3px 20px 3px;
    display: flex;
    flex-direction: column;
    padding-top: 52px; /* Add padding to prevent content from being hidden by header overlap (20px original + 32px overlap) */
}

.page-title {
    font-size: 12px;
    font-weight: 700;
    margin-top: 5px;
    margin-bottom: 20px;
}

.input-container {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.carrier-icon-container {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #BABAE6;
    width: 24px;
    height: 24px;
    pointer-events: none;
    transition: all 0.3s ease;
}

.tracking-input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    padding-right: 90px;
    border-radius: 50px;
    border: 1px solid #BABAE6;
    background-color: transparent;
    color: #BABAE6;
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(14px, 4.5vw, 16px);
    line-height: 1.5; /* Ensure text consistency */
    box-sizing: border-box;
    outline: none;
}

.tracking-input::placeholder {
    color: #666666;
}

.add-tracking-btn {
    position: absolute;
    right: 6px;
    top: 6px;
    bottom: 6px;
    background-color: transparent;
    border: 1px solid #BABAE6;
    color: #BABAE6;
    border-radius: 50px;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex; /* Ensure center alignment */
    align-items: center;
    justify-content: center;
}

.add-tracking-btn:hover,
.add-tracking-btn.filled {
    background-color: #BABAE6;
    color: #0A0A10;
}

.tracking-input::placeholder {
    color: rgba(186, 186, 230, 0.8); /* Increased visibility */
}

.tracking-input:focus {
    border-color: #fff;
}

.user-info-section {
    position: relative; /* For absolute dropdown positioning if needed, though we might put it in flow */
}

.user-dropdown {
    position: absolute;
    top: calc(100% - 20px); /* Overlap slightly or position correctly */
    left: 24px; /* Align with padding */
    right: 24px;
    width: auto;
    background-color: #1C1C26;
    border-radius: 15px;
    padding: 5px;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    margin-top: 10px;
    max-height: 45vh;
    overflow-y: auto;
    border: 1px solid rgba(186, 186, 230, 0.1);
    color: #BABAE6; /* Restoring light text for dropdown */
}

.user-dropdown.hidden {
    display: none;
}

.dropdown-item {
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: rgba(186, 186, 230, 0.1);
}

.dropdown-item .user-name {
    font-size: clamp(12px, 4vw, 14px);
    margin-bottom: 2px;
    color: #BABAE6; /* Ensure name is light */
}  
/* User details inside dropdown needs color spec if it relies on inheritance */
.dropdown-item .user-details {
    color: rgba(186, 186, 230, 0.7); /* Light secondary text */
}

.recent-section {
    background-color: #14141C;
    border-radius: 32px;
    padding: 16px 12px;
    margin: 0 3px 20px 3px;
}

.recent-section h2 {
    font-size: 12px;
    font-weight: 700;
    margin-top: 5px; /* Match page-title margin */
    margin-bottom: 15px;
    opacity: 0.8;
}

.delivery-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.delivery-item {
    padding: 15px;
    background-color: #1C1C26;
    border-radius: 15px;
    font-size: clamp(12px, 4vw, 14px);
}

.delivery-item.placeholder {
    text-align: center;
    color: rgba(186, 186, 230, 0.5);
    background-color: transparent;
    border: 1px dashed rgba(186, 186, 230, 0.3);
}

/* Bottom Navigation */
.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background-color: #1C1C26;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-radius: 24px 24px 0 0;
    padding-bottom: 0px; 
    z-index: 50; /* Ensure on top */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4); /* Slight shadow for depth */
    
    /* Initial Animation State */
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bottom-nav.visible {
    transform: translateY(0);
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: rgba(186, 186, 230, 0.5);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(10px, 3vw, 12px);
    padding: 10px;
    transition: color 0.2s;
}

.nav-item.active {
    color: #BABAE6;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

@keyframes expandText {
    0% {
        transform: scale(0.01) translate(-100%, 100%);
        opacity: 0;
    }
    100% {
        transform: scale(1) translate(0, 0);
        opacity: 1;
    }
}

@keyframes shrinkArrow {
    0% {
        transform: scale(3);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

