/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin: 6rem 0;
}

/* Article Container */
.article-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

/* Article Header */
.article-header {
    padding: 2rem 2.5rem 1.5rem;
    background: linear-gradient(135deg, #fff, #f8f9fa);
    border-bottom: 1px solid #e9ecef;
}

.article-category {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.article-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-featured {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.badge-hot {
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
    color: white;
}

.article-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid #e9ecef;
    font-size: 0.85rem;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-item i {
    color: #2a5298;
}

.article-excerpt {
    background: linear-gradient(135deg, #e3f2fd, #f1f8ff);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    border-left: 4px solid #2a5298;
    font-style: italic;
    color: #444;
    line-height: 1.7;
}

/* Article Content */
.article-content {
    padding: 2rem 2.5rem;
}

.featured-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

/* Enhanced CKEditor Content Styling */
.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.article-body h1 {
    font-size: 1.8rem;
    color: #1e3c72;
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #2a5298;
    font-weight: 600;
}

.article-body h2 {
    font-size: 1.6rem;
    color: #1e3c72;
    margin: 1.8rem 0 1rem;
    font-weight: 600;
}

.article-body h3 {
    font-size: 1.4rem;
    color: #2a5298;
    margin: 1.5rem 0 0.8rem;
    font-weight: 600;
}

.article-body p {
    margin-bottom: 1.2rem;
    text-align: justify;
    hyphens: auto;
}

.article-body p a {
    text-decoration: none;
    background-color: var(--primary-color);
    color: #fff;
    padding: 7px 14px;
    border-radius: 15px;
}

.article-body p a:hover {
    text-decoration: none;
    background-color: var(--secondary-color);
    color: #fff;
    padding: 7px 14px;
    border-radius: 15px;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem auto;
    display: block;
    transition: transform 0.3s ease;
}

.article-body img:hover {
    transform: scale(1.02);
}

/* Table Styling for CKEditor */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.article-body table td {
    padding: 1rem;
    vertical-align: top;
    background-color: white;
}

.article-body table tr:nth-child(even) td {
    background-color: #f8f9fa;
}

/* Special styling for colored backgrounds from CKEditor */
.article-body table td[style*="background-color:#16a085"] {
    background-color: #16a085 !important;
    color: white;
    font-weight: 500;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.widget-list {
    list-style: none;
}

.widget-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f1f1;
}

.widget-list li:last-child {
    border-bottom: none;
}

.widget-list a {
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.widget-list a:hover {
    color: #2a5298;
}

/* Social Share */
.social-share {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 2rem 2.5rem;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.social-share h3 {
    color: #1e3c72;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.share-btn:hover {
    transform: translateY(-2px);
}

.facebook {
    background: linear-gradient(135deg, #3b5998, #2d4373);
}

.twitter {
    background: linear-gradient(135deg, #1da1f2, #0d8bd9);
}

.linkedin {
    background: linear-gradient(135deg, #0077b5, #005885);
}

/* Reading Progress */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #d4af37, #2a5298);
    z-index: 1000;
    transition: width 0.3s ease;
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .sidebar {
        order: -1;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .article-header,
    .article-content,
    .social-share {
        padding: 1.5rem;
    }

    .article-title {
        font-size: 1.8rem;
    }

    .nav-menu {
        display: none;
    }

    .article-body {
        font-size: 1rem;
    }

    .share-buttons {
        flex-direction: column;
        align-items: center;
    }

    .share-btn {
        width: 200px;
    }
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #2a5298;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    background: #1e3c72;
    transform: scale(1.1);
}

/* Responsive UI */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1rem 0;
    }

    /* Hide desktop sidebar */
    .sidebar {
        display: none;
    }

    /* Show bottom widgets on mobile */
    .bottom-widgets {
        display: grid;
    }

    .article-header {
        padding: 1rem 1.5rem;
    }

    .article-content {
        padding: 1rem 1.5rem;
    }

    .article-title {
        font-size: 1.6rem;
        line-height: 1.4;
    }

    .article-body {
        font-size: 1rem;
        line-height: 1.7;
    }

    .article-body h1 {
        font-size: 1.5rem;
    }

    .article-body h2 {
        font-size: 1.3rem;
    }

    .article-body h3 {
        font-size: 1.2rem;
    }

    .featured-image {
        height: 250px;
    }

    .article-meta {
        gap: 1rem;
        flex-direction: column;
    }

    .article-badges {
        justify-content: flex-start;
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .article-header {
        padding: 0.8rem 1rem;
    }

    .article-content {
        padding: 0.8rem 1rem;
    }

    .article-title {
        font-size: 1.4rem;
    }

    .article-excerpt {
        padding: 1rem;
        margin: 1rem 0;
    }

    .featured-image {
        height: 200px;
    }

    .bottom-widgets {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 2rem;
    }

    .sidebar-widget {
        padding: 1rem;
    }

    .widget-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 320px) {
    .article-title {
        font-size: 1.2rem;
    }

    .article-body {
        font-size: 0.9rem;
    }

    .sidebar-widget {
        padding: 0.8rem;
    }
}
