/* ==========================================================================
   modals.css - 안드로이드 스타일 설정 바텀시트, 사진 확대 라이트박스 모달 (모바일 피팅)
   ========================================================================== */

/* 설정 바텀시트 오버레이 모달 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.settings-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #181a1f;
    border-top: 1px solid #333845;
    border-radius: 18px 18px 0 0;
    padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px)) 14px;
    z-index: 101;
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
    max-height: 82vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.modal-overlay.show .settings-sheet {
    transform: translateY(0);
}

.sheet-drag-handle {
    width: 36px;
    height: 4px;
    background: #4b5563;
    border-radius: 2px;
    margin: 0 auto 10px auto;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #272a31;
}

.sheet-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f3f4f6;
    display: flex;
    align-items: center;
    gap: 6px;
}

.close-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}

/* 개별 설정 아이템 카드 */
.setting-item, .setting-section {
    background: #1e2128;
    border: 1px solid #2d3340;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.setting-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #a1a1aa;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.value-badge, .val-badge {
    background: #f43f5e;
    color: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
}

.value-badge.pitch, .val-badge.pitch {
    background: #8b5cf6;
}

.slider-row, .slider-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.step-btn {
    background: #272a30;
    border: 1px solid #3f4451;
    color: #f3f4f6;
    font-weight: bold;
    font-size: 1rem;
    width: 34px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.12s ease;
}

.step-btn:active {
    background: #3f4451;
    transform: scale(0.95);
}

input[type=range] {
    flex: 1;
    height: 6px;
    background: #2d3340;
    border-radius: 3px;
    border: none;
    accent-color: #f43f5e;
    cursor: pointer;
}

input[type=range].pitch-slider {
    accent-color: #8b5cf6;
}

.preset-buttons, .preset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.preset-btn {
    background: #272a30;
    border: 1px solid #3f4451;
    color: #d1d5db;
    padding: 6px 2px;
    font-size: 0.76rem;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    transition: all 0.12s ease;
}

.preset-btn.active {
    background: #f43f5e;
    color: #fff;
    border-color: #f43f5e;
    font-weight: 700;
}

.preset-btn.pitch-preset.active {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

select, .voice-select {
    width: 100%;
    background: #14161a;
    border: 1px solid #3b4252;
    color: #f3f4f6;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 0.8rem;
    outline: none;
    box-sizing: border-box;
}

.danger-btn {
    width: 100%;
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: #fda4af;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.danger-btn:active {
    background: #f43f5e;
    color: #fff;
}

.log-box {
    background: #0d0e11;
    border: 1px solid #232730;
    border-radius: 7px;
    padding: 8px;
    font-family: monospace;
    font-size: 0.68rem;
    color: #10b981;
    max-height: 90px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 사진 확대 라이트박스 모달 */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lightbox-modal.show {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.lightbox-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.lightbox-close-btn:active {
    background: #f43f5e;
}

/* 실시간 상태 변경 플로팅 토스트 알림 */
.toast-container {
    position: fixed;
    top: 54px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 90%;
    max-width: 380px;
}

.toast-popup {
    background: rgba(24, 26, 31, 0.95);
    border: 1px solid rgba(244, 63, 94, 0.45);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 14px rgba(244, 63, 94, 0.25);
    backdrop-filter: blur(8px);
    color: #f3f4f6;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.toast-popup.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-popup.hide {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
}

