body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* 로그인 배경 */
.auth-bg {
    background-color: #fff7ed;
    background-image: radial-gradient(#fb923c 0.5px, transparent 0.5px), radial-gradient(#fb923c 0.5px, #fff7ed 0.5px);
    background-size: 20px 20px;
}

/* 페이지 전환용 유틸리티 */
.page-section {
    display: none;
    width: 100%;
    height: 100%;
}

.page-section.active {
    display: flex;
    flex-direction: column;
}

/* 스크롤바 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

/* Family Site Dropdown Animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.animate-slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Sidebar - fixed to viewport height */
#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 50;
}

/* 
   Breakpoints (Tablet Optimized):
   Mobile: ~ 767px
   Tablet Portrait: 768px ~ 1023px (Fluid layout for on-site work)
   Desktop & Tablet Landscape: 1024px+ (Sidebar visible)
*/

/* 태블릿 세로 및 소형 가로 (768px ~ 1023px) - 유연한 레이아웃 보강 */
@media (min-width: 768px) and (max-width: 1023px) {
    body {
        font-size: 15px; /* 현장 가독성을 위해 살짝 조정 가능 */
    }
}

/* 1023px 이하에서는 사이드바 숨김 (Tailwind lg:flex 기준인 1024px 미만) */
@media (max-width: 1023px) {
    #sidebar {
        display: none !important;
    }

    #main-container {
        margin-left: 0 !important;
    }
}

/* 1024px 이상에서 사이드바 노출 및 여백 확보 */
@media (min-width: 1024px) {
    #sidebar {
        display: flex !important;
    }

    #main-container {
        margin-left: 16rem; /* 256px = w-64 */
        transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    body.has-collapsed-sidebar #main-container {
        margin-left: 5rem; /* 80px = w-20 */
    }
}


/* 1024px-1279px (Small Desktop/Tablet Landscape) Content Optimization */
@media (min-width: 1024px) and (max-width: 1279px) {
    .page-section {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    .text-3xl {
        font-size: 1.5rem !important;
    }
}

/* Sticky Action Bar (Thumb Zone Optimization) */
.sticky-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    z-index: 40;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

/* Sidebar margin for sticky bar on Desktop */
@media (min-width: 1024px) {
    .sticky-action-bar {
        left: 16rem;
        /* w-64 sidebar */
    }
}

/* Touch Safe Area (Grip Deadzone Optimization) */
.touch-safe-area {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 768px) {
    .touch-safe-area {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .touch-safe-area {
        padding-left: 3.5rem;
        padding-right: 3.5rem;
    }
}

/* Global Touch Target Minimums */
button.btn-touch, 
input.input-touch,
select.select-touch,
.nav-item {
    min-height: 48px;
}

/* Form spacing for sticky footer */
.has-sticky-footer {
    padding-bottom: 5rem;
}

/* Sidebar Collapse (Tablet Landscape/Desktop) */
#sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar.collapsed {
    width: 80px;
}

#sidebar.collapsed .sidebar-header-text,
#sidebar.collapsed .menu-text,
#sidebar.collapsed .fa-chevron-down {
    display: none;
}

#sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

#sidebar.collapsed nav ul li a {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

#sidebar.collapsed nav ul li a i {
    margin-right: 0;
    font-size: 1.25rem;
}

/* Adjust Sticky Bar when sidebar is collapsed */
@media (min-width: 1024px) {
    body.has-collapsed-sidebar .sticky-action-bar {
        left: 80px;
    }
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
    background: rgba(30, 42, 56, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Trendy Shadows */
.shadow-trendy {
    box-shadow: 0 10px 30px -5px rgba(249, 115, 22, 0.15), 0 4px 10px -5px rgba(249, 115, 22, 0.1);
}

.shadow-premium {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.05), 0 10px 20px -5px rgba(0, 0, 0, 0.02);
}

/* Step Indicator */
.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #e5e7eb;
    transition: all 0.3s ease;
}

.step-dot.active {
    background-color: #f97316;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
}

/* Double Price Badge */
.price-tag-supply {
    background-color: #f1f5f9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.price-tag-consumer {
    background-color: #fff7ed;
    color: #ea580c;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

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