/*
 * Tistory Skin - DevPortfolio
 * Dark Mode & Pastel Accents
 */

:root {
  /* Color Palette - Dark Theme with Pastel Accents */
  --bg-color: #0f1115;
  --surface-color: #1a1d24;
  --surface-hover: #232730;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --border-color: #2e3440;
  
  /* Pastel Point Colors */
  --accent-primary: #93c5fd; /* Pastel Blue */
  --accent-secondary: #c4b5fd; /* Pastel Purple */
  --accent-success: #86efac; /* Pastel Green */
  --accent-warning: #fde047;
  --accent-danger: #fca5a5;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  
  /* Layout */
  --max-width: 1080px;
  --header-height: 70px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.appear {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Layout */
#wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header (Glassmorphism) */
#header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(15, 17, 21, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 20px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo a {
  color: var(--text-main);
}
.logo .cursor {
  color: var(--accent-primary);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}
#mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

.search-box {
  position: relative;
  flex-shrink: 0;
}
.search-box input {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  width: 200px;
  transition: border-color var(--transition-fast);
}
.search-box input:focus {
  outline: none;
  border-color: var(--accent-primary);
}
.search-box button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}

/* Main Content */
#main {
  flex: 1;
  width: 100%;
}

.layout-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 250px;
  gap: 40px;
  align-items: start;
}

#left-sidebar, #right-sidebar {
  width: 100%;
}

.sidebar-inner {
  position: sticky;
  top: calc(var(--header-height) + 40px);
}

