/* ============================================
   황칠 정보 포털 + AI 챗봇 - 통합 스타일
   © 2002년 통합수행원 無盡藏[무진장] 전문상담연구소
   ============================================ */

/* ===== 전역 변수 ===== */
:root {
    --primary-gold: #FFD700;
    --primary-dark: #B8860B;
    --accent-green: #4a7c59;
    --accent-light: #6b9d7a;
    --bg-light: #f8f9fa;
    --bg-dark: #1a3a1a;
    --text-dark: #333;
    --text-light: #666;
    --text-white: #fff;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

/* ===== 초기화 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background: #fff;
    overflow-x: hidden;
}

/* ===== 컨테이너 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== 구글 번역 위젯 ===== */
.translate-widget {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

#google_translate_element select {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--text-dark);
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

#google_translate_element select:hover {
    border-color: var(--accent-green);
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Noto Serif KR', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-gold);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.dharma-wheel {
    animation: spin 8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.brand-text {
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--accent-green);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    cursor: pointer;
}

.nav-menu a:hover {
    color: var(--accent-green);
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #1a3a1a 0%, #2d5a2d 50%, #4a7c59 100%);
    color: var(--text-white);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><path d="M0,300 Q300,100 600,300 T1200,300" fill="none" stroke="rgba(255,215,0,0.1)" stroke-width="2"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 96px;
    font-weight: 900;
    color: var(--primary-gold);
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    margin-bottom: 20px;
    animation: fadeInUp 1s ease;
}

.hero-subtitle {
    font-size: 24px;
    font-style: italic;
    color: rgba(255,255,255,0.9);
    margin-bottom: 30px;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero-description {
    font-size: 18px;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto 40px;
    color: rgba(255,255,255,0.85);
    animation: fadeInUp 1s ease 0.4s both;
}

.cta-button {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    background: var(--primary-gold);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255,215,0,0.3);
    animation: fadeInUp 1s ease 0.6s both;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,215,0,0.5);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.7);
    animation: bounce 2s infinite;
}

.scroll-line {
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,215,0,0.7), transparent);
}

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

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

/* ===== Sections ===== */
.section {
    padding: 80px 0;
}

.section-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 42px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.section-title.light {
    color: var(--text-white);
}

.section-subtitle {
    text-align: center;
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 50px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.bg-light {
    background: var(--bg-light);
}

.bg-dark {
    background: var(--bg-dark);
    color: var(--text-white);
}

/* ===== Intro Cards ===== */
.intro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.intro-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.intro-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.intro-card h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--accent-green);
}

.intro-card p {
    color: var(--text-light);
    line-height: 1.8;
}

/* ===== Timeline ===== */
.timeline {
    max-width: 900px;
    margin: 50px auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-gold);
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    margin-bottom: 50px;
    position: relative;
}

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-year {
    flex: 0 0 150px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-gold);
    padding: 10px;
}

.timeline-content {
    flex: 1;
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin: 0 30px;
}

.timeline-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--accent-green);
}

.timeline-content p {
    color: var(--text-light);
    line-height: 1.8;
}

/* ===== Research Grid ===== */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.research-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.research-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.research-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.research-card h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--accent-green);
}

.research-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
    margin-right: 5px;
    margin-bottom: 15px;
}

.research-badge.in-vitro {
    background: #e3f2fd;
    color: #1976d2;
}

.research-badge.animal {
    background: #fff3e0;
    color: #f57c00;
}

.research-badge.human {
    background: #e8f5e9;
    color: #388e3c;
}

.research-badge.material {
    background: #f3e5f5;
    color: #7b1fa2;
}

.research-card p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 10px;
}

/* ===== Usage Grid ===== */
.usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.usage-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.usage-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--accent-green);
}

.usage-card p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 10px;
}

.usage-card strong {
    color: var(--text-dark);
}

/* ===== Safety Cards ===== */
.safety-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.safety-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    border-left: 5px solid;
}

.safety-card.safe {
    border-left-color: #4caf50;
}

.safety-card.warning {
    border-left-color: #ff9800;
}

.safety-card.info {
    border-left-color: #2196f3;
}

.safety-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

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

.safety-card li {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.safety-card li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-green);
    font-weight: 700;
}

