/* static/css/style.css */

/* 기본 설정 및 리셋 */
* {
    box-sizing: border-box;
    word-break: break-all; /* 요청하신 텍스트 줄바꿈 설정 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f3f4f6; /* bg-gray-100 */
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 메인 컨테이너 카드 */
.main-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.75rem; /* rounded-xl */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    width: 100%;
    max-width: 32rem; /* max-w-lg */
    margin: 1rem;
}

/* 모바일 이상 해상도 (sm) 대응 */
@media (min-width: 640px) {
    .main-card {
        padding: 2.5rem; /* sm:p-10 */
    }
    .title {
        font-size: 1.875rem; /* sm:text-3xl */
    }
    .upload-area {
        height: 15rem; /* sm:h-60 */
    }
}

/* 제목 스타일 */
.title {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 700;
    text-align: center;
    color: #1f2937; /* text-gray-800 */
    margin-bottom: 2rem;
}

/* 폼 요소 공통 */
.form-group {
    margin-bottom: 1.5rem; /* space-y-6 대체 */
}

.form-label {
    display: block;
    font-size: 1.125rem; /* text-lg */
    font-weight: 600;
    color: #374151; /* text-gray-700 */
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db; /* border-gray-300 */
    border-radius: 0.5rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: #3b82f6; /* focus:ring-blue-500 효과 */
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* 이미지 업로드 영역 */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 12rem; /* h-48 */
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    background-color: #f9fafb; /* bg-gray-50 */
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    overflow: hidden;
}

.upload-area:hover {
    background-color: #f3f4f6; /* hover:bg-gray-100 */
}

.upload-area.dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.upload-icon {
    height: 3rem;
    width: 3rem;
    color: #9ca3af; /* text-gray-400 */
    margin-bottom: 0.5rem;
}

.upload-text {
    font-size: 0.875rem; /* text-sm */
    color: #4b5563; /* text-gray-600 */
}

.upload-highlight {
    font-weight: 500;
    color: #2563eb; /* text-blue-600 */
}

/* 생성 버튼 */
.submit-btn {
    width: 100%;
    background-color: #2563eb; /* bg-blue-600 */
    color: white;
    font-size: 1.125rem; /* text-lg */
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.submit-btn:hover:not(:disabled) {
    background-color: #1d4ed8; /* hover:bg-blue-700 */
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 결과 섹션 */
.result-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb; /* border-gray-200 */
    text-align: center;
}

.result-title {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.result-desc {
    color: #4b5563;
    margin-bottom: 1rem;
}

.result-img-container {
    width: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.result-img-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* 에러 메시지 */
.error-message {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #fee2e2; /* bg-red-100 */
    border: 1px solid #fca5a5; /* border-red-300 */
    color: #991b1b; /* text-red-800 */
    border-radius: 0.5rem;
    text-align: center;
}

/* 로더 (Loader) */
.loader {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 유틸리티 클래스 */
.hidden {
    display: none !important;
}

/* 푸터 */
.footer {
    width: 100%;
    max-width: 32rem;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

.footer-text {
    font-size: 0.75rem; /* text-xs */
    color: #9ca3af; /* text-gray-400 */
}

.footer-link {
    font-weight: 600;
    color: #6b7280; /* text-gray-500 */
    text-decoration: underline;
}

.footer-link:hover {
    color: #374151;
}