/* Blog-specific styles - Mobile Responsive with White Background */

/* Blog Header */
.blog-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
}

.blog-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.blog-header-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

.header-text h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
  font-weight: bold;
}

.header-text p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin-bottom: 2rem;
  opacity: 0.9;
  line-height: 1.6;
}

.blog-search {
  display: flex;
  background: var(--white);
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 100%;
}

.blog-search input {
  flex: 1;
  padding: 15px 25px;
  border: none;
  font-size: 1rem;
  outline: none;
  color: var(--text-color);
}

.blog-search button {
  background: var(--primary-color);
  border: none;
  padding: 15px 25px;
  color: var(--white);
  cursor: pointer;
  transition: background 0.3s ease;
  min-width: 60px;
}

.blog-search button:hover {
  background: var(--primary-dark);
}

/* Header Visual */
.header-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.blog-graphic {
  position: relative;
  width: 300px;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.knowledge-icon {
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--white);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  animation: pulse 3s ease-in-out infinite;
}

.floating-topics {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.topic {
  position: absolute;
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  animation: float 4s ease-in-out infinite;
}

.topic:nth-child(1) {
  top: 10%;
  left: 20%;
  animation-delay: 0s;
}

.topic:nth-child(2) {
  top: 20%;
  right: 10%;
  animation-delay: 0.8s;
}

.topic:nth-child(3) {
  bottom: 30%;
  left: 10%;
  animation-delay: 1.6s;
}

.topic:nth-child(4) {
  bottom: 20%;
  right: 20%;
  animation-delay: 2.4s;
}

.topic:nth-child(5) {
  top: 50%;
  left: 5%;
  animation-delay: 3.2s;
}

/* Blog Categories */
.blog-categories {
  background: var(--white);
  padding: 30px 0;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 70px;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.category-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0 20px;
}

.category-btn {
  background: transparent;
  border: 2px solid #ddd;
  padding: 12px 20px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
  justify-content: center;
  font-size: 0.9rem;
}

.category-btn:hover,
.category-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(240, 35, 3, 0.3);
}

.category-btn i {
  font-size: 0.9rem;
}

/* Featured Posts */
.featured-posts {
  background: var(--white);
  padding: 60px 0;
  border-bottom: 1px solid #f0f0f0;
}

.featured-posts h2 {
  text-align: center;
  font-size: clamp(2rem, 4vw, 2.5rem);
  margin-bottom: 3rem;
  color: var(--secondary-color);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  padding: 0 20px;
}

.featured-post {
  background: var(--white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  padding: 2rem;
  align-items: flex-start;
  gap: 1.5rem;
  border: 1px solid #f0f0f0;
}

.featured-post:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.featured-post-image {
  flex-shrink: 0;
}

.post-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--white);
}

