// Blog Single Page - Enhanced Enterprise Layout
// =======================================================

.blog-single-section {
  padding-top: 140px;
  background: #f8f9fa;
  
  @media (max-width: 991px) {
    padding-top: 120px;
  }

  // Loading and Error States
  .loading-state,
  .error-state {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    .spinner-border {
      width: 3rem;
      height: 3rem;
    }
  }

  // Article Styling
  .blog-single-article {
    background: #ffffff;
    border-top: 4px solid var(--color-primary);
    
    // Article Header
    .article-header {
      padding: 50px 80px 40px;
      border-bottom: 1px solid #e9ecef;
      
      @media (max-width: 1199px) {
        padding: 40px 60px 30px;
      }
      
      @media (max-width: 991px) {
        padding: 30px 40px 25px;
      }
      
      @media (max-width: 767px) {
        padding: 25px 20px 20px;
      }

      // Top Meta Bar
      .article-top-meta {
        .left-meta,
        .right-meta {
          @media (max-width: 767px) {
            width: 100%;
            justify-content: flex-start;
          }
        }

        .category-badge {
          display: inline-flex;
          align-items: center;
          padding: 8px 18px;
          background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
          color: #ffffff;
          border-radius: 6px;
          text-decoration: none;
          font-size: 14px;
          font-weight: 600;
          transition: all 0.3s ease;
          
          &:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
          }
        }

        .meta-item {
          font-size: 14px;
          color: #6c757d;
          font-weight: 500;
          
          i {
            color: var(--color-primary);
            font-size: 14px;
          }
        }
      }

      // Title
      .article-title {
        font-size: 52px;
        line-height: 1.2;
        color: var(--color-secondary);
        margin: 30px 0 0;
        font-weight: 700;
        
        @media (max-width: 1199px) {
          font-size: 44px;
        }
        
        @media (max-width: 991px) {
          font-size: 36px;
          margin: 25px 0 0;
        }
        
        @media (max-width: 767px) {
          font-size: 28px;
          margin: 20px 0 0;
        }
      }

      // Bottom Meta Bar
      .article-bottom-meta {
        border-top: 1px solid #e9ecef;
        
        @media (max-width: 767px) {
          flex-direction: column;
          align-items: flex-start !important;
          gap: 16px;
        }

        .author-meta {
          .author-avatar {
            .avatar-placeholder {
              width: 48px;
              height: 48px;
              border-radius: 50%;
              background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
              display: flex;
              align-items: center;
              justify-content: center;
              color: #ffffff;
              font-size: 20px;
            }
          }

          .author-info {
            .author-label {
              font-size: 12px;
              color: #6c757d;
              text-transform: none;
              letter-spacing: 0.5px;
              margin-bottom: 4px;
            }

            .author-name {
              font-size: 16px;
              font-weight: 600;
              color: var(--color-secondary);
            }
          }
        }

        .article-tags {
          @media (max-width: 767px) {
            width: 100%;
          }

          .tag-badge {
            padding: 6px 14px;
            background: #f0f0f0;
            color: var(--color-secondary);
            border-radius: 20px;
            text-decoration: none;
            font-size: 13px;
            font-weight: 600;
            transition: all 0.3s ease;
            
            &:hover {
              background: var(--color-primary);
              color: #ffffff;
              transform: translateY(-2px);
            }
          }
        }
      }
    }

    // Featured Image
    .article-featured-image {
      position: relative;
      overflow: hidden;
      
      .image-wrapper {
        position: relative;
        overflow: hidden;
        
        &::after {
          content: "";
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          background: linear-gradient(to bottom, transparent 70%, rgba(0, 0, 0, 0.05) 100%);
          pointer-events: none;
        }
        
        img {
          width: 100%;
          height: auto;
          display: block;
          transition: transform 0.6s ease;
        }
        
        &:hover img {
          transform: scale(1.03);
        }
      }
    }

    // Article Body
    .article-body {
      padding: 60px 80px;
      
      @media (max-width: 1199px) {
        padding: 50px 60px;
      }
      
      @media (max-width: 991px) {
        padding: 40px 40px;
      }
      
      @media (max-width: 767px) {
        padding: 30px 20px;
      }
    }

    // Excerpt
    .article-excerpt {
      padding: 35px 45px;
      background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
      border-left: 5px solid var(--color-primary);
      margin-bottom: 50px;
      
      @media (max-width: 767px) {
        padding: 25px 20px;
        margin-bottom: 35px;
      }
      
      .lead {
        font-size: 22px;
        line-height: 1.6;
        color: var(--color-secondary);
        margin: 0;
        font-weight: 500;
        
        @media (max-width: 767px) {
          font-size: 18px;
        }
      }
    }

    // Article Content
    .article-content {
      font-size: 18px;
      line-height: 1.8;
      color: #333333;
      
      @media (max-width: 767px) {
        font-size: 16px;
      }

      > *:first-child {
        margin-top: 0;
      }

      > *:last-child {
        margin-bottom: 0;
      }

      h2 {
        font-size: 36px;
        font-weight: 700;
        color: var(--color-secondary);
        margin-top: 60px;
        margin-bottom: 25px;
        padding-bottom: 15px;
        border-bottom: 3px solid var(--color-primary);
        
        @media (max-width: 767px) {
          font-size: 28px;
          margin-top: 40px;
          margin-bottom: 20px;
        }
      }

      h3 {
        font-size: 28px;
        font-weight: 600;
        color: var(--color-secondary);
        margin-top: 45px;
        margin-bottom: 20px;
        
        @media (max-width: 767px) {
          font-size: 24px;
          margin-top: 35px;
        }
      }

      h4 {
        font-size: 22px;
        font-weight: 600;
        color: var(--color-secondary);
        margin-top: 35px;
        margin-bottom: 16px;
        
        @media (max-width: 767px) {
          font-size: 20px;
        }
      }

      p {
        margin-bottom: 22px;
        color: #333333;
      }

      ul, ol {
        margin: 28px 0;
        padding-left: 35px;
        
        li {
          margin-bottom: 14px;
          color: #333333;
          
          &::marker {
            color: var(--color-primary);
            font-weight: 600;
          }
        }
      }

      blockquote {
        margin: 40px 0;
        padding: 30px 40px;
        background: #f8f9fa;
        border-left: 6px solid var(--color-primary);
        font-style: italic;
        color: var(--color-secondary);
        font-size: 19px;
        
        @media (max-width: 767px) {
          padding: 25px 20px;
          margin: 30px 0;
          font-size: 17px;
        }
        
        p:last-child {
          margin-bottom: 0;
        }
      }

      code {
        padding: 4px 10px;
        background: #f5f5f5;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        font-family: 'Courier New', monospace;
        font-size: 15px;
        color: #d63384;
      }

      pre {
        margin: 30px 0;
        padding: 25px;
        background: #1e1e1e;
        border-radius: 8px;
        overflow-x: auto;
        
        code {
          padding: 0;
          background: transparent;
          border: none;
          color: #f8f8f2;
          font-size: 15px;
        }
      }

      img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        margin: 40px 0;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
      }

      a {
        color: var(--color-primary);
        text-decoration: underline;
        font-weight: 500;
        transition: color 0.3s ease;
        
        &:hover {
          color: var(--color-secondary);
        }
      }

      table {
        width: 100%;
        margin: 30px 0;
        border-collapse: collapse;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        overflow: hidden;
        
        thead {
          background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
          color: #ffffff;
          
          th {
            padding: 18px;
            text-align: left;
            font-weight: 600;
          }
        }
        
        tbody {
          tr {
            border-bottom: 1px solid #e0e0e0;
            
            &:nth-child(even) {
              background: #f8f9fa;
            }
            
            &:hover {
              background: #e9ecef;
            }
            
            td {
              padding: 16px 18px;
            }
          }
        }
      }
    }

    // Article Footer
    .article-footer {
      background: #f8f9fa;
      padding: 50px 80px 60px;
      
      @media (max-width: 1199px) {
        padding: 40px 60px 50px;
      }
      
      @media (max-width: 991px) {
        padding: 35px 40px 45px;
      }
      
      @media (max-width: 767px) {
        padding: 30px 20px 35px;
      }
    }

    // Share Section
    .article-share {
      margin-bottom: 50px;
      
      @media (max-width: 767px) {
        margin-bottom: 40px;
      }

      .share-container {
        .share-title {
          font-size: 20px;
          color: var(--color-secondary);
          font-weight: 600;
          margin-bottom: 25px;
        }

        .social-share {
          display: flex;
          gap: 15px;
          flex-wrap: wrap;
          
          .share-btn {
            min-width: 140px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            border-radius: 8px;
            text-decoration: none;
            font-size: 15px;
            font-weight: 600;
            transition: all 0.3s ease;
            border: 2px solid transparent;
            cursor: pointer;
            
            i {
              font-size: 18px;
            }
            
            span {
              font-size: 14px;
            }
            
            &.share-linkedin {
              background: #0077b5;
              color: #ffffff;
              
              &:hover {
                background: #ffffff;
                color: #0077b5;
                border-color: #0077b5;
                transform: translateY(-3px);
                box-shadow: 0 6px 20px rgba(0, 119, 181, 0.3);
              }
            }
            
            &.share-twitter {
              background: #1da1f2;
              color: #ffffff;
              
              &:hover {
                background: #ffffff;
                color: #1da1f2;
                border-color: #1da1f2;
                transform: translateY(-3px);
                box-shadow: 0 6px 20px rgba(29, 161, 242, 0.3);
              }
            }
            
            &.share-facebook {
              background: #1877f2;
              color: #ffffff;
              
              &:hover {
                background: #ffffff;
                color: #1877f2;
                border-color: #1877f2;
                transform: translateY(-3px);
                box-shadow: 0 6px 20px rgba(24, 119, 242, 0.3);
              }
            }
            
            &.share-copy {
              background: #6c757d;
              color: #ffffff;
              
              &:hover {
                background: #ffffff;
                color: #6c757d;
                border-color: #6c757d;
                transform: translateY(-3px);
                box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
              }
            }
          }
        }
      }
    }

    // Author Bio Section
    .author-bio-section {
      margin-bottom: 45px;
      
      @media (max-width: 767px) {
        margin-bottom: 35px;
      }

      .author-bio-card {
        display: flex;
        gap: 30px;
        padding: 35px;
        background: #ffffff;
        border-radius: 12px;
        border: 2px solid #e9ecef;
        transition: all 0.3s ease;
        
        @media (max-width: 767px) {
          flex-direction: column;
          gap: 20px;
          padding: 25px;
          text-align: center;
        }
        
        &:hover {
          border-color: var(--color-primary);
          box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        }

        .author-avatar-container {
          flex-shrink: 0;
          
          @media (max-width: 767px) {
            display: flex;
            justify-content: center;
          }

          .author-avatar-large {
            width: 90px;
            height: 90px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
            display: flex;
            align-items: center;
            justify-content: center;
            color: #ffffff;
            font-size: 36px;
          }
        }

        .author-bio-content {
          flex: 1;

          .bio-label {
            font-size: 13px;
            color: #6c757d;
            text-transform: none;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
            font-weight: 600;
          }

          .author-name {
            font-size: 22px;
            color: var(--color-secondary);
            font-weight: 600;
            margin-bottom: 12px;
          }

          .author-bio-text {
            font-size: 16px;
            color: #6c757d;
            line-height: 1.7;
            margin: 0;
          }
        }
      }
    }

    // Navigation
    .article-navigation {
      text-align: center;

      .btn-back-insights {
        display: inline-flex;
        align-items: center;
        padding: 14px 35px;
        font-size: 16px;
        font-weight: 600;
        border: 2px solid var(--color-primary);
        color: var(--color-primary);
        background: #ffffff;
        border-radius: 8px;
        text-decoration: none;
        transition: all 0.3s ease;
        
        &:hover {
          background: var(--color-primary);
          color: #ffffff;
          transform: translateY(-2px);
          box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
        }
      }
    }
  }
}

// Responsive Adjustments
@media (max-width: 767px) {
  .blog-single-section {
    .blog-single-article {
      .article-header {
        .article-top-meta {
          flex-direction: column;
          align-items: flex-start !important;
          gap: 12px !important;

          .left-meta,
          .right-meta {
            gap: 16px !important;
          }
        }
      }

      .article-share {
        .share-container {
          .social-share {
            .share-btn {
              min-width: calc(50% - 8px);
            }
          }
        }
      }
    }
  }
}


