/**
 * Frontend CSS cho MuaTheme WP Giare - Tài Liệu
 * Tối ưu, nhẹ, responsive, chuẩn SEO
 */

/* Reset và Base Styles */
.mtwpg-doc-notice,
.mtwpg-doc-breadcrumb,
.mtwpg-doc-meta-info,
.mtwpg-doc-toc,
.mtwpg-doc-navigation,
.mtwpg-docs-sidebar {
    box-sizing: border-box;
}

/* Breadcrumb Navigation */
.mtwpg-doc-breadcrumb {
    margin: 0 0 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
}

.mtwpg-breadcrumb-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.mtwpg-breadcrumb-item {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.mtwpg-breadcrumb-item:not(:last-child)::after {
    content: "›";
    margin: 0 8px;
    color: #6c757d;
}

.mtwpg-breadcrumb-item a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s;
}

.mtwpg-breadcrumb-item a:hover {
    color: #0052a3;
    text-decoration: underline;
}

.mtwpg-breadcrumb-item.active span {
    color: #495057;
    font-weight: 500;
}

/* Meta Info */
.mtwpg-doc-meta-info {
    margin: 0 0 24px;
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid #0066cc;
    border-radius: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
}

.mtwpg-doc-difficulty {
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.mtwpg-doc-difficulty-beginner {
    background: #d4edda;
    color: #155724;
}

.mtwpg-doc-difficulty-intermediate {
    background: #fff3cd;
    color: #856404;
}

.mtwpg-doc-difficulty-advanced {
    background: #f8d7da;
    color: #721c24;
}

.mtwpg-doc-reading-time,
.mtwpg-doc-updated {
    display: flex;
    align-items: center;
    color: #6c757d;
}

.mtwpg-doc-reading-time .dashicons,
.mtwpg-doc-updated .dashicons {
    margin-right: 4px;
    width: 18px;
    height: 18px;
    font-size: 18px;
}

/* Notice Box */
.mtwpg-doc-notice {
    margin: 0 0 24px;
    padding: 16px 20px;
    border-radius: 6px;
    border-left: 4px solid;
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mtwpg-doc-notice-info {
    background: #e7f3ff;
    border-left-color: #0066cc;
    color: #004085;
}

.mtwpg-doc-notice-success {
    background: #d4edda;
    border-left-color: #28a745;
    color: #155724;
}

.mtwpg-doc-notice-warning {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

.mtwpg-doc-notice-error {
    background: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

.mtwpg-doc-notice-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.mtwpg-doc-notice-icon::before {
    content: "ℹ";
    display: inline-block;
    margin-right: 8px;
    font-size: 20px;
    font-weight: bold;
}

.mtwpg-doc-notice-success .mtwpg-doc-notice-icon::before {
    content: "✓";
}

.mtwpg-doc-notice-warning .mtwpg-doc-notice-icon::before {
    content: "⚠";
}

.mtwpg-doc-notice-error .mtwpg-doc-notice-icon::before {
    content: "✕";
}

.mtwpg-doc-notice-content {
    line-height: 1.6;
}

.mtwpg-doc-notice-content a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

/* Table of Contents */
.mtwpg-doc-toc {
    margin: 0 0 32px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.mtwpg-doc-toc-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

.mtwpg-doc-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mtwpg-doc-toc-item {
    margin: 0;
    padding: 6px 0;
}

.mtwpg-doc-toc-level-2 {
    padding-left: 0;
}

.mtwpg-doc-toc-level-3 {
    padding-left: 20px;
}

.mtwpg-doc-toc-level-4 {
    padding-left: 40px;
}

.mtwpg-doc-toc-item a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s;
}

.mtwpg-doc-toc-item a:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* Doc Navigation (Prev/Next) */
.mtwpg-doc-navigation {
    margin: 40px 0 0;
    padding: 24px 0;
    border-top: 2px solid #dee2e6;
}

.mtwpg-doc-nav-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.mtwpg-doc-nav-prev,
.mtwpg-doc-nav-next {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.mtwpg-doc-nav-prev:hover,
.mtwpg-doc-nav-next:hover {
    background: #e9ecef;
    border-color: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.mtwpg-doc-nav-next {
    text-align: right;
}

.mtwpg-doc-nav-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 600;
}

.mtwpg-doc-nav-title {
    font-size: 16px;
    color: #212529;
    font-weight: 600;
}

/* Sidebar Navigation */
.mtwpg-docs-sidebar {
    padding: 24px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.mtwpg-docs-sidebar.sticky {
    position: sticky;
    top: 20px;
}

.mtwpg-docs-nav-section {
    margin-bottom: 24px;
}

.mtwpg-docs-nav-section:last-child {
    margin-bottom: 0;
}

.mtwpg-docs-nav-section-title {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
}

.mtwpg-docs-nav-list,
.mtwpg-docs-nav-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mtwpg-docs-nav-sublist {
    margin-top: 8px;
    padding-left: 16px;
    border-left: 2px solid #e9ecef;
}

.mtwpg-docs-nav-item {
    margin: 0;
    padding: 0;
}

.mtwpg-docs-nav-item a {
    display: block;
    padding: 8px 12px;
    color: #495057;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.mtwpg-docs-nav-item a:hover {
    background: #f8f9fa;
    color: #0066cc;
    padding-left: 16px;
}

.mtwpg-docs-nav-item.active > a {
    background: #e7f3ff;
    color: #0066cc;
    font-weight: 600;
    border-left: 3px solid #0066cc;
}

/* Docs List (Shortcode) */
.mtwpg-docs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.mtwpg-doc-item {
    padding: 20px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s;
}

.mtwpg-doc-item:hover {
    border-color: #0066cc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.mtwpg-doc-item-title {
    margin: 0 0 12px;
    font-size: 18px;
}

.mtwpg-doc-item-title a {
    color: #212529;
    text-decoration: none;
}

.mtwpg-doc-item-title a:hover {
    color: #0066cc;
}

.mtwpg-doc-item-excerpt {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mtwpg-doc-meta-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .mtwpg-doc-nav-links {
        grid-template-columns: 1fr;
    }
    
    .mtwpg-docs-list {
        grid-template-columns: 1fr;
    }
    
    .mtwpg-breadcrumb-list {
        font-size: 13px;
    }
    
    .mtwpg-docs-sidebar {
        margin-top: 20px;
    }
    
    .mtwpg-docs-sidebar.sticky {
        position: relative;
        top: auto;
    }
}

/* Print Styles */
@media print {
    .mtwpg-doc-navigation,
    .mtwpg-docs-sidebar {
        display: none;
    }
    
    .mtwpg-doc-notice {
        page-break-inside: avoid;
    }
}

/* Accessibility */
.mtwpg-doc-notice:focus-within,
.mtwpg-doc-nav-prev:focus,
.mtwpg-doc-nav-next:focus,
.mtwpg-docs-nav-item a:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .mtwpg-doc-breadcrumb,
    .mtwpg-doc-meta-info,
    .mtwpg-doc-toc,
    .mtwpg-doc-nav-prev,
    .mtwpg-doc-nav-next,
    .mtwpg-docs-sidebar,
    .mtwpg-doc-item {
        background: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }
    
    .mtwpg-breadcrumb-item a,
    .mtwpg-doc-toc-item a,
    .mtwpg-docs-nav-item a {
        color: #63b3ed;
    }
    
    .mtwpg-doc-nav-title,
    .mtwpg-docs-nav-section-title,
    .mtwpg-doc-item-title a {
        color: #e2e8f0;
    }
}
