body { font-family: 'Inter', sans-serif; }

body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container { max-width: 900px; }

.glass {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.2);
}

.dark .glass {
    background-color: rgba(0, 0, 0, 0.2);
}

.mobile-menu-overlay {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

/* Comments */
.highlight-comment {
    animation: highlightFade 3s ease-out forwards;
    background-color: rgba(99, 102, 241, 0.2);
    border: 1px solid #6366F1;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

@keyframes highlightFade {
    0% {
        background-color: rgba(99, 102, 241, 0.4);
    }
    100% {
        background-color: transparent;
    }
}

/* Spinner for buttons */
.spinner {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 2px solid #fff;
    width: 1em;
    height: 1em;
    -webkit-animation: spin 1s linear infinite;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5em;
}

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

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

/* :) */
.nickname {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Mobile comments horizontal scroll styles */
#comments-container {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    #comments-container {
        overflow-x: auto;
        overflow-y: visible;
        padding: 5px 0;
        font-size: 0.8rem;
    }

    #comments-container .border-l-2 {
        padding-left: 0.5rem; /* Reduced from pl-4 (1rem) */
        margin-left: 0.25rem;
    }

    /* Default width for 1 replies */
    #comments-container > div,
    #comments-container > ul,
    #comments-container > * {
        width: 100%;
    }
    /* Wider width when there is more than 1 reply */
    #comments-container.has-many-comments > div,
    #comments-container.has-many-comments > ul,
    #comments-container.has-many-comments > * {
        width: 700px;
    }

    #comments-container.has-many-comments {
        mask-image: linear-gradient(
            to right,
            black 0%,
            black 88%,
            transparent 100%
        );
        -webkit-mask-image: linear-gradient(
            to right,
            black 0%,
            black 88%,
            transparent 100%
        );
    }
}

/* NSFW overlay */
body.nsfw-locked {
    overflow: hidden;
}

/* Image embedding */
.embedded-media.embedded-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 5px auto;
    object-fit: contain;
    width: 100%;
}

.image-container {
    max-height: 640px;
    overflow: hidden;
}

.image-container .embedded-media.embedded-image {
    max-height: 100%;
    width: auto;
}

/* User mentions */
.mentions-dropdown {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #90A1B9;
    border: 1px solid #ccc;
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
}

.mentions-dropdown li {
    padding: 4px 8px;
    cursor: pointer;
}

.mentions-dropdown li:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Card-Style Posts */
.post-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

/* Line clamp for post excerpts */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Avatar gradient variations (optional - for more variety) */
.post-card .w-10.h-10.rounded-full {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Interactive elements in cards */
.post-card a:hover,
.post-card button:hover {
    opacity: 0.8;
}

/* Post vote button styling for cards */
.post-vote-btn {
    cursor: pointer;
}

.post-vote-btn:active {
    transform: scale(0.95);
}

/* Responsive adjustments for cards */
@media (max-width: 640px) {
    .post-card h3 {
        font-size: 1rem;
    }
}

/* Dark mode specific adjustments */
@media (prefers-color-scheme: dark) {
    .post-card {
        background-color: rgb(31 41 55);
        border-color: rgb(55 65 81);
    }
}

/* Print styles */
@media print {
    .post-card .flex.items-center.justify-between.pt-3 {
        display: none !important;
    }
}
