/* mobile-image-editor.css - 모바일 이미지 편집기 전용 CSS */

/* 전체 레이아웃 */
.m-img-editor-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--m-bg);
}

/* 상단 헤더 */
.m-img-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--m-bg-panel);
    border-bottom: 1px solid var(--m-border);
    flex-shrink: 0;
}

.m-img-editor-header h1 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--m-text-primary);
}

.m-img-editor-back,
.m-img-editor-save {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--m-text-primary);
    border-radius: 0.5rem;
    cursor: pointer;
}

.m-img-editor-back:active,
.m-img-editor-save:active {
    background: rgba(255, 255, 255, 0.1);
}

.m-img-editor-save:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.m-img-editor-save .material-symbols-outlined {
    color: var(--m-accent);
}

/* 캔버스 영역 */
.m-img-editor-canvas-area {
    flex: 1;
    position: relative;
    background: #0f172a;
    overflow: hidden;
    touch-action: none;
}

.m-img-editor-canvas-area canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* 이미지 없을 때 플레이스홀더 */
.m-img-editor-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--m-text-muted);
    pointer-events: none;
}

.m-img-editor-placeholder .material-symbols-outlined {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.m-img-editor-placeholder p {
    margin: 0;
    font-size: 0.875rem;
}

/* 하단 툴바 */
.m-img-editor-toolbar {
    background: var(--m-bg-panel);
    border-top: 1px solid var(--m-border);
    padding: 0.75rem;
    flex-shrink: 0;
}

.m-img-editor-tools-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.m-img-editor-tools-row:last-child {
    margin-bottom: 0;
}

/* 도구 버튼 */
.m-img-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    min-width: 48px;
    height: 48px;
    padding: 0.25rem 0.5rem;
    background: var(--m-bg-secondary);
    border: none;
    border-radius: 0.5rem;
    color: var(--m-text-secondary);
    font-size: 0.625rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.m-img-tool-btn .material-symbols-outlined {
    font-size: 1.25rem;
}

.m-img-tool-btn:active {
    transform: scale(0.95);
}

.m-img-tool-btn.active {
    background: var(--m-accent);
    color: white;
}

.m-img-tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.m-img-tool-btn:disabled:active {
    transform: none;
}

/* 줌 레벨 표시 */
.m-img-zoom-level {
    min-width: 50px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--m-accent);
    font-family: monospace;
}

/* 사진 변경 섹션 */
.m-img-editor-upload-section {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--m-border);
}

.m-img-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--m-text-secondary);
}

.m-img-upload-label .material-symbols-outlined {
    font-size: 1rem;
}

/* 업로드 버튼 영역 */
.m-img-editor-upload-row {
    display: flex;
    gap: 0.75rem;
}

.m-img-upload-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--m-bg-secondary);
    border: 1px dashed var(--m-border);
    border-radius: 0.5rem;
    color: var(--m-text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.m-img-upload-btn:active {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--m-accent);
}

.m-img-upload-btn .material-symbols-outlined {
    font-size: 1.25rem;
}

/* 크롭 액션 버튼 */
.m-img-crop-actions {
    position: fixed;
    bottom: 200px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 100;
    animation: m-crop-actions-in 0.2s ease-out;
}

@keyframes m-crop-actions-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.m-crop-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease;
}

.m-crop-btn:active {
    transform: scale(0.95);
}

.m-crop-btn .material-symbols-outlined {
    font-size: 1.125rem;
}

.m-crop-apply {
    background: #22c55e;
    color: white;
}

.m-crop-cancel {
    background: #ef4444;
    color: white;
}

/* 토스트 메시지 */
.m-img-toast {
    position: fixed;
    bottom: 220px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(34, 197, 94, 0.95);
    color: white;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: m-toast-fade-in 0.3s ease-out;
}

.m-img-toast .material-symbols-outlined {
    font-size: 1.25rem;
}

@keyframes m-toast-fade-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 에러 토스트 */
.m-img-toast.error {
    background: rgba(239, 68, 68, 0.95);
}

/* 로딩 상태 */
.m-img-editor-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
}

/* 이미지 교체 모달 */
.m-img-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: m-modal-fade-in 0.2s ease-out;
}

@keyframes m-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.m-img-modal {
    background: var(--m-bg-panel);
    border-radius: 1rem;
    width: 90%;
    max-width: 320px;
    overflow: hidden;
    animation: m-modal-slide-up 0.2s ease-out;
}

@keyframes m-modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.m-img-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--m-border);
}

.m-img-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--m-text-primary);
}

.m-img-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--m-text-secondary);
    border-radius: 0.5rem;
    cursor: pointer;
}

.m-img-modal-close:active {
    background: rgba(255, 255, 255, 0.1);
}

.m-img-modal-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.m-img-modal-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--m-bg-secondary);
    border: 1px solid var(--m-border);
    border-radius: 0.75rem;
    color: var(--m-text-primary);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.m-img-modal-option:active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--m-accent);
}

.m-img-modal-option .material-symbols-outlined {
    font-size: 1.5rem;
    color: var(--m-accent);
}
