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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.screen {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 시작 화면 */
h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.option-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.option-btn .icon {
    font-size: 1.5rem;
}

/* 드래그 앤 드롭 영역 */
.drop-zone {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 40px 20px;
    background: #f8f9ff;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 20px;
}

.drop-zone:hover,
.drop-zone.drag-over {
    background: #eef1ff;
    border-color: #764ba2;
    transform: scale(1.02);
}

.drop-zone.drag-over {
    background: #e0e5ff;
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.drop-icon {
    font-size: 3rem;
}

.drop-text {
    color: #666;
    font-size: 1rem;
}

.upload-btn {
    padding: 12px 30px;
    font-size: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* 구분선 */
.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.divider span {
    padding: 0 15px;
    color: #999;
    font-size: 0.9rem;
}

/* 웹캠 화면 */
#webcam-screen h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
}

#webcam-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 20px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

#webcam-container canvas {
    width: 100%;
    height: auto;
    display: block;
}

.webcam-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.capture-btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.capture-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.4);
}

.back-btn {
    padding: 15px 30px;
    font-size: 1rem;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #d0d0d0;
}

/* 로딩 화면 */
.loader {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

#loading-text {
    color: #666;
    font-size: 1.1rem;
}

/* 미리보기 화면 */
#preview-screen h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
}

#preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.preview-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.analyze-btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.analyze-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* 결과 화면 */
.result-card {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
}

.result-emoji {
    font-size: 5rem;
    margin-bottom: 15px;
}

#result-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 10px;
}

.result-percentage {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 15px;
}

.result-description {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.result-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.trait-tag {
    background: white;
    color: #667eea;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* 상세 분석 결과 */
.result-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.detail-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: left;
}

.detail-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.strengths-section h3 {
    color: #11998e;
}

.strengths-section h3::before {
    content: '💪';
}

.weaknesses-section h3 {
    color: #e74c3c;
}

.weaknesses-section h3::before {
    content: '⚠️';
}

.advice-section h3 {
    color: #667eea;
}

.advice-section h3::before {
    content: '💡';
}

.detail-section ul {
    list-style: none;
    padding: 0;
}

.detail-section li {
    padding: 8px 0;
    padding-left: 20px;
    position: relative;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

.detail-section li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.advice-section p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* 액션 버튼 (다운로드, 공유) */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.action-btn {
    flex: 1;
    min-width: calc(50% - 5px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 10px;
    font-size: 0.9rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.action-btn .btn-icon {
    font-size: 1.1rem;
}

.download-btn {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.4);
}

.share-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.share-link-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.share-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4);
}

.action-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 전체 예측 결과 */
.all-predictions {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.all-predictions h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 15px;
}

.prediction-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.prediction-item:last-child {
    margin-bottom: 0;
}

.prediction-name {
    width: 100px;
    font-size: 0.9rem;
    color: #555;
    text-align: left;
}

.prediction-bar-container {
    flex: 1;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 10px;
}

.prediction-bar {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.prediction-percent {
    width: 50px;
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
    text-align: right;
}

.retry-btn {
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Header */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links a {
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #667eea;
}

/* Main Content */
.main-content {
    flex: 1;
    padding-top: 70px;
    padding-bottom: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Intro Text */
.intro-text {
    margin-bottom: 30px;
    color: #555;
    line-height: 1.8;
}

.intro-text p {
    margin-bottom: 5px;
}

/* Types Preview */
.types-preview {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.types-preview h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
}

.types-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.type-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: transform 0.2s ease;
}

.type-item:hover {
    transform: translateY(-2px);
    background: #f0f1f3;
}

.type-emoji {
    font-size: 1.5rem;
}

.type-name {
    font-size: 0.85rem;
    color: #555;
    font-weight: 500;
}

/* How It Works */
.how-it-works {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.how-it-works h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f1ff 100%);
    border-radius: 12px;
}

.step-number {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step p {
    color: #555;
    font-size: 0.95rem;
    margin: 0;
    text-align: left;
}

/* Footer */
.site-footer {
    background: #1a1a2e;
    color: #ccc;
    padding: 25px 20px;
    width: 100%;
}

.footer-simple {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.footer-simple p {
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: #999;
}

.footer-simple a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-simple a:hover {
    color: #667eea;
}

.footer-contact {
    color: #667eea !important;
}

/* Hint Text */
.hint-text {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #888;
}

/* Page Content Styles */
.page-content {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    margin: 20px auto;
}

.page-content h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.last-updated {
    text-align: center;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.content-section {
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.content-section:last-of-type {
    border-bottom: none;
}

.content-section h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
}

.content-section p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 10px;
}

/* Types Grid for About Page */
.types-grid-page {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.type-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f1ff 100%);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
}

.type-emoji-large {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.type-card h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 10px;
}

.type-card p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
}

/* Tech List */
.tech-list {
    list-style: none;
    padding: 0;
}

.tech-list li {
    padding: 10px 15px;
    background: #f8f9fa;
    margin-bottom: 8px;
    border-radius: 8px;
    color: #555;
}

/* Steps for How-to-Use Page */
.steps-vertical {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 20px;
}

.step-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.step-number-large {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 8px;
}

.step-content p {
    color: #555;
    margin-bottom: 8px;
}

.step-tip {
    font-size: 0.9rem;
    color: #667eea;
    background: #f0f1ff;
    padding: 10px 15px;
    border-radius: 8px;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tip-card {
    padding: 20px;
    border-radius: 12px;
}

.tip-card.good {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
}

.tip-card.bad {
    background: #ffebee;
    border: 1px solid #ffcdd2;
}

.tip-card h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.tip-card ul {
    list-style: none;
    padding: 0;
}

.tip-card li {
    padding: 8px 0;
    color: #555;
    font-size: 0.95rem;
}

/* FAQ */
.faq-list {
    margin-top: 20px;
}

.faq-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
}

.faq-item h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 10px;
}

.faq-item p {
    color: #555;
    margin: 0;
}

/* Policy List */
.policy-list {
    list-style: none;
    padding: 0;
}

.policy-list li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
    color: #555;
    line-height: 1.7;
}

.policy-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* Contact Info */
.contact-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-top: 15px;
}

.contact-info p {
    margin-bottom: 5px;
}

/* CTA Section */
.cta-section {
    text-align: center;
    margin-top: 30px;
}

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* Active nav link */
.nav-links a.active {
    color: #667eea;
    font-weight: 600;
}

/* 반응형 */
@media (max-width: 768px) {
    .nav-links {
        gap: 15px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 30px 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .option-btn {
        padding: 15px 25px;
        font-size: 1rem;
    }

    .result-emoji {
        font-size: 4rem;
    }

    #result-title {
        font-size: 1.5rem;
    }

    .nav-links {
        display: none;
    }

    .types-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding-top: 60px;
    }
}
