/* Global Navigation Bar - 앱 스타일 하단 고정 네비게이션 */

.has-global-nav,
body {
    padding-bottom: 70px !important;
}

.global-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 70px;
    background-color: #FFF5F7;
    background-image:
        radial-gradient(ellipse at 15% 15%, rgba(255, 155, 176, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 85%, rgba(236, 72, 153, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 60%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 155, 176, 0.6);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4), 0 -1px 0 rgba(255, 155, 176, 0.6);
    z-index: 10000;
    pointer-events: auto;
    overflow: hidden;
}

/* 하단 네비게이션 우주 별빛 효과 */
.global-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(1px 1px at 20% 30%, white, transparent),
        radial-gradient(1px 1px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 20%, white, transparent),
        radial-gradient(1px 1px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent),
        radial-gradient(1px 1px at 15% 40%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%, 40% 40%, 50% 50%, 80% 20%, 90% 60%, 33% 80%, 15% 40%;
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.global-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 8px;
    position: relative;
    z-index: 1;
}

.global-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 6px;
    color: #2D2D2D;
    text-decoration: none;
    font-size: 11px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    flex: 1;
    max-width: 90px;
    position: relative;
}

.global-nav-item:hover {
    color: #FF9BB0;
    background-color: rgba(255, 155, 176, 0.6);
    transform: translateY(-3px);
}

.global-nav-item.active {
    color: #FF9BB0;
    background-color: rgba(255, 155, 176, 0.6);
}

.global-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #FF9BB0, transparent);
    border-radius: 2px;
}

.global-nav-icon {
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.global-nav-item.active .global-nav-icon {
    filter: drop-shadow(0 0 8px rgba(255, 155, 176, 0.6));
}

.global-nav-label {
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: -0.2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* 반응형 디자인 */

/* 모바일 (작은 화면) */
@media (max-width: 480px) {
    .has-global-nav,
    body {
        padding-bottom: 65px !important;
    }

    .global-nav {
        height: 65px;
    }

    .global-nav-item {
        gap: 3px;
        padding: 6px 4px;
        max-width: 70px;
    }

    .global-nav-icon {
        font-size: 20px;
    }

    .global-nav-label {
        font-size: 9px;
    }
}

/* 태블릿 */
@media (min-width: 768px) {
    .global-nav {
        height: 75px;
    }

    .global-nav-item {
        gap: 6px;
        padding: 10px 8px;
        max-width: 100px;
    }

    .global-nav-icon {
        font-size: 26px;
    }

    .global-nav-label {
        font-size: 11px;
    }
}

/* 데스크톱 */
@media (min-width: 1024px) {
    .global-nav-container {
        max-width: 900px;
        padding: 0 20px;
    }

    .global-nav-item {
        max-width: 110px;
        gap: 8px;
    }

    .global-nav-icon {
        font-size: 28px;
    }

    .global-nav-label {
        font-size: 12px;
    }
}

/* 안전 영역 지원 (노치가 있는 기기) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .has-global-nav,
    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom)) !important;
    }

    .global-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(70px + env(safe-area-inset-bottom));
    }

    @media (max-width: 480px) {
        .has-global-nav,
        body {
            padding-bottom: calc(65px + env(safe-area-inset-bottom)) !important;
        }

        .global-nav {
            height: calc(65px + env(safe-area-inset-bottom));
        }
    }
}

/* Top Info Bar */
.global-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px; /* Fallback */
    height: calc(50px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.top-bar-content {
    width: 100%;
    max-width: 600px;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #333;
    height: 50px; /* Content height remains constant */
}

.top-bar-content.right-align {
    justify-content: flex-end;
    gap: 10px;
}

.user-info {
    font-weight: 600;
    color: #1a202c;
}

.stats-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.stats-info .points {
    color: #667eea;
    font-weight: 700;
}

.stats-info .divider {
    color: #e2e8f0;
}

.stats-info .daily-usage {
    color: #ed8936;
    font-weight: 600;
}

.top-btn {
    padding: 6px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    background: #f7fafc;
    color: #4a5568;
}

.top-btn:hover {
    background: #edf2f7;
}

.top-btn.highlight {
    background: #667eea;
    color: white;
}

.top-btn.highlight:hover {
    background: #5a6fd6;
}

/* Adjust body padding for top bar */
body.has-global-nav {
    padding-top: 50px !important; /* Fallback */
    padding-top: calc(50px + env(safe-area-inset-top)) !important;
}