/* ===== Contact Grid ===== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.contact-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.contact-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-gold);
}

.contact-card p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    margin-bottom: 10px;
}

.contact-card a {
    color: var(--primary-gold);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-card a:hover {
    color: white;
}

.contact-note {
    text-align: center;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.6;
}

/* ===== Footer ===== */
.footer {
    background: #0d1f0d;
    color: var(--text-white);
    padding: 50px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-brand h3 {
    font-family: 'Noto Serif KR', serif;
    font-size: 24px;
    color: var(--primary-gold);
    margin-bottom: 15px;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    margin-bottom: 10px;
}

.footer-info p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    margin-bottom: 10px;
}

.footer-info strong {
    color: var(--primary-gold);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.footer-bottom p {
    margin-bottom: 5px;
}

/* ===== Chatbot Button ===== */
.chatbot-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-gold) 0%, #FFA500 100%);
    border-radius: 50%;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    z-index: 998;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.7);
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 4px 30px rgba(255, 215, 0, 0.8); }
}

/* ===== Chatbot Container ===== */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 999;
}

.chatbot-container.active {
    display: flex;
}

.chatbot-header {
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-light) 100%);
    color: white;
    padding: 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    font-size: 32px;
}

.chatbot-title {
    font-size: 18px;
    font-weight: 600;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-header-right {
    display: flex;
    gap: 8px;
}

.chatbot-btn {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatbot-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== Consult Buttons ===== */
.consult-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    max-height: 150px;
    overflow-y: auto;
}

.consult-btn {
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 500;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.consult-btn:hover {
    background: var(--accent-green);
    color: white;
    border-color: var(--accent-green);
}

/* ===== Chat Messages ===== */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

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

.chat-message.user-message {
    flex-direction: row-reverse;
}

.chat-message.bot-message {
    flex-direction: row;
}

.bot-avatar {
    font-size: 28px;
    flex-shrink: 0;
}

.message-bubble {
    max-width: 70%;
}

.message-content {
    padding: 12px 16px;
    border-radius: 15px;
    line-height: 1.6;
}

.user-message .message-content {
    background: var(--accent-green);
    color: white;
    border-bottom-right-radius: 5px;
}

.bot-message .message-content {
    background: #f0f0f0;
    color: var(--text-dark);
    border-bottom-left-radius: 5px;
}

.message-time {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 5px;
    text-align: right;
}

.user-message .message-time {
    text-align: left;
}

/* ===== Chat Input ===== */
.chat-input {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 20px 20px;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    outline: none;
    font-size: 14px;
}

.chat-input button {
    width: 40px;
    height: 40px;
    margin-left: 10px;
    background: var(--accent-green);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-input button:hover {
    background: var(--accent-light);
    transform: scale(1.1);
}

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent-green);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 997;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent-light);
    transform: translateY(-3px);
}

/* ===== 모바일 반응형 ===== */
@media (max-width: 768px) {
    /* 번역 위젯 */
    .translate-widget {
        top: 10px;
        right: 10px;
        padding: 6px 8px;
    }
    
    #google_translate_element select {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    /* Navigation */
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        max-width: 300px;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        padding: 30px;
        gap: 20px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Hero */
    .hero-title {
        font-size: 64px;
    }
    
    .hero-subtitle {
        font-size: 20px;
    }
    
    .hero-description {
        font-size: 16px;
    }
    
    /* Sections */
    .section {
        padding: 50px 0;
    }
    
    .section-title {
        font-size: 32px;
    }
    
    /* Timeline */
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        flex-direction: column !important;
        padding-left: 60px;
    }
    
    .timeline-year {
        position: absolute;
        left: 0;
        top: 0;
        flex: none;
    }
    
    .timeline-content {
        margin: 0;
    }
    
    /* Grids */
    .intro-grid,
    .research-grid,
    .usage-grid,
    .safety-content,
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    /* Chatbot */
    .chatbot-container {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 80px;
    }
    
    .consult-buttons {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .chatbot-button {
        right: 20px;
        bottom: 20px;
        width: 55px;
        height: 55px;
    }
    
    .back-to-top {
        right: 20px;
        bottom: 85px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 48px;
    }
    
    .consult-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}