/* START: public/css/spotterpost.css */

/* Modern CSS Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --gold-gradient: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    --shadow-light: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Dark Mode Variables */
[data-bs-theme="dark"] {
    --bg-primary: #0a101e; /* Dark blue background like welcome page */
    --bg-secondary: #1a2332;
    --bg-tertiary: #2a3441;
    --text-primary: #ffffff; /* White text everywhere */
    --text-secondary: #ffffff; /* White text everywhere */
    --text-muted: #ffffff; /* White text everywhere */
    --border-color: #2a3441;
    --card-bg: #1a2332;
}

/* Dark Mode Styles for SpotterPost */
[data-bs-theme="dark"] .spotterpost-mobile-nav {
    background: rgba(10, 16, 30, 0.95) !important; /* Dark blue background */
    border-top-color: #2a3441 !important;
}

[data-bs-theme="dark"] .spotterpost-mobile-nav .nav-link {
    color: #ffffff !important; /* White text */
}

[data-bs-theme="dark"] .spotterpost-mobile-nav .nav-link.active,
[data-bs-theme="dark"] .spotterpost-mobile-nav .nav-link:hover {
    color: #667eea !important;
}

[data-bs-theme="dark"] .post-card,
[data-bs-theme="dark"] .content-section,
[data-bs-theme="dark"] .dashboard-card {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
    color: #ffffff !important; /* Force white text */
}

/* SpotterPost specific dark mode styles */
[data-bs-theme="dark"] .post-content,
[data-bs-theme="dark"] .post-meta,
[data-bs-theme="dark"] .post-text,
[data-bs-theme="dark"] .post-author,
[data-bs-theme="dark"] .post-time,
[data-bs-theme="dark"] .post-body,
[data-bs-theme="dark"] .post-header {
    color: #ffffff !important; /* White text in all post elements */
}

