/* Cosmic Background */
body {
    background-color: #000000;
    background-image: 
        /* Nebula Effects - More Transparent/Subtle */
        radial-gradient(circle at 20% 20%, rgba(88, 28, 135, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(30, 58, 138, 0.1) 0%, transparent 50%),
        /* Stars (Reduced Density) */
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 2px),
        radial-gradient(white, rgba(255,255,255,.1) 1px, transparent 2px);
    background-size: 100% 100%, 100% 100%, 800px 800px, 600px 600px;
    background-position: 0 0, 0 0, 0 0, 100px 100px;
    background-attachment: fixed;
}

.stone-square-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 120px; /* Adjust based on header height */
    min-height: 100vh;
}

.sliding-tabs-container {
    /* Removed background/border for cleaner look */
    padding: 0;
    display: inline-flex;
    position: relative;
    width: 100%; /* Full width line */
    justify-content: center; /* Center tabs */
    /* No underline */
}
/* Removed ::after gray line */

.sliding-tabs {
    display: flex;
    position: relative;
    gap: 20px; /* Spacing between tabs */
}
.sliding-tab-btn {
    background: transparent !important; /* Ensure no background */
    border: none;
    color: rgba(255, 255, 255, 0.4); /* Dimmed inactive state */
    padding: 10px 25px;
    cursor: pointer;
    font-size: 1.1rem;
    position: relative;
    z-index: 2;
    transition: all 0.4s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
    outline: none; /* Remove focus outline */
    box-shadow: none; /* Remove any shadow */
}
.sliding-tab-btn:focus {
    outline: none;
    background: transparent !important;
}
.sliding-tab-btn.active {
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6); /* Softer, more diffuse glow */
    transform: scale(1.05); /* Subtle scale */
}
.sliding-tab-bg {
    position: absolute;
    top: 0; /* Align to top */
    left: 0;
    height: 100%;
    z-index: 1; /* Behind text */
    width: 0; /* Will be set by JS */
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Floating Glass Pill Style */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px; /* Full rounded pill */
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.3), /* Depth shadow */
        inset 0 0 10px rgba(255, 255, 255, 0.05); /* Inner glow */
    backdrop-filter: blur(5px); /* Glass effect */
}
/* Removed ::after light beam */

.page-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.2s;
    font-size: 0.9rem;
}
.page-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.page-link.active {
    color: var(--accent-primary);
    font-weight: bold;
}

/* News Modal Styles */
.news-detail-image-full {
    width: 100%;
    aspect-ratio: 9/4;
    background-size: cover;
    background-position: center;
    position: relative;
}
.news-meta-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 25px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: rgba(255,255,255,0.9);
}
.news-meta-row {
    display: flex;
    gap: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
}
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.5);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 10;
    transition: background 0.3s;
}
.modal-close-btn:hover {
    background: rgba(0,0,0,0.8);
}
#newsModalTitle {
    font-size: 2.2rem;
    margin: 0 0 10px 0;
    color: #fff;
    line-height: 1.2;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
/* Ensure modal content scrolls, not body */
body.modal-open { overflow: hidden; }
#newsModal .modal-content {
    padding: 0;
    overflow-y: auto;
    max-height: 90vh;
    background: #1a1a1a;
}
/* Hide scrollbar for cleaner look */
#newsModal .modal-content::-webkit-scrollbar { width: 8px; }
#newsModal .modal-content::-webkit-scrollbar-track { background: #1a1a1a; }
#newsModal .modal-content::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }

