.loading-spinner::after {
    content: " ";
    display: block;
    width: 24px;
    height: 24px;
    margin: 10px auto;
    border-radius: 50%;
    border: 2px solid #ccc;
    border-color: #ccc transparent #ccc transparent;
    animation: lds-dual-ring 1.2s linear infinite;
}

@keyframes lds-dual-ring {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1; /* slate-300 */
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; /* slate-400 */
}

/* Dark Mode Scrollbar */
.dark ::-webkit-scrollbar-track {
    background: transparent;
}
.dark ::-webkit-scrollbar-thumb {
    background: #4b5563; /* gray-600 */
    border-radius: 10px;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280; /* gray-500 */
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Responsive Video Container (16:9 aspect ratio) */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 1rem 0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Post Images */
.post-image {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: block;
}

/* Post Links */
.post-link {
    color: #2563eb;
    text-decoration: underline;
    word-break: break-all;
}
.post-link:hover {
    color: #1d4ed8;
}

/* Link Preview Card */
.link-preview {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-top: 1rem;
    background: #fff;
    transition: all 0.2s;
    text-decoration: none !important;
    display: block;
}

.link-preview:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Dark Mode Overrides for Link Preview to support CSS fallback if Tailwind fails */
.dark .link-preview {
    background: #1f2937;
    border-color: #374151;
}
.dark .link-preview:hover {
    background: #111827;
}
