.language-switcher {
    position: relative;
    display: inline-block;
}

.language-switcher .lang-btn {
    background: transparent;
    border: 1px solid #e3e6f0;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
}

.language-switcher .lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e3e6f0;
    border-radius: 0.25rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    min-width: 150px;
    z-index: 1000;
}

.language-switcher:hover .lang-dropdown {
    display: block;
}

.language-switcher .lang-dropdown li a {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
}

.language-switcher .lang-dropdown li a:hover {
    background: #f8f9fc;
}

/* Post Content */
.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.post-content blockquote {
    border-left: 4px solid #4e73df;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #666;
}

.post-content code {
    background: #f8f9fc;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
}

.post-content pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: transparent;
    padding: 0;
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 1.5rem 0;
}

.video-embed iframe,
.video-embed video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0.5rem;
}

/* Pagination */
.pagination ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.pagination li {
    margin: 0 0.25rem;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 0.5rem 1rem;
    border: 1px solid #e3e6f0;
    border-radius: 0.25rem;
    color: #4e73df;
    text-decoration: none;
}

.pagination li.active a {
    background: #4e73df;
    color: white;
    border-color: #4e73df;
}

.pagination li.ellipsis {
    padding: 0.5rem;
    color: #666;
}

.tagcloud a {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    margin: 0.25rem;
    background: #f8f9fc;
    border: 1px solid #e3e6f0;
    border-radius: 2rem;
    color: #666;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s;
}

.tagcloud a:hover {
    background: #4e73df;
    color: white;
    border-color: #4e73df;
}

mark {
    background: #fef3cd;
    padding: 0.125rem 0.25rem;
    border-radius: 0.125rem;
}

.sidebar .nav-link {
    border-radius: 0;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
}

.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

.tox-tinymce {
    border-radius: 0.375rem !important;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .post-content {
        font-size: 1rem;
    }
    
    .sidebar.sticky-bar {
        position: static;
    }
}

.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25rem solid #f3f3f3;
    border-top: 0.25rem solid #4e73df;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.alert {
    border: none;
    border-radius: 0.5rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

.form-control:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-primary {
    background: #4e73df;
    border-color: #4e73df;
}

.btn-primary:hover {
    background: #2e59d9;
    border-color: #2653d4;
}

.table th {
    font-weight: 600;
    border-top: none;
}

/* ✅ ลบ "/" ที่หลุดออกมาแล้ว */
.dropdown-menu {
    border: none;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    border-radius: 0.5rem;
}

.modal-content {
    border: none;
    border-radius: 0.5rem;
}

.modal-header {
    border-bottom: 1px solid #e3e6f0;
}

.modal-footer {
    border-top: 1px solid #e3e6f0;
}

html { font-size: 150%; }