/* AIO Conquer Blog - Plain CSS (no @apply) */

/* === CUSTOM VARIABLES === */
:root {
    --aio-primary: #0ea5e9;
    --aio-primary-dark: #0284c7;
    --aio-secondary: #64748b;
    --shadow-soft: 0 1px 3px 0 rgba(0, 0, 0, .1), 0 1px 2px 0 rgba(0, 0, 0, .06);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);
    --shadow-large: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);
    --transition-smooth: all .3s cubic-bezier(.4, 0, .2, 1);
}

/* === RESET & BASE === */
* {
    scroll-behavior: smooth
}

body {
    font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .5
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.animate-fadeIn {
    animation: fadeIn .6s ease-out forwards
}

.animate-slideIn {
    animation: slideIn .5s ease-out forwards
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite
}

.animate-spin {
    animation: spin 1s linear infinite
}

/* === FLASH MESSAGES === */
.flash-message {
    animation: slideIn .5s ease-out;
    position: relative;
    overflow: hidden
}

.flash-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 4px;
    background: currentColor
}

/* === FORM STYLES === */
.form-group {
    margin-bottom: 1.5rem
}

.form-input {
    display: block;
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: .5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    transition: color .2s, background-color .2s, border-color .2s, box-shadow .2s;
}

.form-input::placeholder {
    color: #9ca3af
}

.form-input:focus {
    outline: 0;
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .5), 0 1px 2px 0 rgb(0 0 0 / .05);
}

.form-input-error {
    border-color: #ef4444;
}

.form-input-error:focus {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, .5);
}

.form-label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: .5rem;
}

.form-help {
    font-size: .75rem;
    color: #6b7280;
    margin-top: .25rem
}

.form-error {
    font-size: .875rem;
    color: #dc2626;
    margin-top: .25rem
}

.form-textarea {
    display: block;
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: .5rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
    resize: vertical;
    min-height: 120px;
    transition: color .2s, background-color .2s, border-color .2s, box-shadow .2s;
}

/* === BUTTON STYLES === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5rem 1rem;
    border: 1px solid transparent;
    border-radius: .5rem;
    font-weight: 500;
    font-size: .875rem;
    cursor: pointer;
    outline: 0;
    transition: transform .2s, background-color .2s, color .2s, border-color .2s, box-shadow .2s;
}

.btn:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .5)
}

.btn:active {
    transform: scale(.95)
}

.btn-primary {
    background: #2563eb;
    color: #fff
}

.btn-primary:hover {
    background: #1d4ed8
}

.btn-secondary {
    background: #4b5563;
    color: #fff
}

.btn-secondary:hover {
    background: #374151
}

.btn-success {
    background: #16a34a;
    color: #fff
}

.btn-success:hover {
    background: #15803d
}

.btn-danger {
    background: #dc2626;
    color: #fff
}

.btn-danger:hover {
    background: #b91c1c
}

.btn-warning {
    background: #ca8a04;
    color: #fff
}

.btn-warning:hover {
    background: #a16207
}

.btn-outline {
    background: transparent;
    border-color: #d1d5db;
    color: #374151;
}

.btn-outline:hover {
    background: #f9fafb
}

.btn-lg {
    padding: .75rem 1.5rem;
    font-size: 1rem
}

.btn-sm {
    padding: .375rem .75rem;
    font-size: .75rem
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none
}

.btn-loading {
    opacity: .75;
    cursor: not-allowed
}

/* === CARD STYLES === */
.card {
    background: #fff;
    border-radius: .5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb
}

.card-body {
    padding: 1.5rem
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb
}

.card-hover {
    transition: transform .3s, box-shadow .3s
}

.card-hover:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-4px)
}

/* === POST STYLES === */
.post-card {
    background: #fff;
    border-radius: .5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: transform .3s, box-shadow .3s
}

.post-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-4px)
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .875rem;
    color: #6b7280
}

.post-content {
    max-width: none
}

.post-content h1 {
    font-size: 2rem;
    font-weight: bold;
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    color: #111827;
}

.post-content h2 {
    font-size: 1.75rem;
    font-weight: bold;
    margin: 1.25rem 0 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #e5e7eb;
    color: #1f2937;
}

.post-content h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 1rem 0 0.5rem;
    color: #374151;
}

.post-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0.875rem 0 0.5rem;
    color: #4b5563;
}

.post-content h5 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0.75rem 0 0.5rem;
    color: #6b7280;
}

.post-content h6 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.5rem 0 0.5rem;
    color: #6b7280;
    font-style: italic;
}

.post-content p {
    margin-left: 2px;
    line-height: 1.7;
    margin-bottom: 1rem;
}

#renderedView h1 {
    font-size: 2rem;
    font-weight: bold;
}

#renderedView h2 {
    font-size: 1.75rem;
    font-weight: bold;
}

#renderedView h3 {
    font-size: 1.5rem;
    font-weight: bold;
}

#renderedView h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0.875rem 0 0.5rem;
    color: #4b5563;
}

#renderedView h5 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0.75rem 0 0.5rem;
    color: #6b7280;
}

