/* ========================================
   1. CORE IMPORTS & LAYOUT
   ========================================
*/
@import url('_sys_vars.css');
@import url('_nav_core.css');
@import url('_ui_widgets.css');
@import url('_fx_engine.css');
@import url('_auth_forms.css');
@import url('messages.css');
@import url('comments.css');

.main-content-split {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    width: 100% !important;
    max-width: 1200px;
    min-width: auto !important;
    margin: 0 auto !important;
    padding: 0 !important;
    justify-content: center;
}

@media (min-width: 1024px) {
    .main-content-split {
        flex-direction: row !important;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }

    .left-main-column, .right-main-column {
        flex: 1;
        margin: 0; 
        padding: 0;
        display: flex;
        flex-direction: column;
    }
}

.main-content-split.horizontal-stack {
    flex-direction: column !important;
    gap: 20px;
    max-width: 1200px;
    margin: 0px auto;
    width: 100% !important;
}

/* ========================================
   2. BUTTONS & UI COMPONENTS
   ========================================
*/

.btn-primary, .btn-secondary {
    width: 100%;
    padding: 16px;
    border-radius: 8px;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    background-color: #6d6d6d;
    color: #ffffff;
}

.btn-primary:hover, .btn-secondary:hover {
    background-color: #4a4a4a;
    transform: translateY(-1px);
}

.btn-filter, .btn-filter-sleek {
    height: 32px !important;
    padding: 0 15px !important;
    font-size: 0.75rem !important;
    font-weight: 600;
    background-color: #6d6d6d !important;
    color: #fff !important;
    border-radius: 4px !important;
    border: none !important;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-filter-sleek {
    height: 28px !important;
    padding: 0 12px !important;
    font-size: 0.7rem !important;
    align-self: flex-end;
}

.btn-filter:hover, .btn-filter-sleek:hover {
    background-color: #4a4a4a !important;
}

/* ========================================
   3. FEED & FILTER CONTROLS
   ========================================
*/

.feed-header-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 4px !important;
}

.feed-title-small {
    font-size: 1.1rem !important;
    color: #2c3e50;
    margin: 0 0 5px 0 !important;
    font-weight: 600;
}

.filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 0px !important;
    align-items: flex-end;
}

.filter-row.inline-group {
    flex-wrap: nowrap;
}

.search-input {
    height: 32px !important;
    padding: 0 8px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    font-size: 0.8rem !important;
    background: #fdfdfd !important;
    color: #555 !important;
    outline: none;
}

.search-input.slim {
    height: 28px !important;
    font-size: 0.75rem !important;
    padding: 0 6px !important;
    width: 120px;
}

.search-input.full-width {
    width: 100%;
    height: 28px !important;
}

input[type="date"].search-input {
    line-height: 1.2;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-input-group label {
    font-size: 0.6rem !important;
    color: #aaa !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 2px !important;
}

.filter-actions {
    display: flex;
    gap: 4px;
    align-self: flex-end;
}

#clear-filters:hover {
    background-color: #d0d0d0 !important;
    color: #333 !important;
}

/* ========================================
   4. CARDS & INFINITE SCROLL
   ========================================
*/

#infinite-scroll-container {
    /* 1. Layout & Spacing (From Proposed Code) */
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;

    /* 2. Scroll & Dimensions (From Original Code) */
    height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    
    /* 3. Visual Styling (From Original Code) */
    border: 1px solid #eee;
    border-top: 1px solid #f0f0f0;
    border-radius: 8px;
    margin-top: 0px !important;

    /* 4. Custom Scrollbar (From Original Code) */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* Ensure Webkit scrollbars (Chrome/Safari) still work */
#infinite-scroll-container::-webkit-scrollbar {
    width: 6px;
}

#infinite-scroll-container::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

.highlight-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.new-section-box { all: unset; }

.new-section-box h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    color: #666666;
    font-size: 1.2rem;
    margin-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 10px;
}

.card-item {
    display: flex;
    justify-content: space-between;
    background: #fff;
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    align-items: center;
}

