/* 기본 설정 */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: sans-serif;
    overflow: hidden;
    -webkit-user-drag: none;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #000000;
    /* background: url('/images/app_bg.png') no-repeat top center fixed;
    background-size: 100% auto; /* 가로 100%, 세로 자동 비율 */
    /* background-position: top center; 상단 정렬 */ */
    overscroll-behavior: none;
}

#logoImg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* 맨 뒤로 보내기 */
    margin-bottom: 20px;
}

/* 캔버스 */
canvas {
    background: #efefef;
    display: block;
    touch-action: none;
    pointer-events: auto;
    width: 98vw; /* 브라우저 너비의 80% */
    height: 89vh; /* 브라우저 높이의 45% */
    border-radius: 1vh;
}

/* 버튼, input, iframe 기본 */
button, input, iframe {
    pointer-events: auto;
    user-select: auto;
    touch-action: manipulation;
    font-family: inherit;
}

/* 메인 컨테이너 */
#mainContainer {
    flex: 1;
    display: flex;
    flex-direction: column; /* 화면 크기에 따라 자동 배치 */
    /*justify-content: center;*/
    align-items: center;
    position: relative;
    gap: 0vh;
    margin-top: -0.2vh;
}

/* 왼쪽 이미지 */
#leftImage {
    max-height: 70vh;
    width: auto;
    object-fit: contain;
    border: 0.3vh solid #EA1F27;
}

/* 캔버스 영역 */
#canvasContainer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1vh;
}

#canvasContainer #overlayImage {
    position: absolute;
    top: 2vh;
    height: 6vh;
    pointer-events: none;
    z-index: 2;
}

/* 공통 버튼 스타일 */
button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1vh;
    border: none;
    border-radius: 1vh;
    padding: 1.2vh 2vh;
    font-size: 2vh;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 0.5vh 1vh rgba(0,0,0,0.2);
    transition: transform 0.1s, box-shadow 0.2s, background 0.2s;
}

button:hover {
    transform: translateY(-0.3vh);
    box-shadow: 0 0.8vh 1.5vh rgba(0,0,0,0.25);
}

/* 아이콘 색상 처리 */
button img {
    filter: invert(100%);
}

/* 버튼 그룹 */
#buttons {
    position: absolute;
    bottom: 1.0vh;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1vw;
    gap: 20px;
}

#buttons-left, #cleanBtnGroup {
    display: flex;
    gap: 12px;
}
/* Undo/Redo/Clear 버튼 */
#undoBtn, #redoBtn, #clearBtn {
    background: #6c757d;
    width: 3vw;
    height: 3vw;
}
#undoBtn img, #redoBtn img, #clearBtn img{
    width: 2vw;
    height: 2vw;
}
/* 보내기/파일/설정 버튼 */
#sendBtn, #filelistBtn, #settingsBtn {
    display: flex;
    align-items: center;
    gap: 8px; 
    font-size: 3vh;
    cursor: pointer;
    color: #000;
    width: 16vw;
    height: 7vh;
}

#settingsBtn {
    /*background: transparent;*/
    border: none;
    box-shadow: none;
    width: 8vh;
    height: 8vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    gap:70px;
}

#sendBtn img, #filelistBtn img, #settingsBtn img, .modal-close img {
    filter: invert(0%);
}
/* 컬러 선택기 */
#colorPaletteButtons {
    display: flex;
    gap: 1vw;
    align-items: center;
}

#buttons-left {
    width: 10vw;
}
 
.color-btn {
    width: 3vw;
    height: 3vw;
    border-radius: 50%;
    cursor: pointer;
    margin-right: 0.5vw;
    border: 3px solid transparent;
    transition: transform 0.15s, border 0.15s, box-shadow 0.2s;
    border: 3px solid #efefef;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);

    /* 흰색 계열 그라데이션 */
    background: linear-gradient(135deg, #ffffff, #f0f0f0, #e0e0e0);
}
.color-btn.selected {
    border: 3px solid #fff;
    transform: scale(1.5);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}


/* 슬라이더 (iPad 대응 반응형 수정 버전) */
#lineWidthSlider {
    -webkit-appearance: none;
    width: 10vw; /* 화면 너비의 50% */
    height: 2vh; /* 세로 크기를 상대적으로 줄임 */
    background: #ddd;
    border-radius: 3vh;
    outline: none;
}

/* 트랙 */
#lineWidthSlider::-webkit-slider-runnable-track {
    height: 1vh;
    background: #ddd;
    border-radius: 1vh;
}

#lineWidthSlider::-moz-range-track {
    height: 1vh;
    background: #ddd;
    border-radius: 1vh;
}

/* 손잡이 (iPad Safari 대응) */
#lineWidthSlider::-webkit-slider-thumb {
    -webkit-appearance: none; /* 기본 thumb 제거 */
    appearance: none;
    width: 2vh; /* ← 여기가 실제 크기 반영 */
    height: 2vh;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    margin-top: calc(-0.5vh); /* 트랙 중앙 정렬 */
}

/* Firefox 대응 */
#lineWidthSlider::-moz-range-thumb {
    width: 2vh;
    height: 2vh;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
}
/* 터치 제스처 방지 */
#modalResult {
    touch-action: none;
}



#modalResult .modal-dialog {
    width: 80vw; /* 화면 너비의 80% */
    max-width: none !important; /* Bootstrap 기본 최대폭 제한 제거 */
}

#modalResult .modal-content {
    border-radius: 2vh !important;
    font-size: 2vh; /* 글자 크기도 화면 비율에 맞게 */
}

#modalResult .modal-body img {
    width: 100%;
    height: auto; 
    object-fit: contain;
}

#modalResult .modal-footer button {
    font-size: 2vh;
    padding: 1vh 4vh;
    border-radius: 50px;
}

    
#footer {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    padding: 0.5rem 0;
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
}