#renderedView h6 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.5rem 0 0.5rem;
    color: #6b7280;
    font-style: italic;
}



.post-content p {
    margin-left: 2px;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Unordered lists */
.post-content ul {
    list-style-type: disc;
    padding-left: 2rem;
    margin: 1rem 0;
}

.post-content ul li {
    margin-bottom: 0.5rem;
}

.post-content ul ul {
    list-style-type: circle;
    margin-top: 0.5rem;
}

/* Ordered lists */
.post-content ol {
    list-style-type: decimal;
    padding-left: 2rem;
    margin: 1rem 0;
}

.post-content ol li {
    margin-bottom: 0.5rem;
}

.post-content ol ol {
    list-style-type: lower-alpha;
    margin-top: 0.5rem;
}

/* Links */
.post-content a {
    color: #1f2e48;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.post-content a:after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background-color: #3b4c6a;
    transition: width 0.3s ease;

}

.post-content a:hover {
    color: #313b4b;
}

.post-content a:hover::after {
    width: 100%;
}

/* Tables */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    border: 1px solid #d1d5db;
}

.post-content table th {
    background-color: #f3f4f6;
    font-weight: 600;
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #d1d5db;
}

.post-content table td {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
}

.post-content table tr:nth-child(even) {
    background-color: #f9fafb;
}

.post-content table tr:hover {
    background-color: #f3f4f6;
}

/* Code blocks */
.post-content code:not(pre code) {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #ef4444;
}

.post-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
}

.post-content pre code {
    color: #f9fafb;
    background: transparent;
}

/* Blockquotes */
.post-content blockquote {
    border-left: 2px solid #1d232d;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #676f80;
}

/* Images */
.post-content img {
    max-width: 100%;
    border-radius: 6px;
    margin: 1rem 0;
}



/* Strong/Bold */
.post-content strong {
    font-weight: 600;
    color: #111827;
}

/* Emphasis/Italic */
.post-content em {
    font-style: italic;
}

/* Strikethrough */
.post-content del {
    text-decoration: line-through;
    color: #6b7280;
}

/* Math display mode */
.post-content .katex-display {
    margin: 1rem 0;
    overflow-x: auto;
    overflow-y: hidden;
}

/* === TAG STYLES === */
.tag {
    display: inline-flex;
    align-items: center;
    padding: .125rem .625rem;
    border-radius: 9999px;
    font-size: .75rem;
    font-weight: 500
}

.tag-primary {
    background: #dbeafe;
    color: #1e40af
}

.tag-secondary {
    background: #f3f4f6;
    color: #1f2937
}

.tag-success {
    background: #dcfce7;
    color: #166534
}

.tag-warning {
    background: #fef3c7;
    color: #92400e
}

.tag-danger {
    background: #fee2e2;
    color: #991b1b
}

/* === COMMENT STYLES === */
.comment {
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    padding: 1rem;
    margin-bottom: 1rem
}

.comment.is-reply {
    margin-left: 2rem;
    border-left: 4px solid #bfdbfe
}

.comment-author {
    font-weight: 600;
    color: #111827
}

.comment-author.is-post-author {
    color: #2563eb
}

.comment-author.is-post-author::after {
    content: ' (Tác giả)';
    font-size: .75rem;
    background: #dbeafe;
    color: #2563eb;
    padding: .125rem .5rem;
    border-radius: 9999px;
    margin-left: .5rem;
}

.comment-meta {
    font-size: .875rem;
    color: #6b7280;
    margin: .25rem 0 .5rem
}

.comment-content {
    color: #374151;
    line-height: 1.75
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid #f3f4f6
}

/* === EDITOR STYLES === */
.editor-container {
    border: 1px solid #d1d5db;
    border-radius: .5rem;
    overflow: hidden
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb
}

.editor-toolbar button {
    padding: .5rem;
    border-radius: .375rem;
    color: #4b5563;
    background: transparent;
    border: 0;
    transition: background-color .2s, color .2s;
}

.editor-toolbar button:hover {
    color: #111827;
    background: #e5e7eb
}

.editor-toolbar button.active {
    color: #2563eb;
    background: #dbeafe
}

.editor-content {
    min-height: 400px
}

.editor-textarea {
    width: 100%;
    height: 100%;
    padding: 1rem;
    border: 0;
    resize: none;
    outline: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: .875rem;
}

.editor-preview {
    padding: 1rem
}

/* === NOTIFICATION STYLES === */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem;
    transition: background-color .2s
}

.notification-item:hover {
    background: #f9fafb
}

.notification-item.unread {
    background: #eff6ff
}

.notification-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem
}

.notification-icon.success {
    background: #dcfce7;
    color: #16a34a
}

.notification-icon.info {
    background: #dbeafe;
    color: #2563eb
}

.notification-icon.warning {
    background: #fef3c7;
    color: #ca8a04
}

.notification-icon.error {
    background: #fee2e2;
    color: #dc2626
}

.notification-content {
    flex: 1;
    min-width: 0
}

.notification-title {
    font-size: .875rem;
    font-weight: 600;
    color: #111827
}