/* Reaction Dropdown Styles */
.reaction-dropdown-container {
    position: relative;
    display: inline-block;
    margin-right: 5px; /* Consistent spacing */
}
.reaction-dropdown-container:hover .reaction-options {
    display: flex;
    /* Animation removed for instant appearance */
}
.reaction-options {
    display: none;
    position: absolute;
    bottom: 100%;
    left: -10px; /* Shift left to center first emoji over icon */
    background: rgba(30, 30, 30, 0.95);
    padding: 8px 12px;
    border-radius: 50px;
    gap: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 9999;
    white-space: nowrap;
    margin-bottom: 10px; /* Increased margin */
}
/* Bridge - Invisible area to prevent menu from closing */
.reaction-dropdown-container::after {
    content: '';
    position: absolute;
    bottom: 100%; /* Start from top of container */
    left: -20px; /* Wider catch area */
    width: 200%; /* Wider catch area */
    height: 30px; /* Height to cover the gap and more */
    background: transparent;
}

/* Comment Actions Alignment */
.comment-actions {
    margin-top: 5px;
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    margin-bottom: 5px;
    margin-left: 45px; 
}
.comment-action-btn {
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
.comment-action-btn:hover { color: var(--text-primary); }
.comment-action-btn.delete:hover { color: #ff3b30; }

.reaction-option {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 0;
}
.reaction-option:hover {
    transform: scale(1.4);
}
.reaction-trigger {
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}
.reaction-trigger:active {
    transform: scale(0.9);
}

/* Stone Square Styles */
.stone-tabs { display: flex; justify-content: center; gap: 20px; margin-bottom: 20px; }
.stone-tab { background: transparent; border: 2px solid var(--glass-border); color: var(--text-secondary); padding: 10px 30px; border-radius: 30px; cursor: pointer; font-size: 1.1rem; transition: all 0.3s; }
.stone-tab.active { background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); box-shadow: 0 0 15px var(--accent-primary); }

/* Controls (Search & Pagination) */
.news-controls { margin-top: 30px; }
.news-controls, .cafe-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}
.search-form {
    flex: 1;
    max-width: 300px;
    position: relative;
}
.search-btn {
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    font-size: 1rem;
}
.input-glass {
    padding-left: 35px !important; /* Override default padding for search icon */
}
.pagination-simple {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* News Banner */
.news-swiper { 
    width: 100%; 
    /* aspect-ratio: 9/4; Removed to allow content to dictate height if needed, but max-height limits it */
    height: 500px; /* Fixed height for consistency */
    border-radius: 15px; 
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    margin-bottom: 20px; /* Reduced margin, pagination is now outside */
}
.news-slide { position: relative; cursor: default; } /* Default cursor */
.news-banner-img { width: 100%; height: 100%; background-size: cover; background-position: center; transition: transform 0.5s; }
.news-slide:hover .news-banner-img { transform: scale(1.05); }

/* Pagination Dots Outside */
.news-pagination-custom {
    position: relative !important;
    bottom: auto !important;
    text-align: center;
    margin-bottom: 40px;
}
.swiper-pagination-bullet {
    background: rgba(255,255,255,0.5);
    opacity: 1;
    width: 10px;
    height: 10px;
    margin: 0 5px !important;
}
.swiper-pagination-bullet-active {
    background: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c) !important; /* Metallic Gold */
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5) !important;
    border: none !important; /* Remove border from style.css */
}

.news-banner-overlay { 
    position: absolute; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%); 
    display: flex; 
    align-items: flex-end; 
    padding: 40px; 
    pointer-events: none; /* Allow clicks to pass through to image if needed, but buttons need pointer-events: auto */
}
.news-banner-content-wrapper {
    pointer-events: auto;
    max-width: 800px;
    /* Push content down */
    transform: translateY(30px); 
}
.news-banner-date {
    color: var(--accent-primary);
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 600;
    letter-spacing: 1px;
}
.news-banner-title {
    font-size: 2.6rem; /* Adjusted as requested */
    font-weight: 800;
    margin-bottom: 5px; /* Reduced margin */
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    cursor: default; /* Not clickable */
    
    /* Single line, ellipsis */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}