/* Left Sidebar Styles */
.profile-widget {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
.profile-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 15px;
  border: 2px solid var(--border-color);
}
.profile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}
.sidebar-nav h2 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
}
.sidebar-nav ul, .sidebar-nav li {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-nav .tt_category > li > a {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
}
.sidebar-nav .category_list li a {
  display: block;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.sidebar-nav .category_list li a:hover {
  background: var(--surface-color);
  color: var(--accent-primary);
  padding-left: 20px;
}
.sidebar-nav .c_cnt {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 5px;
}

/* Right Sidebar Styles */
.ad-widget {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}
.ad-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 15px;
  letter-spacing: 1px;
}
.ad-placeholder {
  background: #232730;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  margin: 15px 0;
}

.content-container {
  width: 100%;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
}
.btn.primary {
  background: var(--accent-primary);
  color: #000;
}
.btn.primary:hover {
  background: #7bb0ea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(147, 197, 253, 0.3);
}
.btn.secondary {
  background: var(--surface-color);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn.secondary:hover {
  background: var(--surface-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

/* Portfolio Hero Section */
.portfolio-hero {
  width: 100%;
  margin: 0 0 80px 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.hero-content {
  flex: 1;
}
.hero-content .greeting {
  color: var(--accent-secondary);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  margin-bottom: 10px;
}
.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(to right, var(--text-main), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-desc {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 30px;
  max-width: 90%;
}
.hero-actions {
  display: flex;
  gap: 15px;
}

/* Code Window UI */
.hero-visual {
  flex: 1;
  max-width: 500px;
}
.code-window {
  background: #1e1e1e;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  overflow: hidden;
}
.window-header {
  background: #2d2d2d;
  padding: 12px 15px;
  display: flex;
  gap: 8px;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.code-window pre {
  margin: 0;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.5;
  color: #d4d4d4;
  overflow-x: auto;
}
.keyword { color: #569cd6; }
.variable { color: #9cdcfe; }
.property { color: #9cdcfe; }
.string { color: #ce9178; }
.method { color: #dcdcaa; }

/* Grid Sections (Projects & Recent) */
.project-grid-section, .recent-posts-section {
  width: 100%;
  margin: 0 0 80px 0;
  padding: 0;
}
.section-header h2 {
  font-size: 2rem;
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
}
.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 40px;
  height: 4px;
  background: var(--accent-primary);
  border-radius: 2px;
}

/* Project Cards */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}
.project-card {
  background: var(--surface-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.3);
  border-color: var(--text-muted);
}
.card-image {
  height: 200px;
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.project-card:hover .card-image img {
  transform: scale(1.05);
}
.card-content {
  padding: 20px;
}
.card-content .category {
  font-size: 0.8rem;
  color: var(--accent-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.card-content .title {
  font-size: 1.25rem;
  margin: 10px 0;
  color: var(--text-main);
}
.card-content .summary {
  font-size: 0.95rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Recent Posts List (Cover) */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.post-item {
  background: var(--surface-color);
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}
.post-item:hover {
  background: var(--surface-hover);
  border-left: 4px solid var(--accent-primary);
}
.post-info .category {
  font-size: 0.85rem;
  color: var(--accent-success);
}
.post-info .title {
  font-size: 1.2rem;
  margin: 5px 0;
}
.post-info .summary {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Article List / Search Results */
.list-header {
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}
.list-item {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}
.list-item a {
  display: flex;
  gap: 20px;
  align-items: center;
}
.list-content {
  flex: 1;
}
.list-content .title {
  font-size: 1.5rem;
  margin-bottom: 10px;
}
.list-content .summary {
  color: var(--text-muted);
  margin-bottom: 10px;
}
.list-content .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.list-image {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.list-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Article View (Entry Content) */
.article-header {
  margin-bottom: 40px;
  text-align: center;
}
.article-header .category {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(147, 197, 253, 0.1);
  color: var(--accent-primary);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 15px;
}
.article-header .title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.3;
}
.article-header .meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.article-header .meta span::after {
  content: '·';
  margin: 0 8px;
}
.article-header .meta span:last-child::after {
  display: none;
}

.entry-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-main);
}
.entry-content h1, .entry-content h2, .entry-content h3 {
  margin: 40px 0 20px;
  color: #fff;
  font-weight: 700;
}
.entry-content h2 { font-size: 1.8rem; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.entry-content h3 { font-size: 1.4rem; }
.entry-content p { margin-bottom: 20px; }
.entry-content a { color: var(--accent-primary); text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color 0.2s;}
.entry-content a:hover { text-decoration-color: var(--accent-primary); }

.entry-content img {
  border-radius: var(--radius-sm);
  margin: 30px auto;
}

.entry-content blockquote {
  border-left: 4px solid var(--accent-secondary);
  background: var(--surface-color);
  padding: 15px 20px;
  margin: 30px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-muted);
}

.entry-content pre {
  background: #1e1e1e !important;
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 30px 0;
  border: 1px solid var(--border-color);
}
.entry-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.entry-content p > code, .entry-content li > code {
  background: var(--surface-color);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-success);
}

/* Tags */
.tags {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tags a {
  background: var(--surface-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
.tags a:hover {
  background: var(--accent-primary);
  color: #000;
  border-color: var(--accent-primary);
}

/* Pagination */
.pagination {
  margin-top: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
.pagination a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-color);
  color: var(--text-main);
  font-weight: 600;
}
.pagination a:hover, .pagination a.selected {
  background: var(--accent-primary);
  color: #000;
}

/* Footer */
#footer {
  background: var(--surface-color);
  border-top: 1px solid var(--border-color);
  padding: 40px 20px;
  text-align: center;
  margin-top: 60px;
}
.footer-inner .copyright {
  font-weight: 600;
  margin-bottom: 10px;
}
.footer-inner .powered {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-inner a {
  color: var(--accent-primary);
}

/* Responsive */
@media (max-width: 1024px) {
  .layout-wrapper {
    grid-template-columns: 250px 1fr;
  }
  #right-sidebar {
    display: none; /* Hide right sidebar on smaller screens or move below */
  }
}
@media (max-width: 768px) {
  #mobile-menu-btn {
    display: block;
  }
  .layout-wrapper {
    display: flex;
    flex-direction: column;
    padding: 20px;
  }
  
  #left-sidebar {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    width: 250px;
    height: calc(100vh - var(--header-height));
    background: var(--bg-color);
    z-index: 99;
    transition: left 0.3s ease;
    padding: 20px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
  }
  #left-sidebar.active {
    left: 0;
  }
  .sidebar-inner {
    position: static;
  }
  #right-sidebar {
    display: block;
    width: 100%;
    margin-top: 40px;
  }

  .portfolio-hero {
    flex-direction: column;
    text-align: center;
    margin: 40px auto;
  }
  .hero-title { font-size: 2.5rem; }
  .hero-desc { margin: 0 auto 30px; }
  .hero-actions { justify-content: center; }
  .hero-visual { width: 100%; }
  
  .list-item a { flex-direction: column; align-items: flex-start; }
  .list-image { width: 100%; height: 200px; }
  
  .article-header .title { font-size: 2rem; }
  
  .search-box { display: none; }
}