/* Import Noto Sans from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@300;400;500;600;700&display=swap');

/* Global Font Settings */
* {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

body {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* Blog Styles */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Search Styles */
#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

#search-results.hidden {
    display: none !important;
}

.search-result-item {
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background-color: #374151;
}

.search-result-item:last-child {
    border-bottom: none;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#search-input:focus::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Dark Theme Hover Effect */
.hover\:bg-gray-750:hover {
    background-color: #374151;
}

/* User Dropdown Styles */
.user-dropdown {
    transform: scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
}

.user-dropdown.show {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
}

/* Post Card Hover Effects */
.post-card {
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-2px);
}

/* CKEditor Custom Styles */
.ck-editor__editable {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.ck-editor__editable:focus {
    box-shadow: none;
    border-color: #3b82f6;
}

/* Modal Animation */
#post-modal {
    transition: opacity 0.3s ease;
}

#post-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

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

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Comment Styles */
.comment-item {
    transition: background-color 0.2s ease;
}

.comment-item:hover {
    background-color: #374151;
}

/* Button Hover Effects */
.btn-hover {
    transition: all 0.2s ease;
}

.btn-hover:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Form Focus Effects */
.form-focus:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .post-card {
        margin-bottom: 1rem;
    }
    
    #post-modal .relative {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

/* Main Section Management Scroll */
.section-posts-scroll {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
}

.section-posts-container {
    display: flex !important;
    flex-wrap: nowrap !important;
    min-width: max-content !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
}

.section-post-card {
    flex-shrink: 0 !important;
    width: 256px !important;
    min-width: 256px !important;
    max-width: 256px !important;
}

::-webkit-scrollbar-track {
    background: #374151;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Text Selection */
::selection {
    background-color: #3b82f6;
    color: white;
}

/* Focus Visible */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/Error Messages */
.message {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.message.success {
    background-color: #065f46;
    color: #d1fae5;
    border: 1px solid #047857;
}

.message.error {
    background-color: #991b1b;
    color: #fee2e2;
    border: 1px solid #dc2626;
}

.message.info {
    background-color: #1e40af;
    color: #dbeafe;
    border: 1px solid #2563eb;
}

/* Tag Styles */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #1e3a8a;
    color: #bfdbfe;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Author Badge */
.author-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: #374151;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

.author-badge img {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    margin-right: 0.25rem;
}

/* Post Meta */
.post-meta {
    font-size: 0.875rem;
    color: #9ca3af;
}

.post-meta i {
    margin-right: 0.25rem;
}

/* Editor Toolbar Customization */
.ck.ck-editor__top .ck-toolbar {
    border-radius: 0.5rem 0.5rem 0 0;
    border-color: #4b5563;
    background-color: #374151;
}

.ck.ck-editor__main .ck-editor__editable {
    border-radius: 0 0 0.5rem 0.5rem;
    border-color: #4b5563;
    background-color: #1f2937;
    color: #f9fafb;
}

/* Navigation Active State */
.nav-active {
    color: #60a5fa;
    font-weight: 600;
}

/* Dropdown Arrow */
.dropdown-arrow {
    transition: transform 0.2s ease;
}

.dropdown-arrow.rotate {
    transform: rotate(180deg);
}

/* Image Placeholder */
.image-placeholder {
    background: linear-gradient(45deg, #374151 25%, transparent 25%), 
                linear-gradient(-45deg, #374151 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #374151 75%), 
                linear-gradient(-45deg, transparent 75%, #374151 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Thumbnail Styles */
.thumbnail-preview {
    transition: all 0.3s ease;
}

.thumbnail-preview:hover {
    transform: scale(1.02);
}

.thumbnail-upload-area {
    transition: all 0.3s ease;
}

.thumbnail-upload-area:hover {
    border-color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.05);
}

/* Post Card Thumbnail */
.post-card .thumbnail-image {
    transition: all 0.3s ease;
}

.post-card:hover .thumbnail-image {
    transform: scale(1.05);
}

/* Detail Page Thumbnail */
#post-thumbnail {
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#post-thumbnail:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Right Sidebar Styles */
.sidebar-post-card {
    transition: all 0.3s ease;
}

.sidebar-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-post-card img {
    transition: all 0.3s ease;
}

.sidebar-post-card:hover img {
    transform: scale(1.05);
}

/* Sticky Sidebar */
.sticky {
    position: sticky;
    top: 2rem;
}

/* Responsive Sidebar */
@media (max-width: 1280px) {
    .xl\:block {
        display: none;
    }
}

/* Category Stats */
#category-stats .flex {
    transition: all 0.2s ease;
}

#category-stats .flex:hover {
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem;
}

#content-body {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
}

.p-6, #content-body {
    display: block !important;
    position: relative !important;
}

.admin-main-area {
    width: 100vw !important;
    min-width: 0 !important;
    overflow-x: auto !important;
    display: flex;
    flex-direction: column;
}

/* New Blog Card Design */
.blog-card {
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dark .blog-card {
    background: transparent;
}

.blog-card:hover {
    transform: translateY(-2px);
}

.blog-card-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card .blog-card-title,
.blog-card h3.blog-card-title {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    margin-bottom: 6px !important;
    line-height: 1.3 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.dark .blog-card .blog-card-title,
.dark .blog-card h3.blog-card-title {
    color: #e5e7eb !important;
}

.blog-card-summary {
    font-size: 12px !important;
    color: #6b7280;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.dark .blog-card-summary {
    color: #9ca3af;
}

/* Sidebar Blog Card Design */
.sidebar-blog-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    align-items: flex-start;
}

.dark .sidebar-blog-card {
    /* border-bottom-color: #374151; */
}

.sidebar-blog-card:hover {
    transform: translateY(-2px);
}

.dark .sidebar-blog-card:hover {
    /* background-color: #374151; */
}

.sidebar-blog-card:last-child {
    /* border-bottom: none; */
}

.sidebar-blog-image {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sidebar-blog-content {
    min-width: 0;
}

.sidebar-blog-card:hover .sidebar-blog-image {
    transform: scale(1.05);
}

.sidebar-blog-title,
.sidebar-blog-summary,
.sidebar-blog-subcategory-badge {
    display: block;
    margin: 0;
}

.sidebar-blog-subcategory-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 1px 6px;
    font-size: 9px;
    color: #6366f1;
    background: rgba(99,102,241,0.08);
    border-radius: 999px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.2;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dark .sidebar-blog-subcategory-badge {
    background: rgba(99,102,241,0.13);
    color: #a5b4fc;
}

.sidebar-blog-card .sidebar-blog-title,
.sidebar-blog-card h4.sidebar-blog-title {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #374151 !important;
    line-height: 1 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    margin: 0 !important;
}

.dark .sidebar-blog-card .sidebar-blog-title,
.dark .sidebar-blog-card h4.sidebar-blog-title {
    color: #e5e7eb !important;
}

.sidebar-blog-summary {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 !important;
}

.dark .sidebar-blog-summary {
    color: #9ca3af;
}

/* Grid Layout Improvements */
.grid > * {
    display: flex;
    flex-direction: column;
}

/* Responsive adjustments for blog cards */
@media (max-width: 640px) {
    .blog-card-title {
        font-size: 12px;
    }
    
    .blog-card-summary {
        font-size: 10px;
    }
}

@media (min-width: 1024px) {
    .blog-card-content {
        padding: 20px;
    }
    
    .blog-card-title {
        font-size: 18px;
    }
    
    .blog-card-summary {
        font-size: 15px;
    }
}

/* Default Avatar Styles */
.default-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
}

.default-avatar.small {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.625rem;
}

.default-avatar.medium {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

.default-avatar.large {
    width: 3rem;
    height: 3rem;
    font-size: 1rem;
}

/* Author Profile Styles */
.author-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.author-profile img {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    object-fit: cover;
}

.author-profile .default-avatar {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.625rem;
}

.author-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
}

.dark .author-name {
    color: #9ca3af;
}

/* Post Date Styles */
.post-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.dark .post-date {
    color: #9ca3af;
}

.post-date i {
    font-size: 0.75rem;
}

.sidebar-blog-title-number {
    color: #6366f1;
    font-weight: 700;
    margin-right: 2px;
    font-size: 13px;
    vertical-align: baseline;
    line-height: 1;
}

 