/* common.css - Core Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --primary-blue: #1E88E5;
    --primary-green: #28A745;
    --bg-white: #FFFFFF;
    --text-dark: #212529;
    --text-muted: #6C757D;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--content-bg-color, #f8f9fa);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography Enhancements */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Premium Layout Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

.btn-primary-blue {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    border-radius: 10px;
    padding: 10px 24px;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-primary-blue:hover {
    background-color: #0b5ed7;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-primary-green {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
    border-radius: 10px;
    padding: 10px 24px;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-primary-green:hover {
    background-color: #218838;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Navbar Customization */
.navbar {
    padding: 0.5rem 1.5rem;
    background: var(--header-gradient, var(--header-bg-color, rgba(255, 255, 255, 0.7))) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-blue) !important;
}

.nav-link:hover {
    color: var(--primary-blue) !important;
}

/* Global Branding Points (Reset to Blue) */
.navbar,
.container,
.card,
.glass-panel {
    border-color: rgba(13, 110, 253, 0.15) !important;
}

/* Top Hub Filter Bar */
.top-hub-filter {
    position: absolute;
    top: 80px;
    /* Adjusted to be below the fixed header */
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 10px;
    padding: 10px 5px;
    background: transparent;
    white-space: nowrap;
    overflow-x: auto;
    width: 95vw;
    scrollbar-width: none;
    /* Hide scrollbar */
}

.top-hub-filter::-webkit-scrollbar {
    display: none;
}

@media (max-width: 768px) {
    .top-hub-filter {
        top: 70px;
        justify-content: flex-start;
        padding-left: 15px;
    }

    .hub-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

.hub-btn {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 50px;
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.hub-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background-color: rgba(13, 110, 253, 0.05);
}

.hub-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

.hub-btn i {
    font-size: 1.1rem;
}

.hub-btn .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* --- 배리어프리 모드 전용 스타일 --- */
.barrier-free-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.barrier-free-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.switch {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 32px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #dee2e6;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    z-index: 2;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #28A745;
}

input:checked+.slider:before {
    transform: translateX(32px);
}

.slider .on,
.slider .off {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 800;
    color: white;
    z-index: 1;
    transition: opacity 0.2s;
}

.slider .on {
    left: 10px;
    opacity: 0;
}

.slider .off {
    right: 10px;
    opacity: 1;
    color: #6c757d;
}

input:checked+.slider .on {
    opacity: 1;
}

input:checked+.slider .off {
    opacity: 0;
}

/* 배리어프리 모드 활성화 시 전체 레이아웃 변화 */
body.barrier-free-mode {
    font-size: 1.25rem !important;
    background-color: #000 !important;
    color: #FFF !important;
}

body.barrier-free-mode .glass-panel {
    background: #1a1a1a !important;
    border: 2px solid #FFD700 !important;
    color: #FFF !important;
}

body.barrier-free-mode .navbar,
body.barrier-free-mode .footer {
    background-color: #000 !important;
    border-color: #FFD700 !important;
}

body.barrier-free-mode .nav-link,
body.barrier-free-mode .navbar-brand,
body.barrier-free-mode .barrier-free-label {
    color: #FFD700 !important;
}

/* Custom Filter Checkboxes */
.filter-checkbox {
    width: 18px;
    height: 18px;
    border: 1.5px solid #dee2e6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: white;
}

.hub-chip.active .filter-checkbox {
    border-color: #0d6efd;
    background: #0d6efd;
}

.filter-checkbox i {
    font-size: 10px;
    color: white;
    display: none;
}

.hub-chip.active .filter-checkbox i {
    display: block;
}

.hub-chip {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    white-space: nowrap;
    display: flex !important;
    align-items: center;
    padding: 6px 12px !important;
    flex-shrink: 0;
    /* Prevent distortion */
}

.hub-chip>div {
    flex-shrink: 0;
    /* Keep icons/checkboxes fixed size */
}

.hub-chip span {
    transition: all 0.3s ease;
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    overflow: hidden;
    display: none;
    /* Hide completely when not active */
}

.hub-chip:not(.active) {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.8) !important;
}

.hub-chip.active {
    opacity: 1 !important;
    background: white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hub-chip.active span {
    max-width: 100px;
    opacity: 1;
    margin-left: 8px;
    display: inline-block;
    /* Show when active */
}

/* Nav Pills Customization */
.nav-pills .nav-link {
    color: var(--text-dark) !important;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-pills .nav-link.active {
    background: var(--primary-gradient) !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.nav-pills .nav-link i {
    font-size: 1.1rem;
    vertical-align: middle;
}

/* Floating Search Bar */
.floating-search-container {
    position: absolute;
    top: 20px;
    left: 15px;
    right: 15px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-bar-wrapper {
    background: white;
    border-radius: 12px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.search-bar-wrapper input {
    border: none;
    outline: none;
    width: 100%;
    padding: 8px;
    font-weight: 500;
}

/* Weather Widget */
.weather-floating-widget {
    position: absolute;
    top: 150px;
    left: 20px;
    z-index: 90;
    background: white;
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    gap: 2px;
}

.weather-temp {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.weather-dust {
    font-size: 0.7rem;
    background: #e3f2fd;
    color: #1e88e5;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Scrollable Hub Chips */
.hub-chips-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: none;
}

.hub-chips-container::-webkit-scrollbar {
    display: none;
}

.hub-chip {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: var(--transition-smooth);
}

.hub-chip.active {
    background: var(--primary-gradient);
    /* color: white;*/
    border-color: transparent;
}

/* Performance Optimization: GPU Compositing Layers */
.mobile-bottom-nav,
.main-home-header,
#main-bottom-sheet,
.modal,
.map-overlay {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    height: 66px; /* 탭바 높이 살짝 추가 확보 */
    padding: 0;
    border-top: 1.5px solid #ffffff !important;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    /* 컬러 팔레트 그라데이션에 맞춤형 배경 연속성 처리 */
    background: var(--footer-gradient, var(--footer-bg-color, #ffffff)) !important;
    overflow: hidden;
}

.nav-item-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #555558; /* 이미지처럼 중성적인 다크그레이 */
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 800;
    gap: 1px;
    flex: 1;
    height: 100%;
    transition: all 0.2s ease;
    background: transparent; /* 전체 그라데이션 통일을 위해 투명 처리 */
}

.nav-item-mobile i {
    font-size: 1.35rem; /* 아이콘을 시원하게 늘림 */
    color: #555558;
}

.nav-item-mobile.active {
    color: var(--primary-blue, #db2777) !important; /* 전체 테마 컬러 팔레트와 연동 */
}

.nav-item-mobile.active i {
    color: var(--primary-blue, #db2777) !important;
}

/* 탭메뉴 구역별 디자인 배경 적용 (첨부 이미지 매핑 - 그라데이션 배경 통일을 위해 투명 및 반투명 하이라이트만 설정) */
.nav-bg-light {
    background: transparent;
}

.nav-bg-highlight {
    background: rgba(255, 255, 255, 0.22); /* 가운데 탭은 뽀얗고 밝은 느낌의 분홍 하이라이트 얹음 */
    border-left: 1.2px solid #ffffff !important;
    border-right: 1.2px solid #ffffff !important;
}

.nav-bg-gradient {
    background: transparent;
}

/* Bottom Sheet - Changed to Full screen block view */
.bottom-sheet {
    position: fixed;
    top: 0;
    bottom: 0; /* Cover entire screen behind nav */
    left: 0;
    right: 0;
    background: #ffffff;
    z-index: 950;
    display: none; /* Controlled by router */
    flex-direction: column;
    border-radius: 0;
    box-shadow: none;
    border: none;
    transform: none !important;
    animation: sheetFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes sheetFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px) !important;
    }
    to {
        opacity: 1;
        transform: translateY(0) !important;
    }
}

/* Modal Z-index adjustment to be above everything */
.modal {
    z-index: 2100 !important;
}

.modal-backdrop {
    z-index: 2050 !important;
}

/* Force show modals even if nested */
.modal.fade.show {
    display: block !important;
    opacity: 1 !important;
}

/* Floating Widgets - Glassmorphism */
.weather-floating-widget,
.search-bar-wrapper,
.hub-chip {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
}

.sheet-handle-wrapper {
    padding: 8px 20px;
    background: var(--header-gradient, var(--page-header-bg-color, rgba(30, 136, 229, 0.08)));
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: default;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.sheet-handle {
    display: none !important; /* Hide drag handle */
}

.sheet-header-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--header-text-color, var(--text-dark));
    display: flex;
    align-items: center;
}

.sheet-header-icon {
    height: 1.1rem;
    vertical-align: middle;
    margin-right: 6px;
    object-fit: contain;
}

.sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px 90px 16px;
    background-color: var(--content-bg-color, #f8f9fa);
}

.color-palette-block {
    display: flex;
    flex-direction: column;
    width: 36px;
    height: 80px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    margin: 0 auto;
    position: relative;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.color-palette-stripe {
    flex: 1;
    width: 100%;
}

/* Ad Banner */
.ad-banner-wrapper {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 15px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.ad-image {
    width: 80px;
    height: 80px;
    background: #ddd;
    border-radius: 12px;
    object-fit: cover;
}

.ad-text-content {
    flex: 1;
}

.ad-badge {
    font-size: 0.65rem;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: #999;
}

/* Note Card in Bottom Sheet */
.sheet-note-card {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.sheet-note-thumb {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    background: #eee;
    object-fit: cover;
}

.sheet-note-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sheet-note-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.sheet-note-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #8E8E93;
}


/* Proximity Toast Alert */
.proximity-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #11274c;
    /* Navy Blue */
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    z-index: 2000;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 320px;
    border: 2px solid #a51f24;
    /* Deep Red */
}

.proximity-toast.show {
    transform: translateX(-50%) translateY(0);
}

.proximity-toast .alert-icon {
    background: #a51f24;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content Buttons Text and Background mapping */
.btn-primary-blue, .btn-primary {
    color: var(--content-btn-text-color) !important;
    background: var(--content-btn-gradient) !important;
    border-color: transparent !important;
}

/* nav-pills active tab button color sync */
.nav-pills .nav-link.active {
    background: var(--content-btn-gradient) !important;
    color: var(--content-btn-text-color) !important;
}
/* Icon theme coloring filter helper for custom image-based icons in bottom nav */
.icon-theme-target {
    filter: grayscale(1) brightness(0.5) !important;
    opacity: 0.75;
    transition: all 0.2s ease;
}
.active .icon-theme-target {
    /* Converts image dynamically into rose pink (#db2777) */
    filter: invert(18%) sepia(85%) saturate(5185%) hue-rotate(323deg) brightness(88%) contrast(98%) !important;
    opacity: 1;
}

/* CSS Mask based Wheelchair icon helper that integrates perfectly with global color palettes */
.wheelchair-mask-icon {
    display: inline-block;
    background-color: #6b7280; /* Inactive: gray */
    -webkit-mask-image: url('../images/free-icon-disabled-3782827.png?v=260712b');
    mask-image: url('../images/free-icon-disabled-3782827.png?v=260712b');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    opacity: 0.75;
    transition: all 0.2s ease;
}
.active .wheelchair-mask-icon {
    background-color: var(--primary-blue, #faa2c1) !important; /* Dynamic color palette theme color! */
    opacity: 1;
}


/* Login state neon pulse/glow animations and styles */
.login-glow-circle {
    border: 1.5px solid #f43f5e !important; /* Rose Red border */
    color: #e11d48 !important;
    background: #fff1f2 !important; /* Light rose background */
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.6), inset 0 0 4px rgba(244, 63, 94, 0.2) !important;
    animation: login-pulse-pink 2s infinite alternate ease-in-out;
}
.login-glow-rect {
    border: 1.5px solid #eab308 !important; /* Gold Yellow border */
    background: #fef9c3 !important; /* Light yellow background */
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.6), inset 0 0 4px rgba(234, 179, 8, 0.2) !important;
    animation: login-pulse-yellow 2s infinite alternate ease-in-out;
}
@keyframes login-pulse-pink {
    0% {
        box-shadow: 0 0 4px rgba(244, 63, 94, 0.3), inset 0 0 2px rgba(244, 63, 94, 0.1);
    }
    100% {
        box-shadow: 0 0 12px rgba(244, 63, 94, 0.8), 0 0 3px rgba(244, 63, 94, 0.4), inset 0 0 6px rgba(244, 63, 94, 0.3);
    }
}
@keyframes login-pulse-yellow {
    0% {
        box-shadow: 0 0 4px rgba(234, 179, 8, 0.3), inset 0 0 2px rgba(234, 179, 8, 0.1);
    }
    100% {
        box-shadow: 0 0 12px rgba(234, 179, 8, 0.8), 0 0 3px rgba(234, 179, 8, 0.4), inset 0 0 6px rgba(234, 179, 8, 0.3);
    }
}