.highlight-card {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
    padding: 15px 20px;
    background: #ffffff;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

.highlight-card:hover { border-color: #ddd; }

.highlight-text {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin: 5px 0;
    text-align: left;
    width: 100%;
    display: block;
    line-height: 1.5;
}

.highlight-pill:hover {
    transform: none !important;
    box-shadow: none !important;
    z-index: 1;
    background: #ffffff;
    border-color: #ddd !important;
}

.highlight-pill .card-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.full-text-tooltip {
    visibility: hidden;
    width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 10px;
    position: absolute;
    z-index: 10002;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    pointer-events: none;
}

.full-text-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* ========================================
   5. PROFILE OVERLAY SYSTEM
   ========================================
*/

#profileOverlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0); 
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                backdrop-filter 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.6s;
    z-index: var(--z-overlay) !important;
}

#profileOverlay.is-visible {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    background: rgba(0, 0, 0, 0.5) !important; 
    backdrop-filter: blur(12px) !important; 
    -webkit-backdrop-filter: blur(10px) !important;
}

#profileContent {
    display: flex;
    flex-direction: column; 
    width: 100% !important;
    height: 80vh !important; 
    background: #fff;
    border-radius: 20px 20px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-modal) !important;
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    transform: translateY(100%); 
    overflow: hidden;
}

#profileOverlay.is-visible ~ #profileContent {
    transform: translateY(0);
}

.profile-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 20px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}

.profile-img-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 15px auto;
}

#profileDisplayImg, .profile-image-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: #3498db;
    color: white;
    font-size: 2.5rem;
}

.photo-edit-btn, .photo-remove-btn {
    position: absolute;
    bottom: 5px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #fff;
    z-index: 10;
    transition: transform 0.2s, background-color 0.2s;
}

.photo-edit-btn { right: -5px; background: #3498db; color: white; font-size: 20px; }
.photo-remove-btn { left: -5px; background: #e74c3c; color: white; font-size: 18px; }

.profile-main h2 {
    margin: 10px 0 5px 0;
    font-family: 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 300;
    letter-spacing: 1.5px;
    color: #1a1a1a;
}

.profile-messages-section {
    flex: 1 1 auto !important;
    overflow-y: scroll !important;
    padding: 20px;
    background-color: #fafafa;
    scrollbar-width: thin;
    scrollbar-color: #888 #eee;
}

.profile-footer {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
}

/* ========================================
   6. UTILS & NAVIGATION
   ========================================
*/

.lang-switcher { display: flex; gap: 8px; margin-right: 15px; }

.lang-btn { 
    background: #fff; 
    border: 1px solid #eee; 
    padding: 6px 10px; 
    cursor: pointer; 
    font-size: 0.65rem; 
    font-weight: 700; 
    color: #95a5a6; 
    border-radius: 4px; 
    text-transform: uppercase; 
}

.lang-btn.active { border-color: #2c3e50; color: #2c3e50; }

.burger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: transparent;
    border: 1px solid #eeeeee;
    color: #95a5a6;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    width: 42px;
    transition: all 0.2s ease;
}

.burger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 2px 0;
    background-color: #666;
    transition: 0.3s;
    border-radius: 2px;
}

.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    border-bottom: 1px solid #f9f9f9;
}

.ks-input {
    border: 1px solid #ccc;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    outline: none;
}

.ks-input.is-invalid { border-color: #ff4d4d !important; box-shadow: 0 0 5px rgba(255, 77, 77, 0.5); }
.ks-input.is-valid { border-color: #2ecc71 !important; box-shadow: 0 0 5px rgba(46, 204, 113, 0.5); }

/* Category Specifics */
.msg-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 8px;
    border-left: 5px solid #666666; /* Default color */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
    margin-bottom: 3px !important; /* Keeps the spacing between cards */
}

.msg-card:hover {
    border-left: 5px solid #7e7e7e !important;
}

/* Message Content */
.msg-body {
    font-size: 0.91rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 6px;
    
}

/* Metadata Footer Area */
.msg-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    gap: 10px;
}

