/* 기본 스타일 */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f4f4f4;
}

/* 접근성을 위한 스타일 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 헤더 스타일 */
header {
    text-align: center;
    margin-bottom: 30px;
}

h1, h2, h3 {
    color: #2c3e50;
}

/* 서비스 정보 스타일 */
.service-info {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-top: 10px;
}

/* 구글 번역 섹션 스타일 */
#translate {
    text-align: center;
    margin-bottom: 20px;
}

body > .skiptranslate {
    display: none !important;
}

#share {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

/* 업로드 컨테이너 스타일 */
.upload-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: center; /* 추가: dragDropArea를 가운데로 정렬 */
}

.photo-tip {
    font-size: 0.9em;
    color: #3498db;
    margin-bottom: 15px;
}

/* dragDropArea 스타일 */
#dragDropArea {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    display: inline-block; /* label 역할로 바꾸기 위한 스타일 */
}

#dragDropArea:hover, #dragDropArea.dragover {
    background-color: #ecf0f1;
    border-color: #2980b9;
}

#dragDropArea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.5);
}

#imageInput {
    display: none;
}

/* 이미지 미리보기 스타일 */
#imagePreview {
    max-width: 100%;
    max-height: 300px;
    margin: 20px auto;
    display: block;
    border-radius: 4px;
}

/* 버튼 스타일 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    border: none;
    font-size: 16px;
    text-align: center;
}

.btn:hover, .btn:focus {
    background-color: #2980b9;
}

.btn:active {
    transform: translateY(1px);
}

.wide-btn {
    width: calc(100% - 40px);
    max-width: 400px;
    margin: 10px auto;
}

/* 버튼 컨테이너 스타일 */
.button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.button-container .btn {
    margin: 10px 0;
}

/* 로딩 인디케이터 스타일 */
#loading {
    text-align: center;
    color: #3498db;
    font-weight: bold;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 결과 스타일 */
#result {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 20px;
}

/* 개인정보 보호 안내 스타일 */
.privacy-notice {
    font-size: 0.85em;
    color: #7f8c8d;
    background-color: #ecf0f1;
    padding: 10px;
    border-radius: 4px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: #3498db;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 12px;
    margin-left: 5px;
    cursor: help;
}

/* 정기 분석 팁 스타일 */
.regular-analysis-tip {
    font-size: 0.9em;
    color: #27ae60;
    margin-top: 20px;
    padding: 10px;
    background-color: #e8f6e9;
    border-radius: 4px;
}

/* 푸터 스타일 */
footer {
    text-align: center;
    margin-top: 50px;
    color: #7f8c8d;
}

/* 푸터 링크 스타일 */
footer a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover, footer a:focus {
    color: #2980b9;
    text-decoration: underline;
}

/* 반응형 디자인 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    #dragDropArea {
        padding: 20px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 18px;
    }
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #2c3e50;
        color: #ecf0f1;
    }

    h1, h2, h3 {
        color: #3498db;
    }

    .upload-container, #result {
        background-color: #34495e;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

    #dragDropArea {
        border-color: #3498db;
    }

    #dragDropArea:hover, #dragDropArea.dragover {
        background-color: #2c3e50;
    }

    .btn {
        background-color: #3498db;
    }

    .btn:hover, .btn:focus {
        background-color: #2980b9;
    }

    .privacy-notice {
        background-color: #2c3e50;
        color: #bdc3c7;
    }

    .regular-analysis-tip {
        background-color: #27ae60;
        color: #ecf0f1;
    }

    /* 다크 모드에서의 스피너 색상 조정 */
    .spinner {
        border-color: #2c3e50;
        border-top-color: #3498db;
    }

    .service-info {
        color: #bdc3c7;
    }

    footer {
        color: #bdc3c7;
    }

    footer a {
        color: #3498db;
    }

    footer a:hover, footer a:focus {
        color: #2980b9;
    }
}
