/* 기본 설정 */
:root {
    --bg-dark: #121212;
    --bg-panel: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent-color: #3498db;
    --accent-hover: #2980b9;
    --border-color: #333;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Noto Sans KR', sans-serif;
    overflow: hidden; /* 앱 같은 느낌 */
    height: 100vh;
}

/* 레이아웃 */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.app-header {
    background-color: #000;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.app-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    letter-spacing: 1px;
}

.content-wrapper {
    flex-grow: 1;
    overflow: hidden;
    padding: 0;
    position: relative;
}

.step-section {
    display: none;
    height: 100%;
}

.step-section.active {
    display: block;
}

/* 캔버스 영역 */
.canvas-area {
    background-color: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 100%;
    overflow: hidden;
}

.crop-container {
    max-width: 90%;
    max-height: 80vh;
}

#image, #decoImage {
    display: block;
    max-width: 100%;
    max-height: 80vh;
}

#empty-state {
    padding: 50px;
    border: 2px dashed #333;
    border-radius: 10px;
}

.res-badge {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    z-index: 10;
    pointer-events: none;
}

/* 툴바 영역 (사이드바) */
.tool-sidebar {
    background-color: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.tool-group {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #2c2c2c;
}

.tool-group:last-child {
    border-bottom: none;
}

.tool-header {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.res-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 컨트롤 요소 스타일 */
.dark-input {
    background-color: #2d2d2d;
    border: 1px solid #444;
    color: #fff;
}
.dark-input:focus {
    background-color: #333;
    border-color: var(--accent-color);
    color: #fff;
    box-shadow: none;
}

.ratio-btn {
    border-color: #444;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 10px 5px;
}
.ratio-btn:hover, .ratio-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}
.ratio-btn .sub-text {
    font-size: 0.7rem;
    opacity: 0.7;
}

.custom-range::-webkit-slider-thumb {
    background: var(--accent-color);
}

.slider-control {
    margin-bottom: 10px;
}
.slider-control label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}
.text-highlight {
    color: #e74c3c !important;
    font-weight: bold;
}

.btn-text {
    color: var(--text-muted);
    background: none;
    border: none;
    font-size: 0.8rem;
    text-decoration: underline;
}

/* 2단계 데코레이션 */
.bg-darker {
    background-color: #0a0a0a;
}

#decoStage {
    position: relative;
    display: inline-block;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.guide-text {
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.draggable-item {
    position: absolute;
    cursor: grab;
    padding: 2px 5px;
    border: 1px dashed transparent;
    min-width: 30px;
    text-align: center;
    white-space: nowrap;
    user-select: none;
    z-index: 100;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}
.draggable-item:hover, .draggable-item:focus, .draggable-item.selected {
    border: 1px dashed rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.2);
    outline: none;
}

.resize-handle {
    position: absolute;
    right: -5px; bottom: -5px;
    width: 12px; height: 12px;
    background-color: var(--accent-color);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: se-resize;
    z-index: 101;
    display: none;
}
.draggable-item:hover .resize-handle,
.draggable-item.selected .resize-handle {
    display: block;
}

.highlight-group {
    background: rgba(52, 152, 219, 0.1);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.info-msg {
    font-size: 0.8rem;
    color: #ffcc00;
    margin-top: 8px;
}

/* 해상도 경고 */
.cropper-view-box.low-res {
    outline: 4px solid rgba(231, 76, 60, 0.8);
    box-shadow: inset 0 0 30px rgba(231, 76, 60, 0.3);
}

/* 모바일 반응형 */
@media (max-width: 991px) {
    body { height: auto; overflow-y: auto; }
    .app-container { height: auto; }
    .row.g-0 { flex-direction: column; }
    
    .canvas-area {
        height: 60vh;
        border-bottom: 1px solid #333;
    }
    
    .tool-sidebar {
        height: auto;
        border-left: none;
        padding-bottom: 50px;
    }
    
    .ratio-btn { font-size: 0.8rem; }
}

/* --- [최종 수정] 하단 푸터 최소화 스타일 --- */
.app-footer {
    background-color: #000; /* 완전 검정 */
    border-top: 1px solid #222;
    padding: 10px 15px; /* 여백을 30px -> 10px로 대폭 축소 */
    font-size: 0.7rem; /* 글자 크기 11px 정도로 축소 */
    color: #555; /* 글자색을 어둡게 하여 시선 분산 방지 */
    text-align: center;
    flex-shrink: 0;
    z-index: 1000;
    line-height: 1.4; /* 줄 간격 좁힘 */
}

.app-footer .footer-compact {
    word-break: keep-all; /* 단어 단위로 줄바꿈 */
}

.app-footer .bar {
    color: #333;
    margin: 0 4px;
    font-size: 0.6rem;
    vertical-align: middle;
}

.app-footer .text-white {
    color: #999 !important; /* 상호명도 너무 튀지 않게 조정 (원하면 #fff로 변경) */
}

.app-footer .copyright {
    margin-top: 4px;
    font-family: Arial, sans-serif;
    color: #333; /* 아주 어둡게 처리 */
    font-size: 0.65rem;
}

/* 모바일 대응: 좁은 화면에서도 최소한의 공간만 차지 */
@media (max-width: 768px) {
    .app-footer {
        padding: 8px 10px;
        font-size: 0.65rem; /* 모바일에서 더 작게 */
    }
    .app-footer .bar {
        display: inline-block; /* 필요시 줄바꿈 허용 */
    }
}

/* 모바일 화면 최적화 */
@media (max-width: 991px) {
    .app-footer {
        padding-bottom: 40px; /* 하단 스크롤 여유 공간 */
    }
    .app-footer p {
        font-size: 0.7rem;
    }
    .app-footer .divider {
        opacity: 0.5;
    }
}