/* Custom CSS for TechBlog */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Global Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

/* Blog Card Styles */
.blog-card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.blog-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .card-img-top {
    transform: scale(1.05);
}

.blog-card .card-body {
    padding: 1.5rem;
}

.blog-card .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--dark-color);
    transition: color 0.3s ease;
}

.blog-card:hover .card-title {
    color: var(--primary-color);
}

.blog-card .card-text {
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Text truncation utilities */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta information styles */
.meta-info {
    font-size: 0.875rem;
    color: #6c757d;
}

.meta-info i {
    width: 16px;
    text-align: center;
}

/* Author styles */
.author-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Tag styles */
.tag {
    background-color: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag:hover {
    background-color: #dee2e6;
    color: #495057;
}

/* Post Detail Styles */
.hero-image {
    height: 60vh;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.bg-gradient-to-top {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
}

/* Post content typography */
.post-content {
    font-size: 1.125rem;
    line-height: 1.75;
    color: #374151;
}

.post-content h2 {
    color: #111827;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.875rem;
}

.post-content h3 {
    color: #111827;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.post-content p {
    margin-bottom: 1.25rem;
    line-height: 1.75;
}

.post-content p:last-child {
    margin-bottom: 0;
}

/* Search and filter styles */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Animation utilities */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section .display-4 {
        font-size: 2rem;
    }
    
    .hero-image {
        height: 50vh;
        min-height: 300px;
    }
    
    .blog-card .card-img-top {
        height: 180px;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .post-content h2 {
        font-size: 1.5rem;
    }
    
    .post-content h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .hero-section .display-4 {
        font-size: 1.75rem;
    }
    
    .hero-image {
        height: 40vh;
        min-height: 250px;
    }
    
    .blog-card .card-body {
        padding: 1rem;
    }
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar,
    .hero-section,
    footer,
    .no-print {
        display: none !important;
    }
    
    .post-content {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .post-content h2,
    .post-content h3 {
        page-break-after: avoid;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Hover effects for interactive elements */
.btn {
    transition: all 0.3s ease;
}

.navbar-nav .nav-link {
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

/* Footer link styles */
footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: #fff !important;
}

/* Badge styles */
.badge {
    font-weight: 500;
}

/* Card hover effects */
.card {
    transition: all 0.3s ease;
}

/* Utility classes */
.lh-sm {
    line-height: 1.25 !important;
}

.lh-base {
    line-height: 1.5 !important;
}

.cursor-pointer {
    cursor: pointer;
}

/* Enhanced spacing */
.py-6 {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
}

.my-6 {
    margin-top: 4rem !important;
    margin-bottom: 4rem !important;
}

/* Enhanced shadows */
.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}