/* Portfolio Site CSS (static, ported from gnuboard theme) */
:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --accent-color: #ffd700;
  --text-color: #333;
  --text-light: #666;
  --bg-light: #f8f9fa;
  --white: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
  --border-radius: 15px;
  --transition: all 0.3s ease;
}
[data-theme="dark"] {
  --primary-color: #8b9eff;
  --secondary-color: #9b6bc7;
  --text-color: #e4e4e4;
  --text-light: #b0b0b0;
  --bg-light: #1a1a2e;
  --white: #16213e;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--white);
  overflow-x: hidden;
  transition: background-color .3s, color .3s;
}
[data-theme="dark"] body { background: #0f0f1e; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 상단 헤더 */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,.95);
  border-bottom: 1px solid #eee;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
}
[data-theme="dark"] .site-header { background: rgba(22,33,62,.95); border-bottom-color: #2a2a3e; }
.site-header .brand { font-weight: 700; font-size: 18px; }
.site-header nav { display: flex; gap: 18px; align-items: center; }
.site-header nav a { color: var(--text-light); font-weight: 500; }
.site-header nav a:hover { color: var(--primary-color); }

/* 다크모드 버튼 */
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary-color); color: #fff; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; transition: var(--transition);
}
.theme-toggle:hover { transform: scale(1.08) rotate(15deg); }

