@import url('https://fonts.googleapis.com/css2?family=Black+Han+Sans&family=Nanum+Brush+Script&family=Jua&display=swap');

/* 전체 화면 설정 */
body {
    font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    padding: 0;
    height: 100vh;
}

/* 수평(가로) 배치를 위한 wrapper 박스 */
.wrapper {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
}

/* --- 왼쪽 패널 (컨트롤 영역) --- */
.left-panel {
    width: 350px;
    background-color: white;
    padding: 20px;
    box-shadow: 2px 0px 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 10;
}

/* 데굴데굴 허브 백링크 */
.back-link {
    display: inline-block;
    color: #2b7cff;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 10px;
}
.back-link:hover { text-decoration: underline; }

/* --- 오른쪽 패널 (작업 및 미리보기 영역) --- */
.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #e9e9e9;
    height: 100%;
    overflow: auto;
}

/* 제목 꾸미기 */
h1 {
    font-family: 'Black Han Sans', sans-serif;
    color: #ffcc00;
    text-shadow: 2px 2px 0px #000;
    font-size: 32px;
    margin-top: 0;
    margin-bottom: 5px;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #666;
    font-size: 13px;
    margin-bottom: 20px;
}

/* 각 컨트롤 구역의 박스 모양 */
.control-box {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.control-box h3 {
    margin-top: 0;
    font-size: 16px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

/* 입력칸들 간격 */
.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
}

/* textarea(여러 줄 입력칸) 스타일 */
.input-group input[type="text"],
.input-group textarea {
    width: 100%;
    height: 45px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    resize: none;
}

/* 라디오 버튼 그룹 디자인 */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-item {
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.2s;
    font-size: 14px;
    font-weight: bold;
    background-color: #fff;
}

.radio-item:hover {
    background-color: #eee;
}

.radio-item.type1 {
    border-left: 5px solid #FFDD00;
}

.radio-item.type2 {
    border-left: 5px solid #FF3300;
}

/* 3번 템플릿 배경색 변경 */
.radio-item.type3 {
    border-left: 5px solid #FF9F43;
}

.radio-item.type4 {
    border-left: 5px solid #CC0000;
}

/* [추가됨] 5번 말풍선 자막 (파란색 테마) */
.radio-item.type5 {
    border-left: 5px solid #2196F3;
}

.radio-item.custom-type {
    border-left: 5px solid #0066cc;
}

/* 글자 크기 슬라이더 */
.input-group input[type="range"] {
    width: calc(100% - 50px);
    vertical-align: middle;
}

#sizeValueDisplay {
    display: inline-block;
    width: 40px;
    text-align: right;
    font-weight: bold;
    font-size: 14px;
}


/* 오른쪽 캔버스 및 자르기 영역 꾸미기 */
#welcomeScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
    font-size: 20px;
}

#canvasArea {
    width: 80%;
    min-height: calc(100% - 40px);
    max-height: calc(100% - 80px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hidden {
    display: none !important;
}

.crop-container {
    width: 100%;
    max-height: 600px;
    margin-bottom: 15px;
    overflow: hidden;
    background-color: #333;
}

#cropArea {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

img {
    display: block;
    max-width: 100%;
}

canvas {
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    height: auto;
    cursor: crosshair;
}

/* 버튼 디자인 */
.action-btn {
    width: 100%;
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
}

.action-btn:hover {
    background-color: #45a049;
}

.download-btn {
    background-color: #333;
    margin-top: 10px;
}

.download-btn:hover {
    background-color: #0056b3;
}

.guide-text {
    font-size: 15px;
    color: #d9534f;
    margin-bottom: 10px;
    background-color: #fdf5f5;
    padding: 10px;
    border-radius: 5px;
    border-left: 5px solid #d9534f;
    line-height: 1.5;
}