.notification-message {
    font-size: .875rem;
    color: #4b5563;
    margin-top: .25rem
}

.notification-time {
    font-size: .75rem;
    color: #6b7280;
    margin-top: .25rem
}

/* === DASHBOARD STYLES === */
.dashboard-stat {
    background: #fff;
    padding: 1.5rem;
    border-radius: .5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid #e5e7eb
}

.dashboard-stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem
}

.dashboard-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-top: 1rem
}

.dashboard-stat-label {
    font-size: .875rem;
    color: #4b5563;
    margin-top: .25rem
}

.dashboard-stat-change {
    font-size: .75rem;
    margin-top: .5rem
}

.dashboard-stat-change.positive {
    color: #16a34a
}

.dashboard-stat-change.negative {
    color: #dc2626
}

/* === PAGINATION STYLES === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: 2rem
}

.pagination a,
.pagination span {
    padding: .5rem .75rem;
    border: 1px solid #d1d5db;
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 500;
    transition: background-color .2s, color .2s;
}

.pagination a {
    color: #374151
}

.pagination a:hover {
    background: #f9fafb;
    color: #111827
}

.pagination .current {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb
}

.pagination .disabled {
    color: #9ca3af;
    cursor: not-allowed
}

/* === LOADING STYLES === */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #d1d5db;
    border-top-color: #2563eb;
    border-radius: 9999px;
    animation: spin 1s linear infinite;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}

.loading-content {
    background: #fff;
    padding: 2rem;
    border-radius: .75rem;
    box-shadow: var(--shadow-large);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.skeleton {
    animation: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;
    background: #e5e7eb;
    border-radius: .25rem
}

.skeleton-text {
    height: 1rem;
    background: #e5e7eb;
    border-radius: .25rem
}

.skeleton-avatar {
    width: 2.5rem;
    height: 2.5rem;
    background: #e5e7eb;
    border-radius: 9999px
}

/* === DROPDOWN STYLES === */
.dropdown {
    position: relative
}

.dropdown-content {
    position: absolute;
    right: 0;
    margin-top: .5rem;
    width: 14rem;
    background: #fff;
    border-radius: .5rem;
    box-shadow: var(--shadow-large);
    border: 1px solid #e5e7eb;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: scale(.95);
    transition: opacity .2s, transform .2s, visibility .2s;
}

.dropdown.active .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: scale(1)
}

/* === MODAL STYLES === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}

.modal-content {
    background: #fff;
    border-radius: .5rem;
    box-shadow: var(--shadow-large);
    max-width: 32rem;
    width: 100%;
    max-height: 100vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827
}

.modal-close {
    color: #9ca3af;
    transition: color .2s
}

.modal-close:hover {
    color: #4b5563
}

.modal-body {
    padding: 1.5rem
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb
}

/* === RESPONSIVE UTILITIES === */
@media (max-width:640px) {
    .card-body {
        padding: 1rem
    }

    .btn {
        width: 100%;
        justify-content: center
    }

    .post-content {
        font-size: .875rem
    }
}

/* === DARK MODE SUPPORT === */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background: #111827;
        color: #f3f4f6
    }

    .dark-mode .card {
        background: #1f2937;
        border-color: #374151
    }

    .dark-mode .form-input {
        background: #1f2937;
        border-color: #4b5563;
        color: #f3f4f6
    }
}

/* === PRINT STYLES === */
@media print {
    .no-print {
        display: none !important
    }

    .print-break {
        page-break-before: always
    }
}

/* === ACCESSIBILITY === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus-visible {
    outline: 0;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .5), 0 0 0 4px #fff
}

/* === CUSTOM SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px
}

::-webkit-scrollbar-track {
    background: #f3f4f6
}

::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 9999px
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280
}

/* === SELECTION STYLES === */
::selection {
    background: #bfdbfe;
    color: #1e3a8a
}

::-moz-selection {
    background: #bfdbfe;
    color: #1e3a8a
}

/* 
avatar */
/* Avatar styles */
.avatar-container {
    position: relative;
    display: inline-block;
}

.avatar-img {
    transition: all 0.3s ease;
}

.avatar-img:hover {
    transform: scale(1.05);
}

.avatar-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.avatar-container:hover .avatar-upload-overlay {
    opacity: 1;
}

.avatar-xs {
    width: 24px;
    height: 24px;
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-md {
    width: 48px;
    height: 48px;
}

.avatar-lg {
    width: 64px;
    height: 64px;
}

.avatar-xl {
    width: 96px;
    height: 96px;
}

.avatar-2xl {
    width: 128px;
    height: 128px;
}

/* File upload styles */
.file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

.file-upload-area.dragover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* Loading animation */
@keyframes pulse-avatar {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.avatar-loading {
    animation: pulse-avatar 1.5s ease-in-out infinite;
}

/* Image preview modal */
.image-preview-modal {
    backdrop-filter: blur(4px);
}

/* Notification styles */
.notification-slide-in {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-slide-out {
    animation: slideOutRight 0.3s ease-out forwards;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}