/* TruckLawHub CMS - Frontend Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #f5f7fa;
    --text-color: #333;
    --border-color: #ddd;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #2980b9;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.navbar-brand .logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary-color);
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.navbar-menu a {
    color: var(--secondary-color);
    font-weight: 500;
    transition: color 0.3s;
}

.navbar-menu a:hover {
    color: var(--primary-color);
}

.navbar-menu .dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    list-style: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    min-width: 200px;
    margin-top: 10px;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: var(--text-color);
}

.dropdown-menu a:hover {
    background: var(--light-bg);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.95;
}

.hero-search {
    max-width: 500px;
    margin: 0 auto;
}

.hero-search form {
    display: flex;
    gap: 10px;
}

.hero-search input {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
}

.hero-search button {
    padding: 12px 30px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.hero-search button:hover {
    background: #229954;
}

/* Stats Section */
.stats {
    background: white;
    padding: 60px 0;
    border-bottom: 1px solid var(--border-color);
}

.stats .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    text-align: center;
}

.stat-item h3 {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-item p {
    color: #666;
    font-size: 14px;
}

/* Featured Posts */
.featured-posts {
    padding: 60px 0;
}

.featured-posts h2 {
    font-size: 32px;
    margin-bottom: 40px;
    text-align: center;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.post-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--light-bg);
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-content {
    padding: 20px;
}

.category-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.post-card h3 {
    margin: 15px 0;
    font-size: 18px;
}

.post-card h3 a {
    color: var(--text-color);
}

.post-excerpt {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.post-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #999;
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    transition: gap 0.3s;
}

.read-more:hover {
    gap: 5px;
}

/* Categories Section */
.categories-section {
    background: var(--light-bg);
    padding: 60px 0;
}

.categories-section h2 {
    font-size: 32px;
    margin-bottom: 40px;
    text-align: center;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.category-item {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    display: block;
}

.category-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-top: 4px solid var(--primary-color);
}

.category-item h3 {
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.category-item p {
    font-size: 14px;
    color: #666;
}

/* Single Post Page */
.breadcrumb {
    padding: 20px 0;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: var(--primary-color);
}

.post-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    padding: 40px 0;
}

.post-header {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.post-category {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}

.post-header h1 {
    font-size: 42px;
    margin: 15px 0;
    line-height: 1.2;
}

.post-header .post-meta {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.post-featured-image {
    margin: 30px 0;
    border-radius: 8px;
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    height: auto;
}

.table-of-contents {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.table-of-contents h3 {
    margin-bottom: 15px;
}

.table-of-contents ul {
    list-style: none;
}

.table-of-contents li {
    padding: 8px 0;
    padding-left: 20px;
}

.table-of-contents a {
    font-size: 14px;
    color: var(--primary-color);
}

/* Post Body */
.post-body {
    font-size: 16px;
    line-height: 1.8;
}

.post-body h2 {
    font-size: 28px;
    margin: 40px 0 20px;
    line-height: 1.3;
}

.post-body h3 {
    font-size: 22px;
    margin: 30px 0 15px;
    line-height: 1.3;
}

.post-body p {
    margin-bottom: 20px;
}

.post-body ul,
.post-body ol {
    margin: 20px 0 20px 30px;
}

.post-body li {
    margin-bottom: 10px;
}

.post-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin: 20px 0;
    background: var(--light-bg);
    font-style: italic;
}

.post-body code {
    background: var(--light-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.post-body pre {
    background: #2c3e50;
    color: white;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 20px 0;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.post-body table th,
.post-body table td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}

.post-body table th {
    background: var(--light-bg);
    font-weight: 600;
}

/* Post Footer */
.internal-links {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
}

.internal-links h3 {
    margin-bottom: 15px;
}

.internal-links ul {
    list-style: none;
}

.internal-links li {
    padding: 8px 0;
}

.internal-links a {
    color: var(--primary-color);
}

.post-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--border-color);
}

.post-tags {
    margin-bottom: 30px;
}

.post-tags h4 {
    margin-bottom: 10px;
}

.tag {
    display: inline-block;
    background: var(--light-bg);
    padding: 6px 12px;
    border-radius: 4px;
    margin: 5px 5px 5px 0;
    font-size: 14px;
}

.post-disclaimer {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 15px;
    border-radius: 4px;
    color: #856404;
}

/* Sidebar */
.sidebar {
    flex-direction: column;
}

.sidebar-widget {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.sidebar-widget h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.sidebar-widget ul {
    list-style: none;
}

.sidebar-widget li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-widget li:last-child {
    border-bottom: none;
}

.sidebar-widget a {
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-widget .date {
    font-size: 12px;
    color: #999;
}

.newsletter {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2196F3 100%);
    color: white;
}

.newsletter h3 {
    color: white;
}

.newsletter p {
    margin-bottom: 15px;
    font-size: 14px;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-form input {
    padding: 10px;
    border: none;
    border-radius: 4px;
}

.newsletter-form button {
    padding: 10px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.newsletter-form button:hover {
    background: #229954;
}

/* Category Page */
.category-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 0;
}

.category-header h1 {
    font-size: 42px;
    margin-bottom: 15px;
}

.category-description {
    font-size: 18px;
    opacity: 0.95;
}

.category-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    padding: 40px 0;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.post-preview {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 1fr 250px;
    transition: all 0.3s;
}

.post-preview:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.post-preview-content {
    padding: 30px;
}

.post-preview-content h2 {
    margin: 0 0 15px;
    font-size: 24px;
}

.post-preview-content h2 a {
    color: var(--text-color);
}

.post-preview-image {
    overflow: hidden;
}

.post-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.read-more-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--primary-color);
    font-weight: 600;
}

.no-posts {
    text-align: center;
    padding: 60px 20px;
}

.no-content {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
}

.pagination a,
.pagination span {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
}

.pagination-current {
    background: var(--primary-color);
    color: white;
}

/* Footer */
.footer {
    background: var(--secondary-color);
    color: white;
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
    text-align: center;
    font-size: 14px;
}

.disclaimer {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.6);
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #2980b9;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-menu {
        gap: 15px;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .hero-search form {
        flex-direction: column;
    }
    
    .post-container,
    .category-container {
        grid-template-columns: 1fr;
    }
    
    .post-preview {
        grid-template-columns: 1fr;
    }
    
    .post-preview-image {
        height: 200px;
    }
    
    .hero h1,
    .featured-posts h2,
    .categories-section h2 {
        font-size: 24px;
    }
}
