/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    color: #1a202c;
    background-color: #f7fafc;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Flexbox */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

/* Spacing */
.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-6 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.p-6 {
    padding: 1.5rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Colors */
.bg-white {
    background-color: #ffffff;
}

.bg-blue-600 {
    background-color: #3182ce;
}

.bg-gray-800 {
    background-color: #2d3748;
}

.text-white {
    color: #ffffff;
}

.text-blue-600 {
    color: #3182ce;
}

.text-gray-600 {
    color: #718096;
}

.text-gray-700 {
    color: #4a5568;
}

.hover\:text-blue-800:hover {
    color: #2c5282;
}

.hover\:bg-blue-700:hover {
    background-color: #2b6cb0;
}

/* Typography */
.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 1.875rem;
}

.font-bold {
    font-weight: 700;
}

/* Layout */
.min-h-screen {
    min-height: 100vh;
}

.rounded {
    border-radius: 0.25rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Grid */
.grid {
    display: grid;
}

.gap-6 {
    gap: 1.5rem;
}

/* Responsive */
@media (min-width: 768px) {
    .md\:flex {
        display: flex;
    }

    .md\:flex-row {
        flex-direction: row;
    }

    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:hidden {
        display: none;
    }

    .md\:mt-0 {
        margin-top: 0;
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lg\:col-span-2 {
        grid-column: span 2 / span 2;
    }

    .lg\:col-span-1 {
        grid-column: span 1 / span 1;
    }
}

/* HTMX indicator */
.htmx-indicator {
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator {
    opacity: 1;
    pointer-events: auto;
}

.htmx-request.htmx-indicator {
    opacity: 1;
    pointer-events: auto;
}

/* Styles for inline emotes in comments */
.inline-emote {
    max-height: 1.5em;
    /* Adjust to match surrounding text size */
    width: auto;
    /* Maintain aspect ratio */
    vertical-align: middle;
    /* Align vertically with text */
    margin: 0 0.1em;
    /* Add slight horizontal spacing */
    display: inline-block;
    /* Ensure proper alignment and spacing */
}

/* Styling for AI Generated Images */
.ai-generated-image {
    position: relative;
    /* Positioning context for watermark */
    padding: 5px;
    /* Increased padding for a broader border */
    border-radius: 0.7rem;
    /* Slightly larger radius */
    overflow: hidden;
    /* Keep gradient contained */
    background: linear-gradient(135deg, #A855F7, #6366F1, #EC4899);
    /* Example: Purple, Indigo, Pink */
    box-sizing: border-box;
    display: flex;
    /* Add a subtle glow effect using box-shadow */
    box-shadow: 0 0 12px 2px rgba(129, 140, 248, 0.4);
    /* Indigo-300 at 40% opacity */
}

/* Ensure the image itself fills the padded container and has its own radius */
.ai-generated-image img {
    /* The image should fill the container up to the padding */
    width: 100%;
    height: 100%;
    /* Apply border-radius to the image itself, adjusted for the new padding */
    border-radius: calc(0.7rem - 5px);
    display: block;
    /* Prevents potential small gap below image */
    /* object-fit: cover; /* Should be inherited or set in template */
}

/* Watermark Styles */
.ai-generated-image::after {
    content: "✨ AI Generated";
    position: absolute;
    bottom: 10px;
    /* Slightly more padding from edge */
    right: 10px;
    /* Slightly more padding from edge */
    background-color: rgba(255, 255, 255, 0.85);
    /* Whitish/Opaque background */
    color: #374151;
    /* Darker Gray (Tailwind gray-700) for contrast */
    padding: 5px 10px;
    /* Increase padding */
    border-radius: 6px;
    /* Slightly larger radius */
    font-size: 0.875rem;
    /* Larger font size (Tailwind text-sm) */
    font-weight: 600;
    /* Semi-bold */
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    /* Optional subtle shadow */
}

/* Remove hover effect for border, as background handles visual interest */
/* .ai-generated-image:hover {
    border-color: #7C3AED;
} */

/* Compact AI Generated Image - Same gradient border, no text badge */
.ai-generated-image-compact {
    position: relative;
    padding: 3px; /* Slightly smaller padding for compact view */
    border-radius: 0.5rem; /* Smaller radius for compact */
    overflow: hidden;
    background: linear-gradient(135deg, #A855F7, #6366F1, #EC4899);
    box-sizing: border-box;
    display: flex;
    box-shadow: 0 0 8px 1px rgba(129, 140, 248, 0.3); /* Smaller glow for compact */
}

.ai-generated-image-compact img {
    width: 100%;
    height: 100%;
    border-radius: calc(0.5rem - 3px);
    display: block;
}

/* No ::after pseudo-element for compact version - no text badge */

/* Styles for clipboard copy feedback on emote guide */
.emote-copy-trigger.copied-feedback {
    /* Example: Add a green border or background */
    border-color: #4ade80;
    /* Tailwind green-400 */
    background-color: #f0fdf4;
    /* Tailwind green-50 */
}

/* Dark mode styles for clipboard feedback */
.dark .emote-copy-trigger.copied-feedback {
    border-color: #4ade80;
    /* Tailwind green-400 */
    background-color: #166534;
    /* Tailwind green-800 */
}

/* Emote Picker Styles */
.emote-picker-popup {
    display: flex;
    flex-direction: column;
    max-height: 15rem;
    overflow-y: auto;
    justify-content: flex-start;
    /* Make sure the flex container starts from top */
    flex-flow: column nowrap;
    /* Add width auto for content-based sizing */
    width: auto;
}

/* Width utility classes for emote picker */
.min-w-48 {
    min-width: 12rem;
    /* 48 / 4 = 12rem */
}

.max-w-80 {
    max-width: 20rem;
    /* 80 / 4 = 20rem */
}

/* Ensure inline emotes within picker list are sized appropriately */
.emote-picker-list-item img.inline-emote {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

/* Lightweight shimmer placeholder for image containers */
.image-skeleton {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%);
    background-size: 400% 400%;
    animation: image-skeleton-shimmer 1.4s ease infinite;
}

@keyframes image-skeleton-shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}