/* Removed hover effect */
.news-banner-preview {
    font-size: 0.35rem; /* Adjusted as requested */
    line-height: 1.5;
    margin-bottom: 15px; /* Reduced margin */
    opacity: 0.9;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 800px;
    color: rgba(255, 255, 255, 0.8);
}
.news-banner-read-more {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: inline-block;
}
.news-banner-read-more:hover {
    background: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c); /* Metallic Gold */
    border-color: #b38728;
    color: #000; /* Black text on gold for contrast */
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(179, 135, 40, 0.6);
}

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

/* Category Container & Expand */
.category-bubbles-container {
    position: relative;
    overflow: hidden;
    height: auto; /* Default auto for expanded state */
    max-height: 80px; /* Approx 1.5 lines (collapsed state) */
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
    margin-bottom: 20px;
    transition: max-height 0.5s ease;
}
.category-bubbles-container.collapsed {
    max-height: 80px; /* Ensure collapsed height */
}
.category-bubbles-container.expanded {
    max-height: 2000px; /* Large enough to show all */
    mask-image: none; /* Remove mask when expanded */
    -webkit-mask-image: none;
    overflow-y: visible; /* Allow full view */
}

/* Category Tags (Sticky Note Style) */
.category-bubbles-inner { 
    display: flex; 
    flex-wrap: wrap; /* Allow wrapping */
    justify-content: center; /* Center align */
    gap: 20px; /* Reduced gap */
    padding: 20px 10px;
}
/* .bubble-group removed */

.bubble { 
    background: #fff; 
    color: #333; 
    padding: 6px 16px; /* Smaller padding */
    border-radius: 2px; 
    font-size: 0.9rem; /* Smaller font */
    font-weight: 600; 
    text-decoration: none; 
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    border-left: 4px solid var(--cat-color, var(--accent-primary)); 
    transform: rotate(-2deg); 
    white-space: nowrap; 
    display: inline-block;
    width: fit-content;
    margin: 5px; /* Small margin */
}
.bubble:nth-child(even) { transform: rotate(1.5deg); }
.bubble:nth-child(3n) { transform: rotate(-1deg); }
.bubble:hover { transform: scale(1.05) rotate(0deg); box-shadow: 3px 3px 8px rgba(0,0,0,0.3); z-index: 10; }
.bubble.active { 
    background: var(--cat-color, var(--accent-primary)); 
    color: #fff; 
    border-left: none; 
    transform: scale(1.1) rotate(0deg); 
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: none !important; /* No glow */
    margin: 5px 15px; /* Breathing room left/right */
}


.news-detail-image { width: 100%; aspect-ratio: 9/4; background-size: cover; background-position: center; margin-bottom: 20px; border-radius: 10px; }

/* News List */
.news-list-container { display: flex; flex-direction: column; gap: 15px; }
.news-list-item { padding: 20px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: transform 0.2s; }
.news-list-item:hover { transform: translateX(5px); }
.news-list-content { flex: 1; }
.news-list-title { font-size: 1.1rem; margin-bottom: 5px; }
.news-list-date { font-size: 0.8rem; color: var(--text-secondary); }
.news-list-actions { display: flex; align-items: center; gap: 15px; opacity: 0.7; transition: opacity 0.2s; }
.news-list-item:hover .news-list-actions { opacity: 1; }
.news-views { font-size: 0.9rem; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }

/* Banner Colors */
.news-banner-date { 
    font-size: 1.1rem; /* Increased size */
    color: #aaa; /* Gray */
    margin-bottom: 10px; 
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.swiper-button-next, .swiper-button-prev {
    color: #aaa !important; /* Gray */
}
.news-banner-overlay {
    pointer-events: none; /* Allow clicks to pass through to image */
}
.news-banner-content-wrapper {
    pointer-events: auto; /* Re-enable clicks for text/buttons */
    padding: 0 60px; /* Breathing room for arrows */
}
.news-banner-preview {
    font-size: 0.9rem; /* Smaller font */
    color: rgba(255,255,255,0.9); /* Ensure visible */
    margin-bottom: 20px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    min-height: 3.2em;
}

/* News Detail Modal Styles */
.news-meta-row {
    display: flex;
    justify-content: space-between; /* Left and Right alignment */
    width: 100%;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    margin-top: 10px;
}
.news-detail-content {
    color: var(--text-primary); /* Ensure text is visible */
    font-size: 1rem;
    line-height: 1.8;
}
.news-detail-content p { margin-bottom: 1em; }
.news-detail-content img { max-width: 100%; height: auto; border-radius: 8px; }

/* Category Tags (Sticky Note Style) - Removed duplicate/conflicting styles */
/* .category-bubbles-inner and .bubble-group definitions removed from here as they are defined earlier */
/* Duplicate .bubble styles removed */

.post-tag-bubble {
    background: #fff;
    color: #333;
    padding: 4px 10px;
    border-radius: 2px;
    font-size: 0.8rem;
    font-weight: 600;
    border-left: 4px solid var(--cat-color, var(--accent-primary));
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    display: inline-block;
}

/* Cafe Post */
.post-card { padding: 20px; margin-bottom: 20px; position: relative; }
.post-title { font-size: 1.3rem; margin-bottom: 5px; font-weight: 700; }
.post-tag { display: inline-block; color: var(--accent-primary); font-size: 0.9rem; margin-bottom: 15px; text-decoration: none; }
.post-user-row { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; font-size: 0.9rem; color: var(--text-secondary); }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-weight: 600; color: var(--text-primary); }
.post-date { display: flex; align-items: center; gap: 5px; }
.edited-mark { font-size: 0.8rem; font-style: italic; opacity: 0.7; }
.post-menu { margin-left: auto; display: flex; gap: 10px; }
.menu-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1rem; }
.menu-btn:hover { color: var(--text-primary); }
.menu-btn.delete:hover { color: #ff3b30; }

.post-body { margin-bottom: 15px; line-height: 1.6; }
.post-media img, .post-media video { width: 100%; border-radius: 10px; margin-bottom: 15px; max-height: 500px; object-fit: cover; }

.post-actions { display: flex; gap: 20px; border-top: 1px solid var(--border-subtle); padding-top: 15px; }
.action-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; gap: 5px; font-size: 1.1rem; }
.action-btn.active { color: #ff3b30; }
.action-btn.active i { font-weight: 900; } /* Solid icon */

/* Comments */
.comment-item { margin-bottom: 15px; position: relative; }
.comment-row { display: flex; gap: 10px; }
.comment-avatar { width: 35px; height: 35px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-avatar i { font-size: 1.2rem; color: var(--text-secondary); }
.comment-body { flex: 1; background: rgba(255,255,255,0.05); padding: 12px 16px; border-radius: 18px; border-top-left-radius: 4px; }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; font-size: 0.9rem; }
.comment-author { font-weight: 600; color: var(--text-primary); }
.comment-time { font-size: 0.8rem; color: var(--text-secondary); }
.comment-content { font-size: 0.95rem; line-height: 1.5; color: #eee; }

/* Nested Comments - Indented and Connected */
.nested-comments { 
    margin-left: 50px; 
    margin-top: 5px; 
    padding-left: 15px; 
    border-left: 2px solid rgba(255,255,255,0.1); 
}
.nested-comments .comment-item { margin-bottom: 10px; }
.nested-comments .comment-avatar { width: 28px; height: 28px; }
.nested-comments .comment-body { background: rgba(255,255,255,0.03); font-size: 0.9rem; }

.comment-reply-form { margin-top: 10px; display: flex; gap: 10px; margin-left: 50px; }

.fab-post { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background: var(--accent-primary); border-radius: 50%; color: #fff; font-size: 30px; border: none; box-shadow: 0 5px 20px rgba(0,0,0,0.5); cursor: pointer; z-index: 100; display: flex; align-items: center; justify-content: center; transition: transform 0.3s; }
.fab-post:hover { transform: scale(1.1); }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; align-items: center; justify-content: center; }
.modal-content { background: #1a1a1a; width: 90%; max-width: 500px; border-radius: 15px; padding: 20px; position: relative; max-height: 90vh; overflow-y: auto; }
.large-modal { max-width: 800px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-close { background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }
.input-glass { width: 100%; background: rgba(255,255,255,0.05); border: 1px solid var(--border-subtle); padding: 10px; border-radius: 8px; color: #fff; }
.full-width { width: 100%; }
.form-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: center; }
.checkbox-label { display: flex; align-items: center; gap: 5px; white-space: nowrap; cursor: pointer; }
.comment-form { display: flex; gap: 10px; margin-top: 15px; }

.news-detail-meta { display: flex; justify-content: space-between; color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 20px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 10px; }
/* Modal Category Styles */
.tag-ticker-wrapper { 
    position: relative; 
    border: 1px solid var(--border-subtle); 
    border-radius: 8px; 
    background: rgba(255,255,255,0.03); 
}
.modal-category-ticker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 200px; /* Approx 5 lines */
    overflow-y: auto;
    padding: 10px;
    padding-bottom: 35px; /* Space for button */
    border: none;
    background: none;
    transition: max-height 0.3s ease;
}
.modal-category-ticker.collapsed {
    max-height: 85px; /* Approx 2 lines */
    overflow: hidden;
}

.ticker-toggle-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 28px; /* Slightly taller for better touch target */
    background: rgba(20, 20, 20, 0.85); /* Darker background to obscure tags */
    backdrop-filter: blur(4px);
    border: none;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    transition: background 0.2s;
    z-index: 10; /* Ensure it sits on top */
}
.ticker-toggle-btn:hover { background: rgba(40, 40, 40, 0.95); color: var(--text-primary); }

.selected-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
    min-height: 0; /* Allow shrinking */
}

.modal-bubble {
    font-size: 0.85rem;
    padding: 5px 12px;
    margin: 0; /* Override default bubble margin */
    transform: none !important; /* No rotation in modal list */
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}
.modal-bubble:hover {
    transform: scale(1.05) !important;
}

/* Compact Form Styles */
.compact-form { padding: 10px 20px; }
.form-group.compact { margin-bottom: 10px; }
.compact-input { padding: 8px; font-size: 0.95rem; }
.modal-header.compact { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border-subtle); }
.modal-footer.compact { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }

