/* ===== CSS 변수 정의 ===== */
:root {
    --color-primary: #f59e0b;
    --color-primary-dark: #d97706;
    --color-background-dark: #1f2937;
    --color-text-light: #f9fafb;
    --color-text-muted: #9ca3af;
    --transition-duration: 0.8s;
    --header-height: 80px;
}

/* ===== 리셋 및 기본 스타일 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', 'Apple SD Gothic Neo', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== 헤더 영역 ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

.navigation {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-light);
    transition: color var(--transition-duration) ease;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link--highlight {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    border-radius: 8px;
}

.nav-link--highlight:hover {
    opacity: 0.9;
}

/* ===== 메인 히어로 섹션 ===== */
.main-content {
    min-height: 100vh;
}

.hero-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

/* 배경 슬라이드쇼 컨테이너 */
.background-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.background-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity var(--transition-duration) ease-in-out;
}

.background-slide--active {
    opacity: 1;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.3) 0%,
        rgba(15, 23, 42, 0.5) 50%,
        rgba(15, 23, 42, 0.8) 100%
    );
    z-index: 2;
    pointer-events: none;
}

/* ===== 푸터 영역 ===== */
.footer {
    background: var(--color-background-dark);
    color: var(--color-text-light);
    padding: 48px 24px 32px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 4px;
}

.footer-text {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.footer-link {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--color-primary);
}

/* ===== 챗봇 스타일 ===== */
.chatbot-floating-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
}

.chatbot-floating-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 400px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

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

.chatbot-header {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    padding: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.chatbot-header-content {
    flex: 1;
}

.chatbot-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.chatbot-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
}

.chatbot-close-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.chatbot-close-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-message {
    display: flex;
    animation: slideInMessage 0.3s ease;
}

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

.chatbot-message--bot {
    justify-content: flex-start;
}

.chatbot-message--user {
    justify-content: flex-end;
}

.chatbot-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.chatbot-message--bot .chatbot-message-content {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.chatbot-message--user .chatbot-message-content {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-message--loading .chatbot-message-content {
    background: white;
    padding: 12px 20px;
}

.chatbot-typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
}

.chatbot-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: typingAnimation 1.4s infinite;
}

.chatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

.chatbot-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.chatbot-input:focus {
    border-color: var(--color-primary);
}

.chatbot-send-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.chatbot-send-button:hover {
    transform: scale(1.05);
}

.chatbot-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

/* ===== API 키 모달 스타일 ===== */
.api-key-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.api-key-modal-content {
    background: white;
    padding: 32px;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.api-key-modal-content h3 {
    margin: 0 0 16px 0;
    font-size: 1.4rem;
    color: #333;
}

.api-key-modal-content p {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

.api-key-modal-hint {
    font-size: 0.85rem !important;
    color: #888 !important;
    margin-bottom: 20px !important;
}

.api-key-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    margin-bottom: 20px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.api-key-input:focus {
    outline: none;
    border-color: #ff7e5f;
}

.api-key-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.api-key-save-button {
    padding: 12px 28px;
    background: linear-gradient(135deg, #ff7e5f, #feb47b);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.api-key-save-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 126, 95, 0.4);
}

.api-key-cancel-button {
    padding: 12px 28px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.api-key-cancel-button:hover {
    background: #e0e0e0;
}

/* ===== 반응형 스타일 ===== */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        justify-content: center;
        gap: 16px;
    }

    .navigation {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .nav-link--highlight {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .chatbot-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chatbot-floating-button {
        bottom: 20px;
        right: 20px;
    }
}
