/* ============================================================
   Built with Claude - Technical Blog Stylesheet
   Matches S&R Technology Group branding
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --primary:          #6f42c1;
    --primary-dark:     #5a32a3;
    --primary-light:    #d4b8f0;
    --primary-bg:       #f3eefa;
    --secondary:        #495057;
    --accent:           #e83e8c;
    --text-dark:        #212529;
    --text-muted:       #6c757d;
    --bg-light:         #f8f9fa;
    --bg-white:         #ffffff;
    --border-color:     #dee2e6;
    --code-bg:          #1e1e2e;
    --code-text:        #cdd6f4;
    --shadow-sm:        0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:        0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg:        0 8px 30px rgba(0,0,0,0.12);
    --radius:           8px;
    --radius-lg:        12px;
}

/* --- Global Overrides --- */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--primary-dark);
}

/* --- Navbar --- */
.blog-navbar {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    border-bottom: 3px solid var(--primary);
}
.blog-navbar .navbar-brand {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.35rem;
}
.blog-navbar .navbar-brand i {
    margin-right: 8px;
}
.blog-navbar .nav-link {
    color: var(--secondary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.2s ease;
}
.blog-navbar .nav-link:hover,
.blog-navbar .nav-link.active {
    color: var(--primary);
}
.blog-navbar .btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}
.blog-navbar .btn-outline-primary:hover {
    background-color: var(--primary);
    color: #fff;
}

/* --- Hero / Page Headers --- */
.blog-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    padding: 3.5rem 0;
    margin-bottom: 2rem;
}
.blog-hero h1 {
    font-weight: 800;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}
.blog-hero .lead {
    color: var(--primary-light);
    font-size: 1.1rem;
}

/* --- Post Cards --- */
.post-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}
.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.post-card .card-img-top {
    height: 200px;
    object-fit: cover;
}
.post-card .card-body {
    padding: 1.5rem;
}
.post-card .post-category {
    display: inline-block;
    background-color: var(--primary-bg);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.post-card .card-title {
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}
.post-card .card-title a {
    color: var(--text-dark);
}
.post-card .card-title a:hover {
    color: var(--primary);
}
.post-card .card-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}
.post-card .post-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}
.post-card .post-meta i {
    margin-right: 4px;
}

/* --- Single Post --- */
.post-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}
.post-content h1 {
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-dark);
}
.post-content .post-meta-header {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-bg);
}
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

/* Code blocks within posts */
.post-content pre {
    background-color: var(--code-bg);
    color: var(--code-text);
    border-radius: var(--radius);
    padding: 1.25rem;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 1.5rem 0;
}
.post-content code {
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}
.post-content p code {
    background-color: var(--primary-bg);
    color: var(--primary-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* --- Tags --- */
.tag-badge {
    display: inline-block;
    background-color: var(--bg-light);
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    margin: 2px 4px 2px 0;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}
.tag-badge:hover {
    background-color: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary-light);
}

/* --- Sidebar --- */
.sidebar-widget {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.sidebar-widget h5 {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-bg);
}
.sidebar-widget .list-group-item {
    border: none;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}
.sidebar-widget .list-group-item a {
    color: var(--text-dark);
}
.sidebar-widget .list-group-item a:hover {
    color: var(--primary);
}
.sidebar-widget .badge {
    background-color: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
}

/* --- Comments --- */
.comments-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}
.comments-section h4 {
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-bg);
}
.comment-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color);
}
.comment-item:last-child {
    border-bottom: none;
}
.comment-item .comment-author {
    font-weight: 600;
    color: var(--text-dark);
}
.comment-item .comment-date {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.comment-item .comment-body {
    margin-top: 0.5rem;
    line-height: 1.6;
}
.comment-reply {
    margin-left: 2.5rem;
    padding-left: 1rem;
    border-left: 3px solid var(--primary-bg);
}

/* --- Forms --- */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(111, 66, 193, 0.15);
}
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}
.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* --- Auth Pages --- */
.auth-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem;
    max-width: 480px;
    margin: 2rem auto;
}
.auth-card h2 {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* --- Pagination --- */
.pagination .page-link {
    color: var(--primary);
    border-radius: var(--radius);
    margin: 0 2px;
}
.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* --- Footer --- */
.blog-footer {
    background-color: var(--text-dark);
    color: #adb5bd;
    padding: 2rem 0;
    margin-top: 3rem;
}
.blog-footer a {
    color: var(--primary-light);
}
.blog-footer a:hover {
    color: #fff;
}

/* --- Admin Styles --- */
.admin-sidebar {
    background: var(--bg-white);
    min-height: calc(100vh - 56px);
    border-right: 1px solid var(--border-color);
}
.admin-sidebar .nav-link {
    color: var(--secondary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    margin: 2px 0;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: var(--primary-bg);
    color: var(--primary);
}
.admin-sidebar .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 8px;
}
.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}
.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Utility --- */
.text-primary { color: var(--primary) !important; }
.bg-primary-light { background-color: var(--primary-bg) !important; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .blog-hero { padding: 2rem 0; }
    .blog-hero h1 { font-size: 1.6rem; }
    .post-content { padding: 1.5rem; }
    .comments-section { padding: 1.5rem; }
    .comment-reply { margin-left: 1rem; }
}
