/* ============================================
   iOS Tab Bar Navigation
   ============================================ */

/* Hide top navbar on mobile ONLY when tab bar is present (authenticated users) */
@media (max-width: 768px) {
    body.has-tab-bar .navbar.navbar-light {
        display: none;
    }
}

/* iOS Bottom Tab Bar */
.ios-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.ios-tab-bar-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 430px;
    margin: 0 auto;
    padding: 0 8px;
}

.ios-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 8px;
    text-decoration: none;
    color: var(--ios-text-tertiary);
    transition: all 0.2s ease;
    position: relative;
}

.ios-tab-item i {
    font-size: 24px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

.ios-tab-item span {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: -0.1px;
}

.ios-tab-item.active {
    color: var(--ios-blue);
}

.ios-tab-item.active i {
    transform: scale(1.05);
}

.ios-tab-item:active {
    opacity: 0.6;
    transform: scale(0.95);
}

/* Add space at bottom of content for tab bar */
body {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.glass-container {
    padding-bottom: 80px; /* Space for tab bar on mobile */
}

/* Desktop: Keep top navbar */
@media (min-width: 769px) {
    .ios-tab-bar {
        display: none;
    }

    .glass-container {
        padding-bottom: 0;
    }
}

/* Large Screen Header - More iOS-like */
@media (min-width: 769px) {
    .navbar {
        padding: 16px 24px;
    }

    .navbar-brand {
        font-size: 22px;
        font-weight: 700;
        letter-spacing: -0.5px;
    }

    .navbar-nav {
        gap: 4px;
    }

    .nav-link {
        font-size: 17px;
        font-weight: 500;
        padding: 8px 16px !important;
        border-radius: var(--radius-sm);
        transition: all 0.2s ease;
    }

    .nav-link:hover {
        background: rgba(0, 122, 255, 0.1);
        color: var(--ios-blue) !important;
        transform: translateY(-1px);
    }

    .nav-link.active {
        background: rgba(0, 122, 255, 0.15);
        color: var(--ios-blue) !important;
        font-weight: 600;
    }
}

/* Profile Button in Tab Bar */
.ios-tab-item.profile-item {
    position: relative;
}

.ios-tab-item.profile-item::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--ios-blue), var(--ios-purple));
    border-radius: 50%;
    opacity: 0.15;
}

.ios-tab-item.profile-item.active::before {
    opacity: 0.25;
}

/* Safe Area for iPhone X+ */
@supports (padding: max(0px)) {
    .ios-tab-bar {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* Badge for notifications */
.ios-tab-badge {
    position: absolute;
    top: 0;
    right: 20%;
    background: var(--ios-red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(255, 59, 48, 0.3);
}

/* Smooth page transitions */
.page-content {
    animation: fadeInUp 0.3s ease;
}

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

/* iOS Pull-to-refresh indicator style */
.ios-refresh-indicator {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--ios-text-tertiary);
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.2s;
}

.ios-refresh-indicator.visible {
    opacity: 1;
}

/* Hamburger menu for desktop collapsed state */
.navbar-toggler {
    border: none;
    padding: 8px;
    border-radius: var(--radius-xs);
}

.navbar-toggler:focus {
    box-shadow: none;
    background: rgba(0, 0, 0, 0.05);
}

.navbar-toggler-icon {
    width: 24px;
    height: 24px;
}

/* Collapsible menu styling */
.navbar-collapse {
    margin-top: 16px;
}

@media (max-width: 768px) {
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        border-radius: var(--radius-md);
        padding: 16px;
        margin-top: 16px;
        box-shadow: var(--shadow-md);
    }

    .navbar-nav {
        gap: 8px;
    }

    .nav-link {
        padding: 12px 16px !important;
        border-radius: var(--radius-sm);
    }

    .d-flex.align-items-center {

    }

    h6 {
        margin-bottom: 12px;
    }



    .d-flex.align-items-center .btn {
        width: 100%;
        margin: 4px 0 !important;
    }
}

/* Large title style (iOS 11+) */
.ios-large-title {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    padding-top: 8px;
}

@media (max-width: 768px) {
    .ios-large-title {
        font-size: 28px;
    }
}

/* Toolbar style for page actions */
.ios-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ios-toolbar .btn {
    border-radius: var(--radius-sm);
    font-size: 15px;
    padding: 8px 16px;
}
