/* Personal Code Blog Styles */

:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
  --text-color: #333;
  --light-bg: #f8f9fa;
  --dark-bg: #343a40;
  --code-bg: #f5f5f5;
  --border-color: #e1e4e8;
}

/* Dark mode variables */
body.dark-mode {
  --text-color: #f8f9fa;
  --light-bg: #1a1a1a;
  --dark-bg: #121212;
  --code-bg: #2d2d2d;
  --border-color: #444;
  background-color: var(--light-bg);
  color: var(--text-color);
}

body.dark-mode header, 
body.dark-mode footer {
  background-color: var(--dark-bg);
}

body.dark-mode .article-card {
  background-color: #222;
  border-color: var(--border-color);
}

body.dark-mode .about-section {
  background-color: #222;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-bg);
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background-color: var(--dark-bg);
  color: white;
  padding: 2rem 0;
  margin-bottom: 2rem;
  position: relative;
  transition: background-color 0.3s;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo h1 {
  font-size: 2rem;
  font-weight: bold;
  margin: 0;
}

.logo span {
  color: var(--primary-color);
}

nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 1.5rem;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

nav ul li a:hover {
  color: var(--primary-color);
}

nav ul li.active a {
  color: var(--primary-color);
  font-weight: 600;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

#dark-mode-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  margin-left: 1rem;
  padding: 0.5rem;
  transition: color 0.3s;
}

#dark-mode-toggle:hover {
  color: var(--primary-color);
}

body:not(.dark-mode) #dark-mode-toggle .fa-sun,
body.dark-mode #dark-mode-toggle .fa-moon {
  display: none;
}

.hero {
  background-color: var(--primary-color);
  color: white;
  padding: 4rem 0;
  margin-bottom: 2rem;
  text-align: center;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 700px;
  margin: 0 auto 1.5rem;
}

.search-form {
  display: flex;
  max-width: 500px;
  margin: 2rem auto 0;
}

.search-form input {
  flex: 1;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 4px 0 0 4px;
  font-size: 1rem;
}

.search-form button {
  padding: 0.8rem 1.2rem;
  background-color: var(--secondary-color);
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  transition: background-color 0.3s;
}

.search-form button:hover {
  background-color: #1a252f;
}

.btn {
  display: inline-block;
  background-color: var(--secondary-color);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: #1a252f;
}

.articles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.article-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  background-color: white;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.article-image {
  height: 200px;
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.article-card:hover .article-image img {
  transform: scale(1.05);
}

.article-content {
  padding: 1.5rem;
}

.article-content h3 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
}

.article-content p {
  margin-bottom: 1rem;
  color: #666;
}

.tag {
  display: inline-block;
  background-color: var(--light-bg);
  color: var(--dark-bg);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.read-more {
  display: inline-block;
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: none;
}

.read-more:hover {
  text-decoration: underline;
}

.more-articles-container {
  text-align: center;
  margin-bottom: 3rem;
}

.about-section {
  background-color: white;
  padding: 3rem 0;
  margin-bottom: 3rem;
  transition: background-color 0.3s;
}

.about-content {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.about-image {
  flex: 1;
}

.about-image img {
  width: 100%;
  border-radius: 8px;
}

.about-text {
  flex: 2;
}

.code-snippet {
  background-color: var(--code-bg);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  transition: background-color 0.3s;
}

pre {
  font-family: 'Consolas', 'Monaco', monospace;
  line-height: 1.4;
}

code {
  position: relative;
}

pre code .line-number {
  display: inline-block;
  width: 1.5em;
  color: #999;
  text-align: right;
  margin-right: 1em;
  user-select: none;
}

footer {
  background-color: var(--dark-bg);
  color: white;
  padding: 3rem 0;
  text-align: center;
  transition: background-color 0.3s;
}

.footer-content {
  margin-bottom: 2rem;
}

.social-links {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.social-links a {
  display: inline-block;
  color: white;
  margin: 0 1rem;
  text-decoration: none;
  transition: color 0.3s;
}

.social-links a:hover {
  color: var(--primary-color);
}

.copyright {
  font-size: 0.9rem;
  color: #aaa;
}

.icp-registration {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.icp-registration a {
  color: #aaa;
  text-decoration: none;
}

.icp-registration a:hover {
  text-decoration: underline;
}

.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.3s, transform 0.3s;
  opacity: 0;
  transform: translateY(20px);
  z-index: 100;
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: #2980b9;
}

@media (max-width: 768px) {
  header .container {
    flex-wrap: wrap;
  }
  
  .mobile-menu-toggle {
    display: block;
    order: 3;
  }
  
  #dark-mode-toggle {
    order: 4;
  }
  
  nav {
    flex-basis: 100%;
    order: 5;
    margin-top: 1rem;
    display: none;
  }
  
  nav.show {
    display: block;
  }
  
  nav ul {
    flex-direction: column;
    text-align: center;
  }
  
  nav ul li {
    margin: 0.5rem 0;
  }
  
  .about-content {
    flex-direction: column;
  }
  
  .articles {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .article-nav {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
} 