/* 퇴근후AI 챌린지 - JSON 프롬프트 만들기 스타일 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #e2e8f0;
    line-height: 1.6;
}

/* 모드 토글 컨테이너 */
.mode-toggle-container {
    display: flex;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 0.75rem;
    padding: 0.25rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.mode-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    color: #e2e8f0;
}

.mode-btn.active {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: white;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

/* 랜덤 버튼 */
.random-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.random-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.random-btn:active {
    transform: translateY(0);
}

/* 상세 모드 전용 섹션 */
.detailed-only {
    transition: all 0.3s ease;
}

body.simple-mode .detailed-only {
    display: none !important;
}

/* 간략 모드 안내 배지 */
.simple-mode-badge {
    display: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

body.simple-mode .simple-mode-badge {
    display: inline-flex;
}

/* 카드 스타일 */
.card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.1);
}

/* 섹션 타이틀 */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.section-title i {
    color: #a855f7;
}

/* 옵션 그룹 */
.option-group {
    margin-bottom: 1rem;
}

.option-group:last-child {
    margin-bottom: 0;
}

/* 입력 래퍼 */
.input-wrapper {
    display: flex;
    gap: 0.5rem;
}

/* 셀렉트 스타일 */
.option-select {
    flex: 1;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    color: #e2e8f0;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

.option-select:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.option-select:hover {
    border-color: #64748b;
}

/* 토글 버튼 */
.toggle-input-btn {
    width: 42px;
    height: 42px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-input-btn:hover {
    background: #475569;
    color: #e2e8f0;
}

.toggle-input-btn.active {
    background: #a855f7;
    border-color: #a855f7;
    color: white;
}

/* 커스텀 인풋 */
.custom-input {
    width: 100%;
    margin-top: 0.5rem;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    color: #e2e8f0;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.custom-input:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.custom-input.hidden {
    display: none;
}

/* 이미지 비율 버튼 */
.aspect-btn {
    padding: 0.5rem 0.75rem;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 0.5rem;
    color: #94a3b8;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aspect-btn:hover {
    background: #475569;
    color: #e2e8f0;
}

.aspect-btn.active {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    border-color: transparent;
    color: white;
}

/* 인물 마커 */
.person-marker {
    position: absolute;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: grab;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 10px rgba(168, 85, 247, 0.3);
    user-select: none;
    z-index: 10;
}

.person-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(168, 85, 247, 0.4);
}

.person-marker.dragging {
    cursor: grabbing;
    transform: scale(1.15);
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.5);
    z-index: 20;
}

/* 인물 설정 카드 */
.person-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 1rem;
}

.person-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #334155;
}

.person-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
}

/* JSON 출력 */
#jsonOutput {
    white-space: pre-wrap;
    word-break: break-word;
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* 미리보기 캔버스 */
#previewCanvas {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    transition: aspect-ratio 0.3s ease;
}

/* 복사 완료 토스트 */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #a855f7, #ec4899);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 반응형 */
@media (max-width: 1024px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 1rem;
    }

    .section-title {
        font-size: 1.125rem;
    }

    .aspect-btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }

    #positionCanvas {
        height: 200px;
    }

    .person-marker {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease;
}

/* 그리드 라인 (캔버스 배경) */
.grid-bg {
    background-image: 
        linear-gradient(rgba(148, 163, 184, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* 입력 필드 플레이스홀더 */
input::placeholder,
textarea::placeholder {
    color: #64748b;
}

/* 라벨 호버 효과 */
label {
    transition: color 0.2s ease;
}

.option-group:hover label {
    color: #f1f5f9;
}

/* 버튼 클릭 효과 */
button:active {
    transform: scale(0.98);
}

#generateBtn:active {
    transform: scale(0.99);
}

/* 포커스 상태 통일 */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

/* 슬라이더 스타일 */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #334155;
    border-radius: 4px;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

/* 인물 위치 레이블 */
.position-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
}

/* 배경 유형 선택 버튼 */
.bg-type-btn {
    background: #334155;
    border: 1px solid #475569;
    color: #94a3b8;
}

.bg-type-btn:hover {
    background: #475569;
    color: #e2e8f0;
}

.bg-type-btn.active {
    background: linear-gradient(135deg, #a855f7, #ec4899);
    border-color: transparent;
    color: white;
}

/* 숨김 클래스 */
.hidden {
    display: none !important;
}

/* 인물 설정 카드 확장 */
.person-card {
    transition: all 0.3s ease;
}

.person-card.collapsed .person-card-body {
    display: none;
}

.person-card-toggle {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.person-card.collapsed .person-card-toggle {
    transform: rotate(-90deg);
}

/* 인물 카드 내부 셀렉트 스타일 */
.person-card .option-select {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

.person-card .toggle-input-btn {
    width: 36px;
    height: 36px;
}

.person-card .custom-input {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

/* 아코디언 애니메이션 */
.person-card-body {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}