/* 버튼 */
.btn {
  display: inline-block; padding: 15px 30px; border-radius: 50px;
  font-weight: 500; transition: var(--transition);
  border: 2px solid transparent; cursor: pointer; text-align: center; white-space: nowrap;
}
.btn-primary { background: var(--accent-color); color: var(--text-color); border-color: var(--accent-color); }
.btn-primary:hover { background: transparent; color: var(--accent-color); transform: translateY(-2px); }
.btn-outline { background: transparent; color: #fff; border-color: #fff; }
.btn-outline:hover { background: #fff; color: var(--text-color); transform: translateY(-2px); }

/* Hero */
.hero-section {
  min-height: 100vh; display: flex; align-items: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: #fff; position: relative; overflow: hidden;
}
.hero-content {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
  max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 2;
}
.hero-title { font-size: 3.5rem; font-weight: 700; margin-bottom: 20px; line-height: 1.2; }
.highlight { color: var(--accent-color); }
.hero-subtitle { font-size: 1.2rem; margin-bottom: 30px; opacity: .9; line-height: 1.8; color: #fff; }
.hero-buttons { display: flex; gap: 20px; }

.profile-card {
  background: rgba(255,255,255,.1); backdrop-filter: blur(10px);
  border-radius: 20px; padding: 30px; text-align: center;
  border: 1px solid rgba(255,255,255,.2);
}
.profile-image {
  width: 200px; height: 200px; margin: 0 auto 20px;
  border-radius: 50%; overflow: hidden; border: 4px solid rgba(255,255,255,.3);
}
.profile-image img { width: 100%; height: 100%; object-fit: cover; }
.profile-info h3 { font-size: 1.5rem; margin-bottom: 10px; color: #fff; }
.profile-info p { opacity: .8; font-size: 1.1rem; color: #fff; }

/* Section */
section { padding: 100px 0; position: relative; }
.section-title {
  text-align: center; font-size: 2.5rem; font-weight: 700;
  margin-bottom: 60px; color: var(--text-color); position: relative;
}
.section-title::after {
  content: ''; position: absolute; bottom: -10px; left: 50%;
  transform: translateX(-50%); width: 60px; height: 4px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}

/* About */
.about-section { background: var(--bg-light); }
.about-content { display: grid; grid-template-columns: 2fr 1fr; gap: 60px; align-items: start; }
.about-text p { font-size: 1.1rem; line-height: 1.8; margin-bottom: 40px; color: var(--text-light); }
.about-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.stat-item { text-align: center; padding: 30px 20px; background: var(--white); border-radius: var(--border-radius); box-shadow: var(--shadow); }
.stat-number { display: block; font-size: 2.5rem; font-weight: 700; color: var(--primary-color); margin-bottom: 10px; }
.stat-label { color: var(--text-light); font-size: .9rem; }

.about-skills h3 { font-size: 1.5rem; margin-bottom: 30px; color: var(--text-color); }
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.skill-item {
  display: flex; align-items: center; gap: 15px;
  padding: 20px; background: var(--white); border-radius: var(--border-radius);
  box-shadow: var(--shadow); transition: var(--transition); border: 2px solid transparent;
}
.skill-item:hover { transform: translateY(-5px) scale(1.05); border-color: var(--primary-color); }
.skill-item i { font-size: 2rem; color: var(--primary-color); width: 30px; text-align: center; }
.skill-item span { font-weight: 500; color: var(--text-color); }

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 40px; }
.project-card {
  background: var(--white); border-radius: var(--border-radius); overflow: hidden;
  box-shadow: var(--shadow); transition: var(--transition); border: 1px solid transparent;
}
.project-card:hover { transform: translateY(-10px); box-shadow: 0 25px 50px rgba(102,126,234,.25); border-color: var(--primary-color); }
.project-image { position: relative; height: 250px; overflow: hidden; background: #eee; }
.project-image img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.project-card:hover .project-image img { transform: scale(1.1); }
.project-overlay {
  position: absolute; inset: 0; background: rgba(102,126,234,.9);
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: var(--transition);
}
.project-card:hover .project-overlay { opacity: 1; }
.project-content { padding: 30px; }
.project-content h3 { font-size: 1.5rem; margin-bottom: 15px; color: var(--text-color); }
.project-content p { color: var(--text-light); margin-bottom: 20px; line-height: 1.6; white-space: pre-line; }
.project-tech { display: flex; gap: 10px; flex-wrap: wrap; }
.tech-tag { background: #f0f0f0; color: var(--text-light); padding: 5px 15px; border-radius: 20px; font-size: .9rem; font-weight: 500; }
[data-theme="dark"] .tech-tag { background: #2a2a3e; }

/* Contact */
.contact-section { background: var(--bg-light); }
.contact-content { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; }
.contact-info h3 { font-size: 1.5rem; margin-bottom: 30px; color: var(--text-color); }
.contact-item {
  display: flex; align-items: center; gap: 15px; margin-bottom: 20px; padding: 20px;
  background: var(--white); border-radius: var(--border-radius); box-shadow: var(--shadow);
}
.contact-item i { font-size: 1.2rem; color: var(--primary-color); width: 20px; text-align: center; }
.contact-item span { color: var(--text-color); font-weight: 500; }
.social-links { display: flex; gap: 15px; margin-top: 30px; }
.social-link {
  display: flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; background: var(--primary-color); color: #fff;
  border-radius: 50%; transition: var(--transition);
}
.social-link:hover { background: var(--secondary-color); transform: translateY(-3px); }

.contact-form { background: var(--white); padding: 40px; border-radius: var(--border-radius); box-shadow: var(--shadow); }
.form-group { margin-bottom: 25px; }
.form-group input, .form-group textarea {
  width: 100%; padding: 15px; border: 2px solid #e0e0e0; border-radius: 10px;
  font-size: 1rem; font-family: inherit; background: var(--white); color: var(--text-color);
  transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(102,126,234,.1); }
.form-group textarea { resize: vertical; min-height: 120px; }
[data-theme="dark"] .form-group input, [data-theme="dark"] .form-group textarea { border-color: #2a2a3e; }

/* Footer */
.portfolio-footer { background: #2c3e50; color: #fff; padding: 60px 0 20px; }
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; max-width: 1200px; margin-left: auto; margin-right: auto; padding: 0 20px; }
.footer-info h3 { font-size: 1.5rem; margin-bottom: 15px; color: var(--accent-color); }
.footer-info p, .footer-contact p { color: #bdc3c7; margin-bottom: 10px; line-height: 1.6; }
.footer-links h4, .footer-contact h4 { font-size: 1.2rem; margin-bottom: 20px; color: #ecf0f1; }
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #bdc3c7; }
.footer-links a:hover { color: var(--accent-color); }

/* Back to top */
.back-to-top {
  position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px;
  background: var(--primary-color); color: #fff; border: none; border-radius: 50%;
  cursor: pointer; display: none; align-items: center; justify-content: center;
  font-size: 1.2rem; transition: var(--transition); z-index: 1000; box-shadow: var(--shadow);
}
.back-to-top.show { display: flex; }
.back-to-top:hover { background: var(--secondary-color); transform: translateY(-3px); }

/* Responsive */
@media (max-width: 768px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; gap: 40px; padding: 40px 20px; }
  .hero-title { font-size: 2.5rem; }
  .about-content, .contact-content { grid-template-columns: 1fr; gap: 40px; }
  .about-stats { grid-template-columns: repeat(2, 1fr); }
  .skills-grid, .projects-grid { grid-template-columns: 1fr; }
  .hero-buttons { justify-content: center; flex-wrap: wrap; }
  .section-title { font-size: 2rem; }
  .footer-content { grid-template-columns: 1fr; text-align: center; }
  section { padding: 60px 0; }
  .site-header nav a:not(.theme-toggle-wrap) { display: none; }
}

/* AI 챗봇 위젯 */
.ai-chat-toggle {
  position: fixed; bottom: 30px; right: 90px; width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2); border: none; color: #fff;
  font-size: 26px; cursor: pointer; box-shadow: 0 4px 20px rgba(102,126,234,.4);
  transition: all .3s; z-index: 1000;
}
.ai-chat-toggle:hover { transform: scale(1.1); }
.ai-chat-container {
  position: fixed; bottom: 100px; right: 30px;
  width: 400px; max-width: calc(100vw - 60px); height: 600px; max-height: calc(100vh - 150px);
  background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.2);
  display: none; flex-direction: column; overflow: hidden; z-index: 999;
}
.ai-chat-container.open { display: flex; }
[data-theme="dark"] .ai-chat-container { background: #1a1a2e; }
.ai-chat-header {
  background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.ai-chat-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.ai-chat-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
.ai-chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ai-msg, .user-msg { max-width: 80%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.6; word-wrap: break-word; }
.ai-msg { background: #f3f4f6; align-self: flex-start; color: #333; }
[data-theme="dark"] .ai-msg { background: #16213e; color: #e4e4e4; }
.user-msg { background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; align-self: flex-end; }
.ai-chat-input-wrap { padding: 12px; border-top: 1px solid #eee; display: flex; gap: 8px; }
[data-theme="dark"] .ai-chat-input-wrap { border-top-color: #2a2a3e; }
.ai-chat-input-wrap input {
  flex: 1; padding: 10px 14px; border: 1px solid #e5e7eb; border-radius: 24px; font-size: 14px; outline: none;
}
[data-theme="dark"] .ai-chat-input-wrap input { background: #16213e; border-color: #2a2a3e; color: #e4e4e4; }
.ai-chat-input-wrap button {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: linear-gradient(135deg,#667eea,#764ba2); color: #fff; cursor: pointer;
}
.ai-quick { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ai-quick button {
  background: #fff; border: 1px solid #e5e7eb; padding: 8px 12px;
  border-radius: 8px; font-size: 13px; cursor: pointer; text-align: left;
}
.ai-quick button:hover { background: #667eea; color: #fff; }
.ai-typing { display: flex; gap: 4px; padding: 10px 14px; }
.ai-typing span {
  width: 8px; height: 8px; border-radius: 50%; background: #667eea;
  animation: typing 1.4s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: .7; } 30% { transform: translateY(-10px); opacity: 1; } }

/* Loading / skeleton */
.loading-msg { text-align: center; color: var(--text-light); padding: 40px; }