[data-bs-theme="dark"] .post-card {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

/* Force all text in SpotterPost to be white, except buttons and role-colored usernames */
[data-bs-theme="dark"] .spotterpost-mobile-nav *:not(.btn):not(.btn *):not(.username-with-flair),
[data-bs-theme="dark"] .post-card *:not(.btn):not(.btn *):not(.username-with-flair),
[data-bs-theme="dark"] .content-section *:not(.btn):not(.btn *):not(.username-with-flair) {
    color: #ffffff !important;
}

/* Keep button text dark on light buttons - more specific selectors */
[data-bs-theme="dark"] .btn-light,
[data-bs-theme="dark"] .btn-light *,
[data-bs-theme="dark"] .btn-outline-light,
[data-bs-theme="dark"] .btn-outline-light *,
[data-bs-theme="dark"] .btn-secondary,
[data-bs-theme="dark"] .btn-secondary *,
[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .btn-outline-secondary * {
    color: #000000 !important; /* Dark text on light buttons */
}

/* OVERRIDE SpotterPost's hardcoded button styles for dark mode - MAXIMUM SPECIFICITY */
[data-bs-theme="dark"] .post-actions .action-button,
[data-bs-theme="dark"] .post-actions .action-button *,
[data-bs-theme="dark"] .post-actions .action-button i,
[data-bs-theme="dark"] .post-actions .action-button span {
    color: #000000 !important; /* Force dark text on action buttons */
}

[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .btn-outline-secondary *,
[data-bs-theme="dark"] .btn-outline-secondary i,
[data-bs-theme="dark"] .btn-outline-secondary span {
    color: #000000 !important; /* Force dark text on outline secondary buttons */
}

/* NUCLEAR OPTION: Override ALL button text in SpotterPost */
[data-bs-theme="dark"] .spotterpost-card .btn,
[data-bs-theme="dark"] .spotterpost-card .btn *,
[data-bs-theme="dark"] .post-card .btn,
[data-bs-theme="dark"] .post-card .btn * {
    color: #000000 !important;
}

/* EXCEPTION: Keep heart icons red when liked */
[data-bs-theme="dark"] .action-button.liked i.bi-heart-fill,
[data-bs-theme="dark"] .action-button i.bi-heart-fill.text-danger,
[data-bs-theme="dark"] .comment-like-button i.bi-heart-fill,
[data-bs-theme="dark"] .like-button i.bi-heart-fill {
    color: #dc3545 !important; /* Keep red color for liked hearts */
}

/* Dark mode for nested comment replies */
[data-bs-theme="dark"] .comment-replies {
    background-color: var(--card-bg) !important;
    border-left-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .comment-replies .comment-body {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .comment-replies .comment-body * {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .comment-replies .reply-form-container {
    background-color: var(--card-bg) !important;
}

[data-bs-theme="dark"] .comment-replies .reply-form-container * {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .comment-replies .reply-text-input,
[data-bs-theme="dark"] .reply-form-container .reply-text-input {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-color: var(--border-color, rgba(102, 126, 234, 0.3)) !important;
}

[data-bs-theme="dark"] .comment-replies .reply-text-input::placeholder,
[data-bs-theme="dark"] .reply-form-container .reply-text-input::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

[data-bs-theme="dark"] .reply-text-input:focus {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(102, 126, 234, 0.5) !important;
}

/* Dark mode for reply form buttons - override NUCLEAR OPTION */
[data-bs-theme="dark"] .reply-form-container .reply-form-btn,
[data-bs-theme="dark"] .reply-form-container .reply-form-btn *,
[data-bs-theme="dark"] .reply-form-container .reply-form-btn i,
[data-bs-theme="dark"] .reply-form-container .reply-form-btn span {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .reply-form-container .reply-form-btn:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .reply-form-container .reply-submit-btn,
[data-bs-theme="dark"] .reply-form-container .reply-submit-btn * {
    background: var(--primary-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%)) !important;
    color: #ffffff !important;
    border: none !important;
}

/* Dark mode for main comments */
[data-bs-theme="dark"] .comment-body {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .comment-body * {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .comment-textarea {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .comment-textarea::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Ensure main comment form has same styling as nested replies */
[data-bs-theme="dark"] .comment-form .comment-textarea {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .comment-form .comment-textarea::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Dark mode for mention suggestions - FORCE with hardcoded colors */
[data-bs-theme="dark"] .mention-suggestion {
    background-color: #1a2332 !important; /* Hardcoded dark background */
    color: #ffffff !important;
    border-bottom-color: #2a3441 !important;
}

[data-bs-theme="dark"] .mention-suggestion:hover {
    background-color: #2a3441 !important; /* Hardcoded hover background */
}

[data-bs-theme="dark"] .mention-suggestion .mention-username {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .mention-suggestion .mention-name {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .comment-mention-suggestions,
[data-bs-theme="dark"] .reply-mention-suggestions {
    background: #1a2332 !important; /* Hardcoded dark background */
    border-color: #2a3441 !important;
    color: #ffffff !important;
}

/* COMPREHENSIVE DARK MODE FOR ALL COMMENT AREAS */
/* Comment action buttons (like, reply) */
[data-bs-theme="dark"] .comment-like-button,
[data-bs-theme="dark"] .reply-button {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .comment-like-button:hover,
[data-bs-theme="dark"] .reply-button:hover {
    color: #0d6efd !important;
}

[data-bs-theme="dark"] .comment-like-button .comment-like-count,
[data-bs-theme="dark"] .reply-button span {
    color: #ffffff !important;
}

/* Comment text content */
[data-bs-theme="dark"] .comment-text {
    color: #ffffff !important;
}

/* Comment meta (author, timestamp) */
[data-bs-theme="dark"] .comment-meta,
[data-bs-theme="dark"] .comment-meta a {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .comment-meta .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Comment actions container */
[data-bs-theme="dark"] .comment-actions {
    border-top-color: var(--border-color) !important;
}

/* Comment form buttons (emoji, gif, image) */
[data-bs-theme="dark"] .comment-emoji-btn,
[data-bs-theme="dark"] .reply-emoji-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--border-color) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .comment-emoji-btn:hover,
[data-bs-theme="dark"] .reply-emoji-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

/* Character count text */
[data-bs-theme="dark"] .comment-char-count,
[data-bs-theme="dark"] .reply-char-count {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Comments section background (isolated post view) - FORCE with hardcoded colors */
[data-bs-theme="dark"] .comments-section {
    background: #1a2332 !important; /* Hardcoded dark background */
    border-color: #2a3441 !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .comments-section h5 {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .comments-section .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

[data-bs-theme="dark"] .comments-section * {
    color: #ffffff !important; /* Force all text in comments section to be white */
}

/* FORCE main comment textarea text to be white in dark mode */
[data-bs-theme="dark"] .comment-textarea {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--border-color) !important;
}

[data-bs-theme="dark"] .comment-textarea::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Override any inline styles that might be setting text color */
[data-bs-theme="dark"] .comment-textarea[style*="color"] {
    color: #ffffff !important;
}

/* NUCLEAR OPTION: Force ALL elements in comments section to be dark */
[data-bs-theme="dark"] .comments-section,
[data-bs-theme="dark"] .comments-section *,
[data-bs-theme="dark"] .comments-section div,
[data-bs-theme="dark"] .comments-section span,
[data-bs-theme="dark"] .comments-section p,
[data-bs-theme="dark"] .comments-section h1,
[data-bs-theme="dark"] .comments-section h2,
[data-bs-theme="dark"] .comments-section h3,
[data-bs-theme="dark"] .comments-section h4,
[data-bs-theme="dark"] .comments-section h5,
[data-bs-theme="dark"] .comments-section h6 {
    background-color: #1a2332 !important;
    color: #ffffff !important;
    border-color: #2a3441 !important;
}

/* NUCLEAR OPTION: Force ALL mention suggestion elements to be dark */
[data-bs-theme="dark"] .comment-mention-suggestions,
[data-bs-theme="dark"] .comment-mention-suggestions *,
[data-bs-theme="dark"] .comment-mention-suggestions div,
[data-bs-theme="dark"] .comment-mention-suggestions span,
[data-bs-theme="dark"] .comment-mention-suggestions img {
    background-color: #1a2332 !important;
    color: #ffffff !important;
    border-color: #2a3441 !important;
}

[data-bs-theme="dark"] .btn-light:hover,
[data-bs-theme="dark"] .btn-light:hover *,
[data-bs-theme="dark"] .btn-outline-light:hover,
[data-bs-theme="dark"] .btn-outline-light:hover *,
[data-bs-theme="dark"] .btn-secondary:hover,
[data-bs-theme="dark"] .btn-secondary:hover *,
[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-secondary:hover * {
    color: #000000 !important; /* Keep dark text on hover */
}
/* General body/navbar padding (if specific to SpotterPost, otherwise move to global app.css) */
/* body {
    padding-top: 56px; 
}
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030;
} */

/* Refresh button (if specific to SpotterPost) */
.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.last-refreshed {
    font-size: 0.8rem;
    color: #6c757d;
    margin-left: 10px;
}

/* Emoji Picker Styles (from spotterpost::feeds.layouts.app.blade.php and existing spotterpost.css) */
.emoji-picker-container {
    position: relative;
}

/* Repost: immediate feedback animation */
.action-button.repost-just-did {
    animation: spotterpostRepostPop 0.55s ease-out;
}
.action-button.repost-just-did i.bi-arrow-repeat {
    animation: spotterpostRepostSpin 0.55s ease-out;
}
@keyframes spotterpostRepostPop {
    0% { transform: scale(1); }
    35% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
@keyframes spotterpostRepostSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Reply emoji picker: prevent nested scrollbars.
   Let the grid scroll, not the container. */
.reply-emoji-picker-container {
    overflow: hidden !important;
}
.reply-emoji-picker-container .emoji-grid {
    overflow-y: auto;
    max-height: 185px; /* matches typical picker content area */
}

/* Non-mobile emoji picker styling */
@media (min-width: 769px) {
    emoji-picker {
        position: absolute;
        bottom: calc(100% + 5px); /* 5px above the bottom of its container */
        right: 0;
        z-index: 10500; /* Very high z-index */
        border: 1px solid #dee2e6; /* Bootstrap-like border */
        box-shadow: 0 .5rem 1rem rgba(0,0,0,.15); /* Bootstrap-like shadow */
        border-radius: .25rem; /* Bootstrap-like border radius */
        background: white;
    }
}

/* Mobile emoji picker support (from spotterpost::feeds.layouts.app.blade.php and existing spotterpost.css) */
@media (max-width: 768px) {
    emoji-picker {
        position: fixed !important; /* Force fixed positioning */
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        z-index: 10501 !important; /* Even higher */
        width: 100% !important;
        max-height: 40vh !important;
        border-radius: 0.5rem 0.5rem 0 0 !important;
        box-shadow: 0 -0.5rem 1rem rgba(0,0,0,0.1) !important;
        background: white !important; /* Ensure background is set */
    }

    .emoji-picker-backdrop {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background-color: rgba(0,0,0,0.5) !important;
        z-index: 10500 !important; /* Just below the picker */
    }

    /* Ensure GIF picker appears properly on mobile */
    .gif-picker-modal {
        z-index: 10503 !important; /* Higher than emoji picker */
    }
    
    .gif-picker-backdrop {
        z-index: 10502 !important; /* Higher than emoji backdrop */
    }
}

/* Fix post content indentation */
.post-content {
    /*
     * IMPORTANT: Use a text-first font stack for post body content.
     * Safari (iOS + macOS) can render "giant space chunks" when an emoji-first
     * font stack is applied to normal text. Keep emoji fonts as fallbacks.
     */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
                 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', emoji, sans-serif;
    /* REMOVED: white-space: pre-wrap; - was causing double line breaks with nl2br() output */
    word-wrap: break-word;
    font-size: 1.1rem;
    line-height: 1.6;
    text-indent: 0 !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    display: inline-block; /* Helps prevent extra space */
    width: 100%; /* Ensure it takes full width */
    color: #2c3e50;
    font-weight: 400;
    margin-bottom: 1.5rem;
}

/* RADICAL NEW POST CARD DESIGN - Glassmorphism & Modern */
.card.spotterpost-card {
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 24px !important; /* Force border-radius */
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden !important; /* Force overflow hidden */
    position: relative;
}

.spotterpost-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 1px; /* Inset from card border */
    right: 1px; /* Inset from card border */
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 300% 100%;
    animation: gradientShift 3s ease infinite;
    border-top-left-radius: 23px; /* Slightly smaller to fit within card border */
    border-top-right-radius: 23px; /* Slightly smaller to fit within card border */
    z-index: 1; /* Ensure it's above card content */
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.spotterpost-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 
        0 20px 60px rgba(102, 126, 234, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(102, 126, 234, 0.4);
    background: rgba(255, 255, 255, 0.98);
}

.spotterpost-card .card-body {
    padding: 2.5rem;
    background: transparent;
    position: relative;
}

/* RADICAL NEW USER AVATAR DESIGN */
.user-avatar {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid transparent;
    background: linear-gradient(135deg, #667eea, #764ba2) border-box;
    box-shadow: 
        0 8px 32px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.user-avatar::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c);
    border-radius: 50%;
    z-index: -1;
    animation: rotate 3s linear infinite;
}

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

.user-avatar:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 
        0 12px 48px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.user-avatar-sm {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #667eea, #764ba2) border-box;
    box-shadow: 
        0 6px 24px rgba(102, 126, 234, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-avatar-sm:hover {
    transform: scale(1.1);
    box-shadow: 
        0 8px 32px rgba(102, 126, 234, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Post author info styling */
.spotterpost-card .fw-bold {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Username with Discord role flair styling */
.username-with-flair {
    display: inline-block;
    transition: opacity 0.2s ease;
}

.username-link:hover .username-with-flair {
    opacity: 0.8;
}

/* Dark mode support for role-colored usernames */
/* CRITICAL: Parent div elements have color: white !important which is inherited */
/* We must use unset !important to remove the inherited color and allow inline style to work */
[data-bs-theme="dark"] .username-with-flair {
    color: unset !important; /* Remove inherited !important color from parent div, allow inline style */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Ensure crown emoji displays properly */
.username-with-flair::after {
    content: '';
    display: inline-block;
    margin-left: 0.25rem;
}

/* Crown emoji styling - ensure it's visible and properly sized */
.username-with-flair:has-text("👑") {
    /* Crown emoji will be inline, no special styling needed */
}

/* Chairperson flair icon - max 20x20 */
.chairperson-flair {
    max-width: 20px !important;
    max-height: 20px !important;
    width: 20px !important;
    height: 20px !important;
    object-fit: contain;
    vertical-align: middle;
}

/* Repost header username styling */
.repost-header .username-with-flair {
    font-size: 0.875rem;
}

.spotterpost-card .text-muted {
    color: #6c757d !important;
    font-size: 0.9rem;
}


/* Post Image Styling (from general.blade.php) */
.post-image, .comment-image {
    max-height: 500px;
    object-fit: contain;
    background-color: #f8f9fa;
    width: 100%;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.post-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-medium);
}

.comment-image {
    max-height: 200px; /* Smaller for comments */
    border-radius: 10px;
}

/* Post Images Grid - Better formatting for < 4 images on desktop */
.post-images-grid {
    display: grid;
    gap: 0.75rem;
}

/* 2 images: 2-column grid (50% each) */
.post-images-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* 3 images: 3-column grid (33.33% each) */
.post-images-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* 4+ images: Auto-fill grid (existing behavior) */
.post-images-grid-4,
.post-images-grid-5,
.post-images-grid-6,
.post-images-grid-7,
.post-images-grid-8,
.post-images-grid-9,
.post-images-grid-10 {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Mobile: Always use auto-fill for better responsiveness */
@media (max-width: 767px) {
    .post-images-grid-2,
    .post-images-grid-3 {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Link Embed Container - Responsive video embeds matching post-image-container styling */
.link-embed-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio for videos */
    height: 0;
    overflow: hidden;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 1px solid rgba(102, 126, 234, 0.15);
    box-shadow: var(--shadow-light);
    margin: 1.5rem 0;
    transition: all 0.3s ease;
}

.link-embed-container iframe,
.link-embed-container embed,
.link-embed-container object {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0.5rem;
}

.link-embed-container:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-color: rgba(102, 126, 234, 0.25);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

/* Dark mode support for embed container */
[data-bs-theme="dark"] .link-embed-container {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: rgba(102, 126, 234, 0.25);
}

[data-bs-theme="dark"] .link-embed-container:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.35);
}

/* Light mode styles for Open Graph preview cards */
.og-preview-card {
    background: #f8f9fa;
    transition: background 0.2s;
}

.og-preview-title {
    color: #212529;
}

.og-preview-description {
    color: #6c757d;
}

/* Dark mode support for Open Graph preview cards */
[data-bs-theme="dark"] .og-preview-card {
    background: rgba(26, 35, 50, 0.95) !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

[data-bs-theme="dark"] .og-preview-content {
    background: transparent !important;
}

[data-bs-theme="dark"] .og-preview-content h6,
[data-bs-theme="dark"] .og-preview-title {
    color: #e9ecef !important;
}

[data-bs-theme="dark"] .og-preview-content p,
[data-bs-theme="dark"] .og-preview-description {
    color: #adb5bd !important;
}

/* Mobile responsive adjustments for embed container */
@media (max-width: 767px) {
    .link-embed-container {
        margin: 1rem 0;
        border-radius: 0.5rem;
    }
    
    .link-embed-container:hover {
        transform: none; /* Disable hover lift on mobile for better touch experience */
    }
}

/* TikTok Embed Container - Separate container for TikTok embeds */
/* TikTok uses blockquote + embed.js script, not direct iframe */
/* Container must allow blockquote to be visible for script to process it */
.tiktok-embed-container {
    position: relative;
    width: 100%;
    height: auto; /* Allow content to determine height */
    padding: 0; /* No padding-bottom aspect ratio trick */
    overflow: visible; /* Allow blockquote to be visible */
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 1px solid rgba(102, 126, 234, 0.15);
    box-shadow: var(--shadow-light);
    margin: 1.5rem 0;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px; /* Minimum height for TikTok embed */
}

.tiktok-embed-container .tiktok-embed {
    width: 100%;
    max-width: 605px;
    min-width: 325px;
    margin: 0 auto;
    display: block;
}

/* When TikTok script transforms blockquote to iframe, style the iframe */
.tiktok-embed-container iframe {
    width: 100%;
    max-width: 605px;
    min-width: 325px;
    height: auto;
    min-height: 400px;
    border: none;
    border-radius: 0.5rem;
    display: block;
    margin: 0 auto;
}

.tiktok-embed-container:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-color: rgba(102, 126, 234, 0.25);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

/* Dark mode support for TikTok embed container */
[data-bs-theme="dark"] .tiktok-embed-container {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: rgba(102, 126, 234, 0.25);
}

[data-bs-theme="dark"] .tiktok-embed-container:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.35);
}

/* Mobile responsive adjustments for TikTok embed container */
@media (max-width: 767px) {
    .tiktok-embed-container {
        margin: 1rem 0;
        border-radius: 0.5rem;
        min-height: 300px;
    }
    
    .tiktok-embed-container .tiktok-embed,
    .tiktok-embed-container iframe {
        min-width: 100%;
        max-width: 100%;
    }
}

/* X/Twitter Embed Container - Separate container for Twitter/X embeds */
/* Twitter/X uses blockquote + widgets.js script, not direct iframe */
/* Container must allow blockquote to be visible for script to process it */
.xtwitter-embed-container {
    position: relative;
    width: 100%;
    height: auto; /* Allow content to determine height */
    padding: 0; /* No padding-bottom aspect ratio trick */
    overflow: visible; /* Allow blockquote to be visible */
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 1px solid rgba(102, 126, 234, 0.15);
    box-shadow: var(--shadow-light);
    margin: 1.5rem 0;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px; /* Minimum height for Twitter embed */
}

.xtwitter-embed-container .twitter-tweet {
    width: 100%;
    max-width: 550px; /* Twitter's standard embed width */
    min-width: 300px;
    margin: 0 auto;
    display: block;
}

/* When Twitter widgets.js transforms blockquote to iframe, style the iframe */
.xtwitter-embed-container iframe {
    width: 100%;
    max-width: 550px;
    min-width: 300px;
    height: auto;
    border: none;
    border-radius: 0.5rem;
    display: block;
    margin: 0 auto;
}

.xtwitter-embed-container:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-color: rgba(102, 126, 234, 0.25);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

/* Dark mode support for X/Twitter embed container */
[data-bs-theme="dark"] .xtwitter-embed-container {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: rgba(102, 126, 234, 0.25);
}

[data-bs-theme="dark"] .xtwitter-embed-container:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.35);
}

/* Mobile responsive adjustments for X/Twitter embed container */
@media (max-width: 767px) {
    .xtwitter-embed-container {
        margin: 1rem 0;
        border-radius: 0.5rem;
        min-height: 150px;
    }
    
    .xtwitter-embed-container .twitter-tweet,
    .xtwitter-embed-container iframe {
        min-width: 100%;
        max-width: 100%;
    }
}

/* Poll Styling - Comprehensive styling matching SpotterPost design system */
.spotterpost-poll-container {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-radius: 16px;
    padding: 1.25rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.spotterpost-poll-container:hover {
    border-color: rgba(102, 126, 234, 0.25);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.spotterpost-poll-question h6 {
    color: var(--text-color, #333);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.spotterpost-poll-expiry {
    font-size: 0.85rem;
    display: block;
    margin-top: 0.25rem;
}

.spotterpost-poll-option {
    margin-bottom: 0.75rem;
}

.spotterpost-poll-option-btn {
    width: 100%;
    text-align: left;
    background: white;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.spotterpost-poll-option-btn:hover {
    border-color: rgba(102, 126, 234, 0.4);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.spotterpost-poll-option-btn:active {
    transform: translateY(0);
}

.spotterpost-poll-option-btn.voted {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(102, 126, 234, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.5);
    font-weight: 600;
}

.spotterpost-poll-option-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.spotterpost-poll-option-text {
    font-size: 1rem;
    color: var(--text-color, #333);
    flex: 1;
}

.spotterpost-poll-option-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 1rem;
    white-space: nowrap;
}

.spotterpost-poll-progress {
    height: 6px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.75rem;
}

.spotterpost-poll-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Upload progress bar (reuses poll progress styles) */
#upload-progress {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

#modal-submit-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.spotterpost-poll-result {
    background: white;
    border: 2px solid rgba(102, 126, 234, 0.15);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: all 0.3s ease;
}

.spotterpost-poll-result.user-voted {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(102, 126, 234, 0.12) 100%);
    border-color: rgba(102, 126, 234, 0.4);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.spotterpost-poll-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.spotterpost-poll-result-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.spotterpost-poll-progress-result {
    height: 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.spotterpost-poll-total-votes {
    display: block;
    margin-top: 0.75rem;
    text-align: center;
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.875rem;
    font-weight: 500;
}

.spotterpost-poll-option-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dark mode support for polls */
[data-bs-theme="dark"] .spotterpost-poll-container {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: rgba(102, 126, 234, 0.25);
}

[data-bs-theme="dark"] .spotterpost-poll-container:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: rgba(102, 126, 234, 0.35);
}

[data-bs-theme="dark"] .spotterpost-poll-question h6 {
    color: #ffffff;
}

[data-bs-theme="dark"] .spotterpost-poll-option-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(102, 126, 234, 0.3);
    color: #ffffff;
}

[data-bs-theme="dark"] .spotterpost-poll-option-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
}

[data-bs-theme="dark"] .spotterpost-poll-option-btn.voted {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(102, 126, 234, 0.2) 100%);
    border-color: rgba(102, 126, 234, 0.6);
}

[data-bs-theme="dark"] .spotterpost-poll-option-text {
    color: #ffffff;
}

[data-bs-theme="dark"] .spotterpost-poll-result {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(102, 126, 234, 0.25);
    color: #ffffff;
}

[data-bs-theme="dark"] .spotterpost-poll-result.user-voted {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(102, 126, 234, 0.18) 100%);
    border-color: rgba(102, 126, 234, 0.5);
}

[data-bs-theme="dark"] .spotterpost-poll-total-votes {
    color: rgba(255, 255, 255, 0.7);
}

/* Post Actions Styling (from general.blade.php and spotterpost::feeds.layouts.app.blade.php) */
/* RADICAL NEW POST ACTIONS DESIGN */
.post-actions {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 0.5rem;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    margin-left: -2.5rem;
    margin-right: -2.5rem;
    margin-bottom: -2.5rem;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
    padding-bottom: 2rem;
    border-radius: 0 0 24px 24px;
    flex-wrap: wrap;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .post-actions {
        gap: 0.25rem;
        padding-left: 1rem;
        padding-right: 1rem;
        margin-left: -1rem;
        margin-right: -1rem;
    }
}

/* RADICAL NEW ACTION BUTTON DESIGN */
.post-actions .action-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #2c3e50 !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border: 2px solid rgba(102, 126, 234, 0.2) !important;
    padding: 0.75rem 1rem !important;
    border-radius: 16px !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-decoration: none !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    min-width: 100px !important;
    flex: 1 !important;
    max-width: 120px !important;
}

/* Mobile responsive button adjustments */
@media (max-width: 768px) {
    .post-actions .action-button {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
        min-width: 80px !important;
        max-width: 100px !important;
    }
    
    .post-actions .action-button .ms-1 {
        margin-left: 0.25rem !important;
    }
}

.action-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.action-button:hover::before {
    left: 100%;
}

.post-actions .action-button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    transform: translateY(-4px) scale(1.05) !important;
    box-shadow: 
        0 12px 32px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(102, 126, 234, 0.6) !important;
}

.post-actions .action-button.liked {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 
        0 8px 24px rgba(240, 147, 251, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(240, 147, 251, 0.6) !important;
}

.action-button.liked i.bi-heart-fill {
    color: white !important;
    animation: heartbeat 0.6s ease-in-out;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}


.post-actions .action-button.favorited {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%) !important;
    color: #000 !important;
    transform: translateY(-2px) !important;
    box-shadow: 
        0 8px 24px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    border-color: rgba(255, 215, 0, 0.6) !important;
}


/* Comment Area Styling (from general.blade.php) */
.comment-body {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(0,0,0,0.05);
}

/* Comment Actions Styling (from general.blade.php) */
.comment-actions {
    /* border-top: 1px solid rgba(0,0,0,0.05); */ /* Removed for cleaner look if only like/reply */
    padding-top: 0.5rem;
    display: flex;
    gap: 1rem; /* Add gap between comment actions */
}

.comment-like-button, 
.reply-button {
    color: #6c757d;
    background: none;
    border: none;
    transition: all 0.2s;
    font-size: 0.8rem; /* Slightly smaller for comments */
    padding: 0.25rem 0.5rem;
    display: inline-flex;
    align-items: center;
}

.comment-like-button:hover, 
.reply-button:hover {
    color: #0d6efd;
    background-color: rgba(0,0,0,0.03);
}

.comment-like-button i.bi-heart-fill { /* More specific selector */
    color: #dc3545 !important; /* Ensure red color for liked state */
}

/* Reply Form Styling (from general.blade.php) */
.reply-form-container {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    /* border-top: 1px dashed #eee; */ /* Optional separator */
}

/* Reply textarea styling - no hardcoded colors */
.reply-text-input {
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    resize: none;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    min-height: 60px;
    max-height: 200px;
    overflow-y: auto;
    color: inherit;
    transition: all 0.3s ease;
}

.reply-text-input:focus {
    border-color: rgba(102, 126, 234, 0.4);
    background: rgba(255, 255, 255, 0.95);
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Reply form buttons - no hardcoded colors */
.reply-form-btn {
    background: rgba(248, 249, 250, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #6c757d;
    border-radius: 8px;
    padding: 6px 10px;
    transition: all 0.3s ease;
}

.reply-form-btn:hover {
    background: rgba(248, 249, 250, 1);
    border-color: rgba(0, 0, 0, 0.15);
    color: #495057;
}

.reply-form-btn i,
.reply-form-btn span {
    color: inherit;
}

.reply-submit-btn {
    background: var(--primary-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    border: none;
    color: white;
    border-radius: 8px;
    padding: 6px 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.reply-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
}

.reply-submit-btn:active {
    transform: translateY(0);
}

/* Repost Header Styling (from general.blade.php) */
.repost-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.repost-header a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.repost-header a:hover {
    color: #764ba2;
}

/* Fix for nested comments - ensure proper display (from spotterpost::feeds.layouts.app.blade.php and existing spotterpost.css) */
.comment-replies {
    margin-left: 1rem; /* Default for first level reply */
    padding-left: 0.5rem;
    border-left: 2px solid rgba(0,0,0,0.1);
}

/* Deeper nesting */
.comment-replies .comment-replies {
    margin-left: 0.75rem; /* Slightly less for deeper */
}
.comment-replies .comment-replies .comment-replies {
    margin-left: 0.5rem; /* Even less */
}


/* GIF Picker Modal (from _gif_picker.blade.php and existing spotterpost.css) */
.gif-picker-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60vh; /* Default height */
    max-height: 500px; /* Max height for larger screens */
    background: white;
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 10550; /* High z-index */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent content overflow issues */
}

.gif-picker-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10549; /* Below modal */
}
.gif-picker-content { /* Added to manage flex and scroll within modal */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gif-picker-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.gif-search-container {
    padding: 0.75rem 1rem;
    flex-shrink: 0; /* Prevent search from shrinking */
}

.gif-results {
    flex-grow: 1; /* Allow results to take remaining space */
    overflow-y: auto;
    padding: 0 1rem 1rem 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* Responsive columns */
    gap: 0.5rem;
}

.gif-item {
    width: 100%;
    aspect-ratio: 1 / 1; /* Square aspect ratio for consistency */
    object-fit: cover;
    border-radius: 0.25rem; /* Softer radius */
    cursor: pointer;
    border: 1px solid #eee;
    transition: transform 0.2s ease;
}
.gif-item:hover {
    transform: scale(1.05);
}
.gif-loading-initial .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
}


/* GIF Preview Container (from spotterpost::feeds.layouts.app.blade.php and existing spotterpost.css) */
.gif-preview-container {
    position: relative;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block; /* So it doesn't take full width unless image is large */
    max-width: 100%;
}

.gif-preview {
    max-width: 100%;
    max-height: 200px; /* Consistent preview height */
    border-radius: 0.5rem;
    display: block; /* Prevents extra space below image */
}

.remove-gif-button,
.remove-image-button { /* Shared style for remove buttons */
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px; /* Ensure 'x' fits well */
    line-height: 22px; /* Center 'x' */
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 0;
}
.remove-gif-button:hover,
.remove-image-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}


/* Auto-expanding textarea (from spotterpost::feeds.layouts.app.blade.php and existing spotterpost.css) */
textarea.auto-expand {
    resize: none;
    overflow-y: hidden; /* Changed from hidden to auto to allow scroll if max-height is reached */
    min-height: 38px; /* Default Bootstrap input height */
}

/* Image preview container (from spotterpost::feeds.layouts.app.blade.php and existing spotterpost.css) */
.image-preview-container {
    margin-top: 0.5rem;
    display: inline-block; /* Similar to GIF preview */
    max-width: 100%;
}

.preview-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 0.5rem;
    display: block;
}

/* Fix for stacking context (from spotterpost::feeds.layouts.app.blade.php and existing spotterpost.css) */
.emoji-picker-wrapper {
    position: relative; /* Important for picker positioning */
    z-index: 10400; /* Below modal-level z-indexes but above normal content */
}

/* Ensure emoji pickers in comments/footers have high z-index */
.card-footer emoji-picker,
.comments-list emoji-picker {
    z-index: 10600 !important; /* Higher than GIF picker */
}


/* Contenteditable input styling (from existing spotterpost.css) */
.contenteditable-input {
    min-height: 38px; /* Bootstrap default input height */
    max-height: 150px; /* Limit expansion */
    overflow-y: auto;
    cursor: text;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 0.375rem 0.75rem; /* Bootstrap padding */
    line-height: 1.5;
    border: 1px solid #ced4da; /* Bootstrap border */
    border-radius: .25rem; /* Bootstrap border-radius */
}

.contenteditable-input.empty:not(.focused):before {
    content: attr(data-placeholder);
    color: #6c757d; /* Bootstrap placeholder color */
    /* position: absolute; // Removed as it can cause layout issues, ::before is pseudo element */
    pointer-events: none;
}

.contenteditable-input:focus {
    outline: 0;
    border-color: #86b7fe; /* Bootstrap focus color */
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25); /* Bootstrap focus shadow */
}

/* Support for Android keyboard */
.contenteditable-input[contenteditable="true"] {
    -webkit-user-modify: read-write;
    /* user-modify: read-write; // Deprecated */
    -webkit-line-break: after-white-space;
}

/* GIF loading indicator styling (from existing spotterpost.css) */
.gif-loading-indicator {
    color: #6c757d;
    padding: 0.5rem;
    font-size: 0.875em;
}

/* Mobile-specific styling (from existing spotterpost.css) */
.mobile-device .contenteditable-input {
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    -webkit-touch-callout: none; /* Disable callout menu on long press */
}

/* GIF button specific styling (from existing spotterpost.css) */
.gif-button { /* Already covered by .action-button if used in that context */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* FYP Event Card (injected into /posts feed) */
.spotterpost-event-card {
    border-radius: 16px !important;
    overflow: hidden !important;
    border: 1px solid rgba(102, 126, 234, 0.25) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(20px) !important;
    box-shadow: var(--shadow-light);
    margin-bottom: 2rem;
}

/* Dark mode: injected event card should match the rest of the dark theme */
[data-bs-theme="dark"] .spotterpost-event-card {
    background: rgba(26, 35, 50, 0.85) !important;
    border: 1px solid rgba(0, 209, 255, 0.18) !important;
    box-shadow: var(--shadow-heavy);
}

[data-bs-theme="dark"] .spotterpost-event-card .event-time,
[data-bs-theme="dark"] .spotterpost-event-card .event-time * {
    color: rgba(255, 255, 255, 0.85) !important;
}

[data-bs-theme="dark"] .spotterpost-event-description.text-muted,
[data-bs-theme="dark"] .spotterpost-event-description {
    color: rgba(255, 255, 255, 0.85) !important;
}

[data-bs-theme="dark"] .spotterpost-event-badge {
    background: rgba(0, 0, 0, 0.35) !important;
}

.spotterpost-event-highlight {
    box-shadow:
        0 8px 25px rgba(0, 209, 255, 0.15),
        0 0 0 1px rgba(0, 209, 255, 0.18),
        var(--shadow-light);
    animation: spotterpostEventPulse 2.4s ease-in-out infinite;
}

@keyframes spotterpostEventPulse {
    0% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
    100% { transform: translateY(0); }
}

.spotterpost-event-image {
    position: relative;
    width: 100%;
    height: 140px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.spotterpost-event-image-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.spotterpost-event-badges {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
}

.spotterpost-event-badge {
    background: rgba(0, 0, 0, 0.55) !important;
    color: #fff !important;
    font-weight: 700;
}

.spotterpost-event-badge-status {
    background: rgba(0, 209, 255, 0.25) !important;
    color: #00d1ff !important;
    border: 1px solid rgba(0, 209, 255, 0.35) !important;
}

.spotterpost-event-title {
    color: #00d1ff !important;
    font-weight: 800 !important;
    letter-spacing: 0.1px;
}

.spotterpost-event-description {
    font-size: 0.92rem;
    line-height: 1.35;
}

.spotterpost-event-cta {
    background: linear-gradient(135deg, #00d1ff 0%, #667eea 100%) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 800 !important;
}

.post-form-actions .btn { /* For buttons in create post form */
    margin-right: 0.25rem;
}

/* Style comment form buttons */
.btn-outline-secondary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border: 2px solid transparent !important;
    color: #6c757d !important;
    border-radius: 15px !important;
    padding: 0.5rem 1rem !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    box-shadow: var(--shadow-light) !important;
}

.btn-outline-secondary:hover {
    background: var(--primary-gradient) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-medium) !important;
    border-color: transparent !important;
}

.btn-primary {
    background: var(--primary-gradient) !important;
    border: 2px solid transparent !important;
    color: white !important;
    border-radius: 15px !important;
    padding: 0.5rem 1rem !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    box-shadow: var(--shadow-light) !important;
}

.btn-primary:hover {
    background: var(--secondary-gradient) !important;
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-medium) !important;
}
/* RADICAL NEW PAGINATION DESIGN */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin: 3rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.pagination .page-link {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid rgba(102, 126, 234, 0.2);
    color: #2c3e50;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    min-width: 44px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.pagination .page-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.pagination .page-link:hover::before {
    left: 100%;
}

.pagination .page-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(102, 126, 234, 0.6);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
    box-shadow: 
        0 8px 24px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.pagination .page-item.disabled .page-link {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #6c757d;
    border-color: rgba(108, 117, 125, 0.2);
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination .page-item.disabled .page-link:hover {
    transform: none;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Modern pagination icon sizes - Override Bootstrap Icons */
.pagination .page-link i,
.pagination .page-link .bi,
.pagination .page-link svg {
    font-size: 1rem !important;
    line-height: 1 !important;
    color: inherit !important;
    width: 1rem !important;
    height: 1rem !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Ensure pagination icons are properly sized and modern */
.pagination .bi-chevron-left,
.pagination .bi-chevron-right,
.pagination .bi-chevron-double-left,
.pagination .bi-chevron-double-right {
    font-size: 1rem !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    color: inherit !important;
    opacity: 1 !important;
    width: 1rem !important;
    height: 1rem !important;
}

/* Override any SVG styling that might be interfering */
.pagination .page-link svg {
    fill: currentColor !important;
    stroke: none !important;
    width: 1rem !important;
    height: 1rem !important;
}

/* Avatar Fallback Styling */
.user-avatar, .user-avatar-sm {
    object-fit: cover;
    transition: all 0.3s ease;
}

.user-avatar:hover, .user-avatar-sm:hover {
    transform: scale(1.05);
}

/* Fallback avatar icon styling */
.bi-person-fill {
    color: #6c757d;
}

/* Broken image fallback */
img[src*="default-profile.png"] {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid rgba(0,0,0,0.1);
}

/* Infinite Scroll Styling */
#loading-indicator {
    transition: all 0.3s ease;
}

#loading-indicator .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2em;
}

#end-of-feed {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Smooth loading animation for new posts */
.posts-wrapper .card {
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from { 
        opacity: 0; 
        transform: translateY(30px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Loading state for posts container */
.posts-wrapper.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* END: public/css/spotterpost.css */