/* Blog Core Styles - Namespace: .blog-widget */
.blog-widget {
    font-family: 'Arial', sans-serif;
    box-sizing: border-box;
}

.blog-widget *,
.blog-widget *::before,
.blog-widget *::after {
    box-sizing: inherit;
}

/* Container chính */
.blog-widget .blog-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 30px auto;
    overflow-x: hidden;
    position: relative;
}

/* Copy Button Styles */
.blog-widget .copy-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    margin-bottom: 20px;
}

.blog-widget .copy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.blog-widget .copy-button:active {
    transform: translateY(0);
}

.blog-widget .copy-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Copy notification styles */
.blog-widget .copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999998;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 350px;
}

.blog-widget .copy-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.blog-widget .copy-notification .title {
    font-weight: 600;
    margin-bottom: 4px;
}

.blog-widget .copy-notification .warning {
    font-size: 12px;
    opacity: 0.9;
}

.blog-widget .blog-title {
    font-size: 36px;
    font-weight: 700;
    margin: 20px 0;
    color: #333;
    line-height: 1.2;
    text-align: center;
}

.blog-widget .section-title {
    font-size: 28px;
    font-weight: 700;
    margin: 30px 0 15px;
    color: #222;
    padding-left: 10px;
    border-left: 4px solid #0066ff;
}

/* Styling for content that will be injected from API */
.blog-widget .blog-content {
    font-size: 18.4px;
    line-height: 1.7;
    color: #333;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.blog-widget .blog-content h1, 
.blog-widget .blog-content h2, 
.blog-widget .blog-content h3, 
.blog-widget .blog-content h4, 
.blog-widget .blog-content h5, 
.blog-widget .blog-content h6 {
    margin: 20px 0 15px;
    color: #333;
    line-height: 1.2;
}

.blog-widget .blog-content h1 {
    font-size: 32.2px;
}

.blog-widget .blog-content h2 {
    font-size: 27.6px;
}

.blog-widget .blog-content h3 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #222;
    position: relative;
}

/* Numbered segment titles */
.blog-widget .numbered-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #222;
    position: relative;
    padding-left: 36px;
}

.blog-widget .numbered-title::before {
    content: attr(data-number);
    position: absolute;
    left: 0;
    top: 0;
    font-size: 24px;
    font-weight: 700;
    color: #0066ff;
    background-color: #f0f7ff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.blog-widget .blog-content p {
    margin-bottom: 20px;
}

.blog-widget .blog-content img, 
.blog-widget .blog-content video, 
.blog-widget .blog-content iframe, 
.blog-widget .blog-content embed {
    max-width: 100% !important;
    /*height: auto !important;*/
    border-radius: 8px;
    /*margin: 20px 0;*/
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
}

.blog-widget .blog-content ul, 
.blog-widget .blog-content ol {
    margin: 0 0 20px 20px;
}

.blog-widget .blog-content li {
    margin-bottom: 10px;
}

.blog-widget .blog-content blockquote {
    border-left: 4px solid #0066ff;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #555;
}

.blog-widget .blog-content a {
    color: #0066ff;
    text-decoration: none;
    word-break: break-word;
}

.blog-widget .blog-content a:hover {
    text-decoration: underline;
}

.blog-widget .blog-content figure {
    margin: 20px 0;
    text-align: center;
}

.blog-widget .blog-content figcaption {
    font-size: 16.1px;
    color: #666;
    margin-top: 8px;
}

/* Tables */
.blog-widget .blog-content table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    display: block;
    margin-bottom: 20px;
    border-collapse: collapse;
}

.blog-widget .blog-content table td, 
.blog-widget .blog-content table th {
    padding: 8px;
    border: 1px solid #ddd;
}

/* Embedded elements */
.blog-widget .blog-content .embed-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 20px 0;
}

.blog-widget .blog-content .embed-container iframe, 
.blog-widget .blog-content .embed-container object, 
.blog-widget .blog-content .embed-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Code blocks */
.blog-widget .blog-content pre, 
.blog-widget .blog-content code {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    overflow-x: auto;
    display: block;
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 16.1px;
}

.blog-widget .loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 400px;
}

.blog-widget .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 102, 255, 0.2);
    border-top-color: #0066ff;
    border-radius: 50%;
    animation: blog-spin 1s linear infinite;
    margin-bottom: 20px;
}

.blog-widget .error-container {
    padding: 20px;
    background-color: #ffeeee;
    color: #cc0000;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    width: 100%;
    max-width: 800px;
}

/* Edit Alert Box */
.blog-widget .edit-alert {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 2px solid #2196f3;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0 30px 0;
    text-align: center;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
    position: relative;
    overflow: hidden;
}

.blog-widget .edit-alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.blog-widget .edit-alert-icon {
    display: inline-block;
    font-size: 24px;
    margin-right: 12px;
    color: #2196f3;
    vertical-align: middle;
}

.blog-widget .edit-alert-content {
    display: inline-block;
    vertical-align: middle;
}

.blog-widget .edit-alert-title {
    font-size: 18px;
    font-weight: 700;
    color: #1976d2;
    margin: 0 0 8px 0;
}

.blog-widget .edit-alert-text {
    font-size: 16px;
    color: #455a64;
    margin: 0;
    line-height: 1.5;
}

.blog-widget .edit-alert-button {
    background: linear-gradient(135deg, #2196f3, #1976d2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    box-shadow: 0 3px 8px rgba(33, 150, 243, 0.3);
}

.blog-widget .edit-alert-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.blog-widget .edit-alert-button:active {
    transform: translateY(0);
}

/* Table of Contents */
.blog-widget .table-of-contents {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.blog-widget .table-of-contents h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20.7px;
    font-weight: 700;
}

.blog-widget .table-of-contents ul {
    list-style-type: none;
    padding-left: 0;
}

.blog-widget .table-of-contents li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 25px;
}

.blog-widget .table-of-contents li::before {
    content: attr(data-number);
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 14px;
    font-weight: 700;
    color: #0066ff;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.blog-widget .table-of-contents a {
    color: #0066ff;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
    font-size: 17.25px;
}

.blog-widget .table-of-contents a:hover {
    color: #0044cc;
    text-decoration: underline;
}

/* Custom rule for section titles */
.blog-widget .section-header {
    font-weight: 700;
    font-size: 26px;
    color: #222;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

@keyframes blog-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .blog-widget .blog-container {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .blog-widget .blog-title {
        font-size: 32.2px;
    }
    
    .blog-widget .section-title {
        font-size: 25.3px;
    }
    
    .blog-widget .blog-container {
        padding: 15px;
    }
    
    .blog-widget .copy-button {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .blog-widget .copy-notification {
        left: 10px;
        right: 10px;
        top: 70px;
        max-width: none;
    }
}

@media (max-width: 576px) {
    .blog-widget .blog-container {
        padding: 12px;
    }
    
    .blog-widget .blog-title {
        font-size: 27.6px;
    }
    
    .blog-widget .section-title {
        font-size: 23px;
    }
    
    .blog-widget .blog-content p {
        font-size: 17.25px;
    }
    
    .blog-widget .blog-content img, 
    .blog-widget .blog-content video, 
    .blog-widget .blog-content iframe, 
    .blog-widget .blog-content embed {
        /*margin: 15px 0;*/
    }
    
    .blog-widget .copy-button {
        margin: 0 auto 20px auto;
        display: flex;
    }
}