.form-row-title { display: flex; gap: 15px; align-items: flex-end; }

.category-search-wrapper { position: relative; display: flex; gap: 5px; margin-bottom: 5px; height: 36px; }
.category-search-wrapper input { height: 100%; }
.add-tag-btn { 
    background: var(--accent-primary); 
    color: #fff; 
    border: none; 
    border-radius: 8px; 
    width: 36px; 
    height: 100%;
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 1.2rem;
}

/* Custom File Upload */
.image-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.custom-file-upload { display: flex; align-items: center; gap: 10px; }
.custom-file-upload input[type="file"] { display: none; }
.file-upload-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
}
.file-upload-btn:hover { background: rgba(255,255,255,0.2); }
.image-preview-mini { display: flex; gap: 5px; }
.image-preview-mini.large .preview-thumb { width: 70px; height: 70px; }
.preview-thumb { width: 35px; height: 35px; border-radius: 4px; object-fit: cover; border: 1px solid var(--border-subtle); }

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 25px;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    color: var(--text-secondary);
}
.custom-checkbox input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: rgba(255,255,255,0.1);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
}
.custom-checkbox:hover input ~ .checkmark { background-color: rgba(255,255,255,0.2); }
.custom-checkbox input:checked ~ .checkmark { background-color: var(--accent-primary); border-color: var(--accent-primary); }
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}
.custom-checkbox input:checked ~ .checkmark:after { display: block; }
.custom-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Stone Market Buttons */
.btn-gold {
    background: #D4AF37; /* Solid metallic gold */
    color: #000 !important;
    text-shadow: none;
    box-shadow: none; /* No shadow */
    border: none;
    font-weight: bold;
    transition: all 0.3s ease;
}
.btn-gold:hover {
    background: #C5A028; /* Slightly darker on hover */
    transform: translateY(-2px);
}

