@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin-fast {
    animation: spin 0.8s linear infinite;
}

.svg-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    stroke-width: 0;
    stroke: currentColor;
    fill: currentColor;
    vertical-align: -0.125em;
}

/* Fix browser autofill background glitch by using a massive transparent transition */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: #111827 !important;
    transition: background-color 5000s ease-in-out 0s;
}

.dark input:-webkit-autofill,
.dark input:-webkit-autofill:hover,
.dark input:-webkit-autofill:focus,
.dark input:-webkit-autofill:active {
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

::selection {
    background-color: rgba(255, 69, 0, 0.2);
    color: inherit;
}

/* Ensure glass-panel still works if not in header */
.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .glass-panel {
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.font-bold {
    font-weight: 700 !important;
}

/* ── Modern list styling for rich content sections ── */
.rich-content ul {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rich-content li {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.625rem;
    padding: 0.125rem 0;
    line-height: 1.55;
}

.rich-content li::before {
    content: '';
    display: block;
    width: 6px;
    min-width: 6px;
    height: 6px;
    border-radius: 9999px;
    background-color: var(--brand);
    margin-top: 0.45rem;
    flex-shrink: 0;
    opacity: 0.85;
}

/* Blog post prose content */
.prose-content a {
    text-decoration: none !important;
}
.prose-content a:hover {
    text-decoration: none !important;
}
.prose-content p {
    margin-bottom: 1rem !important;
    line-height: 1.625 !important;
    color: #374151 !important; /* gray-700 */
}
.dark .prose-content p {
    color: #d1d5db !important; /* gray-300 */
}

.prose-content h2 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.5rem !important;
    color: #111827 !important; /* gray-900 */
}
.dark .prose-content h2 {
    color: #f9fafb !important;
}

.prose-content h3 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.5rem !important;
    color: #1f2937 !important;
}
.dark .prose-content h3 {
    color: #f3f4f6 !important;
}

/* Hide horizontal divider lines in markdown body for compact FDown.vn style */
.prose-content hr {
    display: none !important;
}

/* Bullet list overrides for normal list representation */
.prose-content ul {
    list-style-type: disc !important;
    padding-left: 1.5rem !important;
    margin-bottom: 1.25rem !important;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.prose-content li {
    display: list-item !important;
    list-style-type: disc !important;
    padding: 0 !important;
    line-height: 1.625 !important;
    color: #374151 !important;
}
.dark .prose-content li {
    color: #d1d5db !important;
}

.prose-content li::before {
    content: none !important;
    display: none !important;
}

/* Custom premium styling for tables inside blog posts */
.prose-content table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 1.5rem 0 !important;
    font-size: 0.95rem !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 1px solid #e5e7eb !important;
}
.dark .prose-content table {
    border-color: #374151 !important;
}

.prose-content th {
    background-color: #f3f4f6 !important;
    color: #374151 !important;
    font-weight: 700 !important;
    padding: 12px 16px !important;
    text-align: left !important;
    border-bottom: 2px solid #e5e7eb !important;
}
.dark .prose-content th {
    background-color: #1f2937 !important;
    color: #f3f4f6 !important;
    border-bottom-color: #374151 !important;
}

.prose-content td {
    padding: 12px 16px !important;
    border-bottom: 1px solid #f3f4f6 !important;
    color: #4b5563 !important;
}
.dark .prose-content td {
    border-bottom-color: #374151 !important;
    color: #d1d5db !important;
}

.prose-content tr:last-child td {
    border-bottom: none !important;
}

.prose-content tr:nth-child(even) {
    background-color: #f9fafb;
}
.dark .prose-content tr:nth-child(even) {
    background-color: rgba(31, 41, 55, 0.2);
}

/* ── Shimmer Animation for Thumbnails ── */
.shimmer {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 1000px 100%;
    display: block;
    position: relative;
    animation: shimmer 2s infinite linear;
}

.dark .shimmer {
    background: #1f2937;
    background-image: linear-gradient(to right, #1f2937 0%, #374151 20%, #1f2937 40%, #1f2937 100%);
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-thumb {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.loading-thumb.loaded {
    opacity: 1;
}

/* Rich Content Styling (Sub-pages) */
.rich-content ul {
    list-style: none !important;
    padding-left: 0 !important;
}

.rich-content li {
    display: flex !important;
    align-items: flex-start !important;
    gap: 1rem; /* Standardized gap */
    position: relative;
    padding-left: 0 !important;
    margin-bottom: 0.75rem;
}

/* Remove default bullets if any specifically for rich-content */
.rich-content li::before {
    content: none !important;
    display: none !important;
}

/* Premium Feature Cards */
.rich-content {
    display: grid !important;
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    gap: 1.5rem !important;
    margin-top: 1.5rem !important;
}

@media (min-width: 768px) {
    .rich-content {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

.rich-content.space-y-6 > * + * {
    margin-top: 0 !important;
}

.feature-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    padding: 1.5rem !important;
    background-color: #ffffff !important;
    border: 1px solid rgba(229, 231, 235, 0.8) !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.dark .feature-card {
    background-color: #1f2937 !important;
    border-color: rgba(55, 65, 81, 0.8) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2) !important;
}

.feature-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.03) !important;
    border-color: var(--brand) !important;
}

.feature-card svg {
    display: block !important;
    color: var(--brand, #E1306C) !important;
    background-color: var(--brand-light, rgba(225, 48, 108, 0.1)) !important;
    padding: 0.625rem !important;
    border-radius: 1rem !important;
    width: 2.75rem !important;
    height: 2.75rem !important;
    flex-shrink: 0 !important;
}

.feature-card .text-sm, 
.feature-card .text-base,
.feature-card div {
    display: block !important;
}

.feature-card strong {
    display: block !important;
    margin-bottom: 0.375rem !important;
    color: #111827 !important;
    font-weight: 800 !important;
    font-size: 1.125rem !important;
    line-height: 1.4 !important;
}

.dark .feature-card strong {
    color: #ffffff !important;
}

.feature-card::before {
    content: none !important;
}

.feature-card strong::after {
    content: none !important;
}

/* Precise Icon Alignment for first line of text */
.feature-card svg, 
.rich-content li svg {
    margin-top: 0.15rem; /* Optical alignment with text-base line height */
    flex-shrink: 0;
}

/* Styling for instruction keyboard/button badges similar to FDown.vn */
.step-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.2;
    color: #4b5563; /* gray-600 */
    background-color: #f9fafb; /* gray-50 */
    border: 1px solid #d1d5db; /* gray-300 */
    border-bottom: 2px solid #b5bac1; /* slightly darker bottom border for 3D key look */
    border-radius: 6px;
    font-family: system-ui, -apple-system, sans-serif;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
    margin: 0 2px;
    vertical-align: middle;
}

.dark .step-badge {
    color: #d1d5db; /* gray-300 */
    background-color: #1f2937; /* gray-800 */
    border-color: #4b5563; /* gray-600 */
    border-bottom: 2px solid #111827; /* gray-900 */
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