.msg-meta-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.msg-meta-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Labels & Values */
.msg-sender {
    font-weight: 700;
    color: #2c3e50;
    font-size: 0.9rem;
}

.msg-location {
    font-size: 0.8rem;
    color: #95a5a6;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Reaction Bar Styling */
.msg-interactions {
    display: flex;
    gap: 15px;
    margin-top: 2px;
    padding-top: 6px;
    border-top: 1px dashed #f0f0f0;
}

/* Smart Reaction Styling */
.reaction-btn {
    border: 1px solid #e2e8f0; /* Subtle border */
    background: #ffffff;
    padding: 6px 14px;
    border-radius: 8px; /* Slightly more geometric than 50px */
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b; /* Slate Gray */
    transition: all 0.3s ease;
}

.reaction-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
    transform: translateY(-1px);
}

/* Color accents when active/hovered */
.reaction-btn.like:hover { color: #3b82f6; } /* Subtle Blue */
.reaction-btn.heart:hover { color: #f43f5e; } /* Subtle Rose */

.svg-smart {
    transition: transform 0.2s ease;
}

.reaction-btn:active .svg-smart {
    transform: scale(0.8);
}

.reaction-count {
    font-size: 0.85rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums; /* Prevents text jumping when numbers change */
}

.msg-category {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    color: #7f8c8d;
}

.msg-date {
    font-size: 0.8rem;
    color: #bdc3c7;
}




/* ========================================
   SLEEK LEADERBOARD TRANSFORMATION
   ========================================
*/

.leaderboard {
    width: 100%;
    margin-bottom: 2px;
    padding: 10px 0;
}

.leaderboard-3d {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #95a5a6; /* Subtle heading */
    margin-bottom: 5px !important;
    font-weight: 600;
}

/* Container for the cards */
.card-list.horizontal-list {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    perspective: 1000px; /* Prepares for subtle hover tilts */
}

/* Individual Sleek Card */
.card-list.horizontal-list .card-item {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 18px 22px;
    border-radius: 8px; /* Smoother corners */
    box-shadow: 0 10px 25px rgba(0,0,0,0.03), 0 4px 6px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.04) !important; /* Extremely subtle border */
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

/* Hover Effect: Elevation */
.card-list.horizontal-list .card-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 35px rgba(0,0,0,0.07);
    border-color: rgba(0,0,0,0.1) !important;
}

/* Professional Typography */
.card-item .cat-name {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: #2c3e50;
    letter-spacing: -0.2px;
}

/* Modern Badge/Pill Style */
.card-item .count-badge {
    background: #f8f9fa; /* Neutral background */
    color: #2c3e50;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid #edf2f7;
    transition: background 0.3s ease;
}

/* Dynamic colors based on Rank (Optional enhancement) */
.card-list.horizontal-list div:nth-child(1) .count-badge {
    background: #fff5f5; /* Light red tint for #1 */
    color: #e74c3c;
    border-color: #feb2b2;
}

.card-list.horizontal-list div:nth-child(2) .count-badge {
    background: #f0fff4; /* Light green tint for #2 */
    color: #2ecc71;
    border-color: #9ae6b4;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .card-list.horizontal-list {
        flex-direction: column;
        gap: 12px;
    }
    
    .card-list.horizontal-list .card-item {
        width: 100%;
    }
}

/* Ensure the pill alignment inside the leaderboard cards remains correct */
.card-item .cat-name {
    font-weight: 500;
    color: #555;
}

/* This matches the red/green badges in your screenshot */
.card-item .count-badge {
    padding: 4px 12px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}


@media (max-width: 768px) {
    .main-content-split { min-width: unset !important; }
    .filter-row.inline-group { flex-wrap: wrap; }
    .search-input.slim { width: 100%; }
    .feed-header-wrapper { align-items: flex-start; }
    .mobile-only { display: flex !important; justify-content: space-around; padding: 15px 10px; background: #fdfdfd; }
}