.btn-gray {
    background: #808080; /* Simple gray */
    color: #fff !important;
    cursor: not-allowed;
    box-shadow: none;
    border: none;
    font-weight: bold;
}
/* Override for specific request: "Silver-gray disabled" */
.btn-gray.disabled {
    background: #808080;
    color: #ccc !important;
}

/* Disabled Reward Item */
.reward-item.disabled-item {
    filter: grayscale(100%);
    opacity: 0.6;
    pointer-events: none; /* Prevent clicks */
    position: relative;
}
.reward-item.disabled-item::after {
    content: attr(data-status-text);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.2rem;
    z-index: 10;
    white-space: nowrap;
}

/* --- Stone Market Redesign (Gorgeous & Cosmic Style) --- */

/* Sticky Balance Display */
.sticky-balance-display {
    position: fixed;
    top: 100px; /* Adjust based on header */
    right: 20px;
    z-index: 999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 10px 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    animation: slideInRight 0.5s ease-out;
}

.sticky-balance-display:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.balance-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-content .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: 5px;
}

.balance-content .amount {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.balance-content .icon {
    font-size: 1.2rem;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Gorgeous Header */
.market-header-gorgeous {
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: radial-gradient(circle at center, rgba(100, 50, 255, 0.1) 0%, transparent 70%);
}

.market-header-gorgeous h2 {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, #a0a0a0 50%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 8px;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
    display: inline-block;
}

.market-header-gorgeous h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
}

.market-header-gorgeous p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 20px;
    font-weight: 300;
    letter-spacing: 2px;
    font-style: italic;
}

/* Market Grid & Items */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.market-item {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 100%;
    position: relative;
}

.market-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.07);
}

/* Inactive / Preparing State */
.market-item.preparing {
    opacity: 0.5;
    filter: grayscale(100%);
    pointer-events: none;
}

.item-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
    overflow: hidden;
}

.item-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.market-item:hover .item-image {
    transform: scale(1.1);
}

.item-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255,255,255,0.1);
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
}

.preparing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.preparing-overlay span {
    color: #fff;
    font-weight: 600;
    font-size: 1.2rem;
    border: 1px solid rgba(255,255,255,0.5);
    padding: 8px 20px;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: rgba(0,0,0,0.5);
}

.item-details {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.item-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    line-height: 1.6;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 15px;
}

.item-price {
    display: flex;
    align-items: center;
    gap: 2px; /* Close gap */
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
}
.item-price .unit {
    font-size: 0.9rem;
    margin-left: 2px;
}

.btn-market {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn-buy {
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    color: #000;
    box-shadow: 0 4px 15px rgba(255,255,255,0.1);
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255,255,255,0.2);
}

.btn-market.disabled {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.3);
    cursor: not-allowed;
}

/* Custom Modals */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.custom-modal {
    width: 90%;
    max-width: 400px;
    padding: 30px;
    text-align: center;
    border-radius: 20px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(0.9);
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalPop {
    to { transform: scale(1); }
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}
.modal-icon.confirm { color: var(--accent-primary); }
.modal-icon.success { color: #4caf50; }
.modal-icon.error { color: #f44336; }

.custom-modal h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #fff;
}

.custom-modal p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-modal {
    padding: 10px 25px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal.cancel {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.btn-modal.cancel:hover { background: rgba(255,255,255,0.2); }

.btn-modal.confirm {
    background: #fff;
    color: #000;
}
.btn-modal.confirm:hover { background: #e0e0e0; transform: translateY(-2px); }

/* Market Separator - Removed */
/* .market-separator { ... } */

/* Market Light Separator */
.market-light-separator {
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    margin: 20px auto;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    border-radius: 50%; /* Soft edges */
    opacity: 0.8;
}

.market-subtitle {
    font-style: normal !important; /* Ensure no italics */
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}


