/*
* [모듈명]: 사이드 드로어 스타일
* [파일명]: drawer.css
* [역할]: 앱 좌측에서 슬라이드되는 메뉴의 애니메이션과 레이아웃을 정의합니다.
*/

:root {
    --drawer-width: 280px;
    --drawer-bg: #000000;
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --menu-text: #FFFFFF;
    --menu-sub-text: #666666;
    --divider-color: #222222;
}

/* 오버레이 (딤머) */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    backdrop-filter: blur(2px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    will-change: opacity; /* 사파리 가속 유도 */
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 사이드 드로어 본체 */
.side-drawer {
    position: fixed;
    top: 0;
    left: calc(-1 * var(--drawer-width));
    width: var(--drawer-width);
    height: 100%;
    background: var(--drawer-bg);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--divider-color);
    will-change: transform; /* 사파리 하드웨어 가속 강제 */
    transform: translateZ(0); /* 사파리 렌더링 깜빡임 방지 */
}

.side-drawer.active {
    transform: translateX(var(--drawer-width));
}

/* 헤더: 프로필 요약 */
.drawer-header {
    padding: 0 20px 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.user-profile-brief {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drawer-avatar {
    width: 48px;
    height: 48px;
    background: #1A1A1A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
}

.drawer-avatar svg {
    width: 32px;
    height: 32px;
}

.user-info .nickname {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
}

.user-info .user-handle {
    font-size: 13px;
    color: var(--menu-sub-text);
    margin: 2px 0 0 0;
}

.btn-close-drawer {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
}

/* 사용자 통계 */
.drawer-stats {
    display: flex;
    gap: 16px;
    padding: 0 20px 20px 20px;
}

.stat-item {
    font-size: 14px;
    display: flex;
    gap: 4px;
}

.stat-item .count {
    font-weight: 800;
    color: #fff;
}

.stat-item .label {
    color: var(--menu-sub-text);
}

/* 메뉴 리스트 */
.drawer-menu {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--menu-text);
    transition: background 0.2s;
}

.menu-item:active {
    background: #111;
}

.menu-item .material-icons {
    font-size: 24px;
}

.menu-item .text {
    font-size: 16px;
    font-weight: 700;
    flex: 1;
}

.badge {
    background: #00B0FF;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 2px; /* 아주 작은 뱃지는 모서리 곡률 2px로 적용 */
}

.balance-badge {
    font-size: 13px;
    font-weight: 800;
    color: #FFF;
    background: #222;
    padding: 4px 10px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
}

.menu-divider {
    height: 1px;
    background: var(--divider-color);
    margin: 10px 20px;
}

/* 시그널 탭 설정 섹션 */
.drawer-settings-section {
    padding: 10px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-bottom: 1px solid var(--divider-color);
    margin-bottom: 10px;
}

.settings-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--menu-sub-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--menu-text);
}

/* 버튼 그룹 (On/Off, 이성/모두) */
.settings-btn-group {
    display: flex;
    background: #111;
    border: 1px solid #222;
    border-radius: 6px;
    padding: 2px;
}

.settings-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    border: none;
    background: none;
    color: var(--menu-sub-text);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.settings-btn.active {
    background: #333;
    color: #fff;
}

/* 수정 버튼 스타일 */
.btn-edit-small {
    background: #222;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 8px;
}

.btn-edit-small:active {
    background: #333;
}

/* 바텀시트 시스템 */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.bottom-sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: #000;
    border-top: 1px solid #222;
    border-radius: 20px 20px 0 0;
    z-index: 2001;
    padding: 20px;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-sheet.active {
    bottom: 0;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.sheet-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.btn-close-sheet {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
}

.sheet-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-label {
    font-size: 13px;
    font-weight: 700;
    color: #888;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #111;
    border: 1px solid #222;
    border-radius: 12px;
    padding: 0 16px;
}

.input-field {
    width: 100%;
    height: 54px;
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    outline: none;
}

.input-suffix {
    color: #666;
    font-size: 14px;
    font-weight: 700;
    margin-left: 8px;
}

.btn-save-sheet {
    width: 100%;
    height: 56px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    margin-top: 10px;
    cursor: pointer;
}

.btn-save-sheet:active {
    transform: scale(0.98);
}

.logout {
    color: #FF4040;
}

/* 터치 제어: 배경 스크롤 방지 */
body.drawer-open {
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
}