.post-icon.security {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.post-icon.performance {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

.post-icon.tutorials {
  background: linear-gradient(135deg, #007bff, #6610f2);
}

.post-icon.troubleshooting {
  background: linear-gradient(135deg, #fd7e14, #ffc107);
}

.featured-post-content {
  flex: 1;
}

.post-meta-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-category {
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--white);
}

.post-category.security {
  background: #28a745;
}

.post-category.performance {
  background: var(--primary-color);
}

.post-category.tutorials {
  background: #007bff;
}

.post-category.troubleshooting {
  background: #fd7e14;
}

.featured-post h3 {
  margin: 0 0 1rem 0;
  color: var(--secondary-color);
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  line-height: 1.4;
}

.featured-post p {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.6;
  font-size: 0.95rem;
}

.post-meta-bottom {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
  flex-wrap: wrap;
}

.post-meta-bottom span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.post-meta-bottom i {
  color: var(--primary-color);
}

/* Blog Layout */
.blog-main {
  padding: 60px 0;
  background: var(--white);
}

.blog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding: 0 20px;
}

/* Blog Posts */
.blog-posts {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.blog-post {
  background: var(--white);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
  border: 1px solid #f0f0f0;
  display: flex;
  gap: 2rem;
  padding: 2rem;
  margin-bottom: 2rem;
}

.blog-post:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.post-image {
  flex-shrink: 0;
  width: 120px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1rem;
}

.post-content-wrapper {
  flex: 1;
}

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #f0f0f0;
}

.post-category {
  background: var(--primary-color);
  color: var(--white);
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-bottom: 1rem;
}

.post-header h2 {
  color: var(--secondary-color);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.3;
  margin-bottom: 1rem;
}

.post-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
  flex-wrap: wrap;
}

.post-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.post-meta i {
  color: var(--primary-color);
}

/* Post Content */
.post-content {
  line-height: 1.8;
  color: var(--text-color);
}

.post-content h3 {
  color: var(--secondary-color);
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

.post-content h4 {
  color: var(--secondary-color);
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin: 1.5rem 0 0.8rem;
}

.post-content p {
  margin-bottom: 1.2rem;
  text-align: justify;
}

.post-content ul,
.post-content ol {
  margin: 1rem 0 1.5rem 2rem;
}

.post-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.post-content strong {
  color: var(--secondary-color);
  font-weight: 600;
}

/* Code Blocks */
.code-block {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin: 1.5rem 0;
  overflow: hidden;
}

.code-block h4 {
  background: var(--secondary-color);
  color: var(--white);
  padding: 0.8rem 1.2rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.code-block pre {
  margin: 0;
  padding: 1.2rem;
  overflow-x: auto;
  background: #f8f9fa;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.code-block code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: #333;
}

/* Info Boxes */
.info-box,
.tip-box {
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
  border-left: 4px solid;
}

.info-box {
  background: #e3f2fd;
  border-left-color: #2196f3;
}

.info-box h4 {
  color: #1976d2;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tip-box {
  background: #e8f5e8;
  border-left-color: #28a745;
}

.tip-box h4 {
  color: #28a745;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.warning-box {
  background: #fff3cd;
  border-left-color: #ffc107;
}

.warning-box h4 {
  color: #856404;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Post Footer */
.post-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  background: #f0f0f0;
  color: var(--text-color);
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.tag:hover {
  background: var(--primary-color);
  color: var(--white);
}

.post-share {
  display: flex;
  gap: 0.5rem;
}

.share-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #f0f0f0;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-btn:hover {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
}

/* Sidebar */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-widget {
  background: var(--white);
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0f0f0;
}

.sidebar-widget h3 {
  color: var(--secondary-color);
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--primary-color);
}

/* Popular Posts Widget */
.popular-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.popular-post {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: var(--bg-light);
  transition: background 0.3s ease;
  cursor: pointer;
}

.popular-post:hover {
  background: #e9ecef;
}

.popular-post-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.popular-post-content {
  flex: 1;
}

.popular-post h4 {
  color: var(--secondary-color);
  font-size: 1rem;
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.popular-post .views {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Category List Widget */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-color);
  background: var(--bg-light);
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
}

.category-item:hover {
  background: var(--primary-color);
  color: var(--white);
  transform: translateX(5px);
}

.category-item i {
  width: 20px;
  text-align: center;
}

.category-item .count {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-color);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.category-item:hover .count {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

/* Newsletter Widget */
.newsletter-widget {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--white);
}

.newsletter-widget h3 {
  color: var(--white);
  border-bottom-color: rgba(255, 255, 255, 0.3);
}

.newsletter-widget p {
  color: rgba(255, 255, 255, 0.9);
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.newsletter-form input {
  padding: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.newsletter-form input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.newsletter-form input:focus {
  border-color: rgba(255, 255, 255, 0.6);
}

.newsletter-form .btn {
  padding: 12px;
  font-size: 1rem;
  background: var(--white);
  color: var(--primary-color);
}

.newsletter-form .btn:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* Breadcrumb */
.breadcrumb {
  background: var(--bg-light);
  padding: 1rem 0;
  margin-top: 70px;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  margin: 0;
  padding: 0 20px;
}

.breadcrumb li:not(:last-child)::after {
  content: ">";
  margin-left: 0.5rem;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Mobile Responsive Design */
@media (max-width: 1024px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .blog-header-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .featured-post {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .featured-post .post-image {
    margin-right: 0;
    margin-bottom: 1rem;
  }
}

@media (max-width: 768px) {
  .blog-header {
    padding: 100px 0 60px;
  }

  .header-text h1 {
    font-size: 2.5rem;
  }

  .blog-search {
    flex-direction: column;
    border-radius: 15px;
    max-width: 100%;
  }

  .blog-search input,
  .blog-search button {
    border-radius: 0;
    padding: 12px 20px;
  }

  .blog-search input {
    border-radius: 15px 15px 0 0;
  }

  .blog-search button {
    border-radius: 0 0 15px 15px;
  }

  .category-filters {
    gap: 0.5rem;
    padding: 0 15px;
  }

  .category-btn {
    min-width: auto;
    padding: 10px 16px;
    font-size: 0.8rem;
  }

  .category-btn span {
    display: none;
  }

  .featured-grid {
    grid-template-columns: 1fr;
    padding: 0 15px;
  }

  .featured-post {
    padding: 1.5rem;
  }

  .blog-layout {
    padding: 0 15px;
  }

  .blog-post {
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
  }

  .post-image {
    width: 100%;
    justify-content: center;
    padding-top: 0;
  }

  .post-header h2 {
    font-size: 1.5rem;
  }

  .post-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .post-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .code-block pre {
    font-size: 0.8rem;
    padding: 1rem;
  }

  .sidebar-widget {
    padding: 1.5rem;
  }

  .breadcrumb ol {
    padding: 0 15px;
  }
}

@media (max-width: 480px) {
  .blog-header {
    padding: 90px 0 50px;
  }

  .header-text h1 {
    font-size: 2rem;
  }

  .blog-graphic {
    width: 250px;
    height: 250px;
  }

  .knowledge-icon {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
  }

  .topic {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  .category-btn {
    padding: 8px 12px;
    min-width: 80px;
  }

  .featured-posts {
    padding: 40px 0;
  }

  .blog-main {
    padding: 40px 0;
  }

  .featured-grid {
    padding: 0 10px;
  }

  .blog-layout {
    padding: 0 10px;
  }

  .blog-post {
    padding: 1.2rem;
  }

  .post-content h3 {
    font-size: 1.3rem;
  }

  .sidebar-widget {
    padding: 1.2rem;
  }

  .post-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .breadcrumb ol {
    padding: 0 10px;
  }
}

/* Extra Small Devices */
@media (max-width: 360px) {
  .blog-header {
    padding: 80px 0 40px;
  }

  .header-text h1 {
    font-size: 1.8rem;
  }

  .blog-graphic {
    width: 200px;
    height: 200px;
  }

  .knowledge-icon {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }

  .category-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .blog-post {
    padding: 1rem;
  }

  .featured-post {
    padding: 1.2rem;
  }

  .sidebar-widget {
    padding: 1rem;
  }
}

/* Animations */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0);
  }
}

/* Print Styles */
@media print {
  .navbar,
  .blog-header,
  .blog-categories,
  .blog-sidebar,
  .footer,
  .post-share {
    display: none;
  }

  .blog-post {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }

  .code-block {
    page-break-inside: avoid;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .knowledge-icon,
  .topic,
  .category-btn,
  .featured-post,
  .blog-post,
  .share-btn {
    animation: none !important;
    transition: none !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .blog-post,
  .featured-post,
  .sidebar-widget {
    border: 2px solid #000;
  }

  .category-btn {
    border: 2px solid #000;
  }
}
