html {
    font-size: 100%; /* Sets 1rem based on browser defaults */
}

/* Typography tweaks */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.015rem;
    line-height: 1.6;
}

/* Responsive Fluid Scaled Typography (Mobile to Desktop 1280dp+) */
.fluid-h1 {
    font-size: clamp(1.5rem, 3.5vw, 2.75rem);
    line-height: 1.25;
}

.fluid-h2 {
    font-size: clamp(1.25rem, 3vw, 2rem);
    line-height: 1.3;
}

.fluid-h3 {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    line-height: 1.4;
}

.fluid-button {
    font-size: clamp(0.875rem, 1.5vw, 1.125rem);
}

h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.025em;
    line-height: 1.3;
}

/* Soft Premium Shadows & Components */
.glass-card, .bg-white.rounded-xl, .bg-white.rounded-2xl {
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04), 0 2px 6px -1px rgba(0, 0, 0, 0.02) !important;
    border: 1px solid rgba(226, 232, 240, 0.6) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    box-shadow: 0 10px 30px -4px rgba(0, 0, 0, 0.06), 0 4px 10px -2px rgba(0, 0, 0, 0.03) !important;
    transform: translateY(-2px);
}

/* Micro-interactions: Page Transitions */
body {
    animation: fadeInPage 0.4s ease-in-out;
}

@keyframes fadeInPage {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal Transitions */
.modal-overlay {
    animation: fadeInOverlay 0.3s ease-out;
}
.modal-content {
    animation: scaleInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes scaleInModal {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Skeleton Loading Animation */
.skeleton-box {
    display: inline-block;
    position: relative;
    overflow: hidden;
    background-color: #f1f5f9; /* slate-100 */
    border-radius: 0.5rem;
}

.skeleton-box::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.6) 20%,
        rgba(255, 255, 255, 0.8) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 1.5s infinite;
    content: "";
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}


/* ===== NAVBAR AVATAR ===== */
.nav-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e0e7ff;
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(135deg, #c7d2fe, #a5b4fc);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    font-weight: 700;
    font-size: 0.875rem;
    overflow: hidden;
    flex-shrink: 0;
}

.nav-avatar:hover {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    transform: scale(1.05);
}

.nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.nav-avatar-wrapper {
    position: relative;
}

.nav-avatar-wrapper .avatar-edit-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 1rem;
    height: 1rem;
    background: #6366f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.5rem;
    border: 2px solid white;
    cursor: pointer;
    transition: transform 0.2s;
}

.nav-avatar-wrapper:hover .avatar-edit-badge {
    transform: scale(1.15);
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 20px -4px rgba(0, 0, 0, 0.08);
    padding: 0.375rem 0;
}

.bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 32rem;
    margin: 0 auto;
    padding: 0 0.25rem;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #94a3b8;
    text-decoration: none;
    position: relative;
    min-width: 3.5rem;
}

.bottom-nav-item:hover {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.06);
}

.bottom-nav-item.active {
    color: #6366f1;
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: -0.375rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1.5rem;
    height: 0.1875rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 0 0 999px 999px;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    transition: transform 0.2s;
}

.bottom-nav-item:hover i {
    transform: translateY(-1px);
}

.bottom-nav-item span {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .bottom-nav-item {
        min-width: 4.5rem;
        padding: 0.375rem 0.75rem;
    }
    .bottom-nav-item span {
        font-size: 0.6875rem;
    }
}

/* ===== ADDITIONAL RESPONSIVE NAV UTILS ===== */
@media (max-width: 640px) {
    .nav-brand-text {
        font-size: 1rem !important;
    }
    .nav-icon-only span {
        display: none !important;
    }
    .nav-gap-sm {
        gap: 0.5rem !important;
    }
}

/* ===== TOP NAVIGATION TABS (Per-Page Features) ===== */
.top-nav-tabs {
    position: sticky;
    top: 64px; /* Height of navbar */
    z-index: 40;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    display: none; /* Hidden by default, show on mobile/tablet */
}

@media (max-width: 1024px) {
    .top-nav-tabs {
        display: block;
    }
}

.top-tabs-inner {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
}

.top-tabs-inner::-webkit-scrollbar {
    display: none;
}

.top-tab-item {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    transition: all 0.2s;
    white-space: nowrap;
}

.top-tab-item i {
    font-size: 1rem;
}

.top-tab-item.active {
    background: #6366f1;
    color: white;
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.3);
}

@media (max-width: 480px) {
    .top-tab-item span {
        display: none;
    }
    .top-tab-item {
        padding: 0.5rem;
    }
    .top-tab-item i {
        font-size: 1.25rem;
    }
}

/* Ensure bottom nav is visible on tablets as well as per user request */
@media (max-width: 1024px) {
    .bottom-nav {
        display: block;
    }
}

/* Fix for overlapping content with fixed navbars */
.content-with-navs {
    padding-bottom: 5rem;
}

@supports (padding: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .content-with-navs {
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
    }
}
