/**
 * TFP Top Bar Styles
 * MD3 + Web3 Aesthetic - Glassmorphic, Sticky Top Bar
 */

/* ============================================
   Top Bar - Main Container
   ============================================ */
#tfp-topbar {
    position: fixed;
    top: 8px;
    /* Reduced gap */
    /* Floating from top */
    left: 8px;
    /* Reduced gap */
    /* Floating from side */
    right: 8px;
    /* Reduced gap */
    /* Floating from side */
    height: var(--tfp-topbar-height, 56px);
    z-index: 1000;
    border-radius: 16px;
    /* Reduced radius */

    /* Glassmorphism Effect */
    background: rgba(255, 255, 255, 0.4);
    /* User set value */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    /* Thin Glass Border */
    border: 1px solid #ddd;

    /* Removed box-shadow per request */
    box-shadow: none;

    /* Layout */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

/* ============================================
   Left Section - Icon & Breadcrumb
   ============================================ */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-left .site-logo-link {
    display: flex;
    align-items: center;
    border-radius: 6px;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.topbar-left .site-logo-link:hover {
    transform: scale(1.05);
}

.topbar-left .site-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    display: block;
}

.topbar-left .site-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* Breadcrumb Styling */
.topbar-left .tfp-breadcrumb,
.topbar-left .tfp-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 4px;

    /* MD3 Label Large Typography */
    font-size: 0.875rem;
    /* 14px */
    line-height: 20px;
    font-weight: 500;
    letter-spacing: 0.1px;

    color: var(--md-sys-color-on-surface-variant, #43474e);
}

.topbar-left .tfp-breadcrumb a,
.topbar-left .tfp-breadcrumbs a {
    color: var(--md-sys-color-on-surface-variant, #43474e);
    text-decoration: none;
    transition: color 0.2s ease;
    border-radius: 8px;
    /* Small touch target rounding if focused */
}

.topbar-left .tfp-breadcrumb a:hover,
.topbar-left .tfp-breadcrumbs a:hover {
    color: var(--md-sys-color-primary, #3b74e0);
}

/* New md-icon separator styling */
.topbar-left .breadcrumb-sep {
    color: var(--md-sys-color-outline, #74777f);
    font-size: 18px;
    /* Small icon size */
    width: 18px;
    height: 18px;
    --md-icon-size: 18px;
}

.topbar-left .tfp-breadcrumb .current,
.topbar-left .tfp-breadcrumbs .current {
    color: var(--md-sys-color-on-surface, #1a1c1e);
    font-weight: 600;
}

/* ============================================
   Right Section - User Actions
   ============================================ */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Material Web Component Theme Overrides */
:root {
    --md-sys-color-primary: #0D2A57;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-secondary-container: #e3e6f0;
    --md-sys-color-on-secondary-container: #1b1e26;
    --md-sys-color-outline: #74777f;
}

/* Force md-icon to use the loaded Material Symbols Rounded font */
md-icon {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}

md-text-button,
md-filled-button,
md-filled-tonal-button {
    --md-sys-typeface-label-large: 'Inter', sans-serif;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    #tfp-topbar {
        padding: 0 12px;
        height: 56px;
        gap: 8px;
    }

    /* Left Section Mobile */
    .topbar-left {
        gap: 8px;
        flex: 1;
    }

    .topbar-left .site-icon {
        width: 24px;
        height: 24px;
    }

    /* Hide Desktop Elements */
    .desktop-only,
    .desktop-only-flex,
    .tfp-breadcrumb,
    .tfp-breadcrumbs {
        display: none !important;
    }

    /* Show Mobile Elements */
    .mobile-only {
        display: inline-flex !important;
    }

    /* Right Section Mobile */
    .topbar-right {
        gap: 4px;
    }

    /* Adjust icon buttons for mobile touch targets */
    md-icon-button {
        width: 40px;
        height: 40px;
        --md-icon-button-icon-size: 24px;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

/* ============================================
   Mobile Menu Drawer
   ============================================ */
.mobile-menu-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.mobile-menu-drawer.open {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-logo {
    height: 32px;
}

.mobile-menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.mobile-nav .tfp-nav-list {
    background: transparent;
}

.mobile-promo {
    margin-top: auto;
    background: #fdfcff;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
}

.mobile-promo h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
}

.mobile-promo p {
    margin: 0 0 16px 0;
    font-size: 0.9rem;
    color: var(--md-sys-color-on-surface-variant);
}

.mobile-menu-drawer .promo-card + .promo-card {
    margin-top: 12px;
}