/* 전체 기본 세팅 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: #f8fafc;
  color: #334155;
  line-height: 1.6;
  min-height: 100vh;
}

/* 헤더 스타일 */
.header {
  background: #1a202c;
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 2rem;
}

.header-content {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 2rem;
}

.profile-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.profile-image {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.blog-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.blog-subtitle {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0;
}

/* 헤더 깃허브 링크 */
.github-links-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-shrink: 0;
  margin-right: 4rem;
}

.site-link-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: white;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  min-width: 60px;
  background: rgba(255, 255, 255, 0.1);
}

.site-link-header:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.site-link-header .site-icon {
  font-size: 1.2rem;
  text-align: center;
}

.site-link-header .site-name {
  font-weight: 600;
  font-size: 0.7rem;
  text-align: center;
}

/* 메인 레이아웃 */
.main-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
  width: 100%;
  max-width: none;
  margin: 2rem 0;
  padding: 0 2rem;
}

/* 사이드바 스타일 */
.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* 프로필 카드 */
.profile-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.profile-avatar {
  margin-bottom: 1rem;
}

.avatar-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: none;
}

.profile-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.profile-bio {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #f1f5f9;
  border-radius: 50%;
  color: #64748b;
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
}

/* 사이드바 섹션 */
.sidebar-section {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}



/* 기존 깃허브 사이트 링크 스타일 (다른 곳에서 사용할 경우) */
.site-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.site-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 12px;
  text-decoration: none;
  color: #334155;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.site-link:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
  transform: translateX(4px);
}

.site-icon {
  font-size: 1.5rem;
  width: 24px;
  text-align: center;
}

.site-info {
  display: flex;
  flex-direction: column;
}

.site-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.site-desc {
  font-size: 0.8rem;
  color: #64748b;
}

/* 사이드바 항목들 */
 .sidebar-items {
   display: flex;
   flex-direction: column;
   gap: 0.5rem;
   max-height: 600px;
   overflow-y: auto;
 }

.sidebar-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  border-radius: 12px;
  text-decoration: none;
  color: #334155;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.sidebar-item:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
  transform: translateX(4px);
}

.item-date {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 600;
  background: #f1f5f9;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  width: fit-content;
}

.item-title {
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.3;
}

/* 최근 포스트 */
.recent-posts {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recent-post {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  border-radius: 12px;
  text-decoration: none;
  color: #334155;
  transition: all 0.3s ease;
}

.recent-post:hover {
  background: #f8fafc;
  transform: translateX(4px);
}

.post-date {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

.post-title {
  font-size: 0.9rem;
  font-weight: 600;
}

/* 메인 콘텐츠 */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* 환영 섹션 */
.welcome-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 20px;
  padding: 3rem;
  text-align: center;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}

.welcome-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.welcome-text {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.welcome-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* 섹션 제목 */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1.5rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
}

/* 학습 세션 그리드 */
.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
}

.session-category {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.session-category:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.category-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f1f5f9;
}

.category-title i {
  color: #667eea;
}

.session-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: 12px;
  text-decoration: none;
  color: #334155;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.session-item:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
  transform: translateX(4px);
}

.session-date {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
  background: #f1f5f9;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.session-name {
  font-weight: 500;
  flex: 1;
  margin-left: 1rem;
}

/* 프로젝트 그리드 */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.project-date {
  font-size: 0.8rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.project-desc {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: #f1f5f9;
  color: #475569;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.project-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

 .project-link:hover {
   color: #5a67d8;
   transform: translateX(4px);
 }

/* 결과 표시 영역 */
.result-section {
   width: 100%;
   height: calc(100vh - 200px);
 }

.result-container {
   background: white;
   border-radius: 16px;
   width: 100%;
   height: 100%;
   display: flex;
   flex-direction: column;
   box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
   border: 1px solid #e2e8f0;
 }

.result-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 1.5rem 2rem;
   border-bottom: 1px solid #e2e8f0;
   background: #f8fafc;
   border-radius: 16px 16px 0 0;
 }

.result-title {
   font-size: 1.5rem;
   font-weight: 700;
   color: #1e293b;
   margin: 0;
 }

.close-btn {
   background: #ef4444;
   color: white;
   border: none;
   width: 40px;
   height: 40px;
   border-radius: 50%;
   font-size: 1.5rem;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
   transition: all 0.3s ease;
 }

.close-btn:hover {
   background: #dc2626;
   transform: scale(1.1);
 }

.result-content {
   flex: 1;
   padding: 1rem;
   overflow: hidden;
 }

#result-frame {
   width: 100%;
   height: 100%;
   border: 1px solid #e2e8f0;
   border-radius: 8px;
   background: white;
   display: flex;
   align-items: center;
   justify-content: center;
   overflow: hidden;
 }

#result-frame iframe {
   width: 100%;
   height: 100%;
   border: none;
   border-radius: 8px;
 }

.welcome-message {
   text-align: center;
   color: #64748b;
 }

.welcome-message h2 {
   font-size: 2rem;
   font-weight: 700;
   color: #1e293b;
   margin-bottom: 1rem;
 }

.welcome-message p {
   font-size: 1.1rem;
   line-height: 1.6;
 }

/* 푸터 */
.footer {
  background: #1e293b;
  color: white;
  margin-top: 4rem;
  padding: 3rem 0 1rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

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

.footer-section h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #f1f5f9;
}

.footer-section p {
  color: #94a3b8;
  line-height: 1.6;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-item {
  background: #334155;
  color: #f1f5f9;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.contact-info p {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.contact-info i {
  color: #667eea;
  width: 16px;
}

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .sidebar {
    position: static;
    order: 2;
  }
  
  .sidebar-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
  }
  
  .result-section {
    height: 60vh;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .github-links-header {
    justify-content: center;
  }
  
  .main-layout {
    padding: 0 1rem;
  }
  
  .welcome-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .sessions-grid {
    grid-template-columns: 1fr;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .welcome-card {
    padding: 2rem 1rem;
  }
  
  .welcome-title {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
}
