/*
 * Blog styles — the inline styles of the existing static listing and detail
 * pages, moved into one file, plus the pieces the dynamic pages need
 * (category/excerpt on cards, article typography, filters, loaders).
 */
:root {
    --brand-primary: #10b981;
    --brand-primary-hover: #059669;
    --brand-primary-text: #047857; /* AA contrast for small green text on white */
    --brand-dark: #0f172a;
    --brand-light: #f8fafc;
    --brand-gray: #64748b;
    --font-family: 'Inter', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    font-family: var(--font-family);
    background-color: var(--brand-light);
    color: #334155;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { text-decoration: none; transition: all 0.3s ease; }

:focus-visible { outline: 3px solid rgba(16, 185, 129, 0.55); outline-offset: 2px; }

.bl-skip-link { position: absolute; left: 16px; top: 8px; z-index: 2000; background: #fff; padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow-md); }

/* Top Bar */
.top-bar { background-color: var(--brand-dark); color: #cbd5e1; font-size: 0.85rem; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.top-bar a { color: #cbd5e1; }
.top-bar a:hover { color: var(--brand-primary); }

/* Glassmorphism Header */
.navbar-glass {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
}
.nav-link { color: var(--brand-dark); font-weight: 500; padding: 8px 16px !important; border-radius: 8px; }
.nav-link:hover, .nav-link.active { color: var(--brand-primary); background: rgba(16, 185, 129, 0.05); }

.btn-brand {
    background-color: var(--brand-primary);
    color: #fff;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
}
.btn-brand:hover { background-color: var(--brand-primary-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-outline-brand {
    background-color: transparent;
    color: var(--brand-primary);
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    border: 2px solid var(--brand-primary);
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}
.btn-outline-brand:hover { background-color: var(--brand-primary); color: #fff; }

/* Hero Section */
.saas-hero {
    padding: 80px 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.saas-hero h1 { font-size: 2.5rem; font-weight: 700; letter-spacing: -1px; margin-bottom: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.saas-hero.saas-hero-listing { padding: 100px 0; }
.saas-hero.saas-hero-listing h1 { font-size: 3rem; }
.saas-hero p { color: #cbd5e1; }

.breadcrumb-modern { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: #94a3b8; margin-bottom: 24px; flex-wrap: wrap; }
.breadcrumb-modern a { color: #cbd5e1; }
.breadcrumb-modern a:hover { color: var(--brand-primary); }

.rating-badges img { height: 40px; width: auto; border-radius: 6px; margin-right: 12px; margin-top: 10px; }

.post-meta-hero { display: flex; flex-wrap: wrap; gap: 8px 20px; color: #cbd5e1; font-size: 0.92rem; }
.post-meta-hero a { color: #6ee7b7; }
.post-meta-hero i { color: var(--brand-primary); margin-right: 4px; }

/* Filters */
.blog-filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.blog-search { display: flex; flex: 1 1 280px; max-width: 420px; gap: 8px; }
.blog-search .form-control { border-radius: var(--radius-md); border: 1px solid #cbd5e1; padding: 10px 14px; }
.blog-search .form-control:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1); }
.blog-search .btn-brand { padding: 10px 16px; }
.category-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.category-chips a { display: inline-block; padding: 8px 16px; border-radius: 50px; background: #fff; border: 1px solid #e2e8f0; color: #475569; font-size: 0.875rem; font-weight: 500; }
.category-chips a:hover { border-color: var(--brand-primary); color: var(--brand-primary-text); }
.category-chips a.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.blog-result-note { color: var(--brand-gray); margin-bottom: 20px; }

/* Blog Cards */
.blog-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.blog-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: #cbd5e1; }
.blog-img-link { display: block; }
.blog-card img.blog-img { width: 100%; height: 240px; object-fit: cover; border-bottom: 1px solid #f1f5f9; display: block; background: #f1f5f9; }
.blog-img-placeholder { height: 240px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #ecfdf5, #f1f5f9); color: var(--brand-primary); font-size: 3rem; }
.blog-content { padding: 24px; flex-grow: 1; display: flex; flex-direction: column; }
.blog-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.blog-category { background: rgba(16, 185, 129, 0.1); color: var(--brand-primary-text); font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 50px; text-transform: uppercase; letter-spacing: 0.03em; }
.blog-date { color: var(--brand-primary); font-weight: 600; font-size: 0.85rem; display: flex; align-items: center; gap: 6px; }
.blog-title { font-size: 1.25rem; font-weight: 700; color: var(--brand-dark); margin-bottom: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.blog-title a { color: inherit; }
.blog-title a:hover { color: var(--brand-primary); }
.blog-excerpt { color: var(--brand-gray); font-size: 0.95rem; line-height: 1.6; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-footer { margin-top: auto; border-top: 1px solid #f1f5f9; padding-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.blog-author { color: var(--brand-gray); font-size: 0.85rem; }
.read-more { color: var(--brand-primary); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem; transition: gap 0.3s; }
.read-more:hover { gap: 12px; color: var(--brand-primary-hover); }

/* Infinite scroll states */
.blog-loader { display: none; }
.blog-loader.is-active { display: flex; }
.skeleton-card { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius-lg); overflow: hidden; height: 100%; }
.skeleton-card .sk-img { height: 240px; }
.skeleton-card .sk-body { padding: 24px; }
.skeleton-card .sk-line { height: 14px; border-radius: 6px; margin-bottom: 12px; }
.sk-img, .sk-line { background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%); background-size: 400% 100%; animation: sk-shimmer 1.4s ease infinite; }
@keyframes sk-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .sk-img, .sk-line { animation: none; } .blog-card:hover { transform: none; } }
.blog-feed-status { text-align: center; color: var(--brand-gray); padding: 32px 0 8px; }
.blog-feed-status .btn-outline-brand { margin-top: 12px; }
.blog-sentinel { height: 1px; }
.blog-pagination .page-link { color: var(--brand-dark); border-radius: 8px; margin: 0 3px; border-color: #e2e8f0; }
.blog-pagination .page-item.active .page-link { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.blog-empty { text-align: center; background: #fff; border: 1px dashed #cbd5e1; border-radius: var(--radius-lg); padding: 56px 24px; color: var(--brand-gray); }
.blog-empty i { font-size: 2.5rem; color: var(--brand-primary); display: block; margin-bottom: 12px; }

/* Blog Details Content */
.blog-content-wrapper { background: #fff; border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow-sm); border: 1px solid #e2e8f0; }
.blog-body { overflow-wrap: break-word; }
.blog-body p, .blog-body li { font-size: 1.05rem; line-height: 1.8; color: #475569; }
.blog-body p { margin-bottom: 24px; }
.blog-body h2 { font-size: 1.75rem; font-weight: 700; color: var(--brand-dark); margin-top: 40px; margin-bottom: 20px; }
.blog-body h3 { font-size: 1.4rem; font-weight: 700; color: var(--brand-dark); margin-top: 32px; margin-bottom: 16px; }
.blog-body h4, .blog-body h5, .blog-body h6 { font-weight: 700; color: var(--brand-dark); margin-top: 24px; margin-bottom: 12px; }
.blog-body ul, .blog-body ol { margin-bottom: 24px; padding-left: 1.4rem; }
.blog-body a { color: var(--brand-primary-text); text-decoration: underline; text-underline-offset: 2px; }
.blog-body img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.blog-body blockquote { border-left: 4px solid var(--brand-primary); background: #f0fdf4; padding: 16px 20px; border-radius: 0 var(--radius-md) var(--radius-md) 0; margin: 0 0 24px; }
.blog-body blockquote p:last-child { margin-bottom: 0; }
.blog-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin-bottom: 24px; }
.blog-body th, .blog-body td { border: 1px solid #e2e8f0; padding: 10px 12px; vertical-align: top; }
.blog-body th { background: #f8fafc; color: var(--brand-dark); }
.blog-body pre { background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: var(--radius-md); overflow-x: auto; }
.blog-body figure { margin: 30px 0; }
.blog-body figcaption { font-size: 0.875rem; color: var(--brand-gray); text-align: center; margin-top: 8px; }
.blog-main-img { width: 100%; height: auto; border-radius: var(--radius-md); margin: 0 0 30px; box-shadow: var(--shadow-sm); border: 1px solid #e2e8f0; }
.blog-body .blog-main-img { margin: 30px 0; }

.post-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-top: 1px solid #f1f5f9; padding-top: 24px; margin-top: 16px; }
.post-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.post-share .label, .post-tags .label { font-weight: 600; color: var(--brand-dark); margin-right: 4px; }
.post-share a, .post-share button { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #f1f5f9; color: #475569; border: 0; }
.post-share a:hover, .post-share button:hover { background: var(--brand-primary); color: #fff; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.post-nav a { display: block; background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius-md); padding: 16px 20px; color: var(--brand-dark); font-weight: 600; height: 100%; }
.post-nav a:hover { border-color: var(--brand-primary); color: var(--brand-primary-text); }
.post-nav small { display: block; color: var(--brand-gray); font-weight: 500; margin-bottom: 4px; }
.post-nav .next { text-align: right; grid-column: 2; }

.related-posts { margin-top: 56px; }
.related-posts h2 { font-size: 1.5rem; font-weight: 700; color: var(--brand-dark); margin-bottom: 24px; }

/* Sidebar Elements */
.sidebar-widget { background: #fff; border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-sm); border: 1px solid #e2e8f0; margin-bottom: 24px; }
.sidebar-title { font-size: 1.25rem; font-weight: 700; color: var(--brand-dark); margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #f1f5f9; }
.sticky-sidebar { position: sticky; top: 100px; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.tag-cloud a { background-color: #f1f5f9; color: #475569; padding: 8px 16px; border-radius: 50px; font-size: 0.85rem; font-weight: 500; display: inline-block; }
.tag-cloud a:hover { background-color: var(--brand-primary); color: #fff; }

/* Inputs */
.sidebar-widget .form-control, .sidebar-widget .form-select, .modal .form-control, .modal .form-select {
    border-radius: var(--radius-md);
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
    padding: 12px 16px;
    font-size: 0.95rem;
    width: 100%;
}
.sidebar-widget .form-control, .sidebar-widget .form-select { margin-bottom: 16px; }
.form-control:focus, .form-select:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1); background-color: #fff; outline: none; }

/* Floating Buttons */
.floating-buttons { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 12px; z-index: 999; }
.floating-buttons a { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #fff; box-shadow: var(--shadow-lg); transition: transform 0.3s; }
.floating-buttons a:hover { transform: scale(1.1); }
.call-btn { background: #3b82f6; }
.whatsapp-btn { background: #25d366; }

/* Modal Styling */
.modal-content { border-radius: var(--radius-lg); border: none; overflow: hidden; }
.modal-header { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; border-bottom: none; }
.modal-title { font-weight: 700; }
.modal-body { padding: 30px; }

/* Footer */
.saas-footer { background-color: #ffffff; border-top: 1px solid #e2e8f0; padding: 60px 0 20px; margin-top: 80px; }
.footer-title { font-size: 1rem; font-weight: 700; color: var(--brand-dark); margin-bottom: 20px; }
.footer-links { padding: 0; margin: 0; }
.footer-links li { list-style: none; margin-bottom: 12px; }
.footer-links a { color: var(--brand-gray); font-size: 0.9rem; }
.footer-links a:hover { color: var(--brand-primary); }
.social-icons a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #f1f5f9; color: var(--brand-gray); margin-right: 8px; transition: all 0.3s; }
.social-icons a:hover { background: var(--brand-primary); color: #fff; }

/* Admin preview banner */
.bl-preview-banner { background: #fef3c7; color: #78350f; text-align: center; padding: 10px 16px; font-size: 0.9rem; position: relative; z-index: 1040; }

/* Responsive */
@media (max-width: 991.98px) {
    .sticky-sidebar { position: static; }
}
@media (max-width: 767.98px) {
    .saas-hero, .saas-hero.saas-hero-listing { padding: 56px 0; }
    .saas-hero h1 { font-size: 1.85rem; }
    .saas-hero.saas-hero-listing h1 { font-size: 2rem; }
    .blog-content-wrapper { padding: 22px 18px; }
    .sidebar-widget { padding: 22px 18px; }
    .blog-body h2 { font-size: 1.45rem; margin-top: 32px; }
    .blog-card img.blog-img, .blog-img-placeholder, .skeleton-card .sk-img { height: 200px; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav .next { grid-column: 1; }
    .blog-search { max-width: none; }
    .floating-buttons { bottom: 16px; right: 16px; }
    .floating-buttons a { width: 46px; height: 46px; font-size: 1.3rem; }
    .saas-footer { margin-top: 48px; }
}

/* OTP popup (SweetAlert2) */
.swal2-input.bl-otp-input { letter-spacing: 0.4em; text-align: center; font-size: 1.4rem; font-weight: 600; max-width: 240px; margin-left: auto; margin-right: auto; }
