/**
 * GoCharcha 2.0 Global Stylesheet Module
 * Centralized Design System overrides for Twitter alternative theme.
 */

:root {
    --bg-color: #0b0c14;
    --card-bg: rgba(255, 255, 255, 0.03);
    --border-color: rgba(255, 255, 255, 0.08);
    --primary-indigo: #6366f1;
    --primary-purple: #a855f7;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    
    /* Legacy variables retained for direct structural backward compatibility */
    --primary-blue: #1d9bf0;
    --text-dim-legacy: #71767b;
    --border-legacy: #2f3336;
}

/* --- 1. Global Resets & Base Elements --- */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.gap-1 {
    gap: 0.65rem !important;
}

.login-logo {
    margin-bottom: 0px !important;
}
.card{
    /*box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px !important;*/
    /*box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px !important;*/
    box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px !important;
}

.card:hover
{
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px !important;
}
/* --- 2. Structural Glassmorphism Utility Layers --- */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
}

.glow-btn {
    background: linear-gradient(135deg, var(--primary-indigo), var(--primary-purple));
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.glow-btn:active {
    transform: scale(0.95);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

/* --- 3. Live Rich-Text Highlighter Engine Layers --- */
#editor-container {
    position: relative;
    width: 100%;
    min-height: 80px;
}

#backdrop {
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0;
    color: transparent;
    white-space: pre-wrap;
    word-wrap: break-word;
    pointer-events: none;
    font-size: 1.25rem;
    line-height: 1.75rem;
}

#mainContent {
    position: relative;
    z-index: 2;
    background: transparent !important;
    color: white;
    caret-color: white;
    border: none;
    padding: 0;
    width: 100%;
}

.hl-mention {
    color: var(--primary-indigo);
    font-weight: bold;
    background: rgba(99, 102, 241, 0.15);
    border-radius: 4px;
}

.hl-hashtag {
    color: var(--primary-purple);
    font-weight: bold;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 4px;
}

/* --- 4. Suggestions Dropdown Panel Systems --- */
#searchSuggestions, #mentionSuggestions {
    display: none;
    position: absolute;
    background: #0f111a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    z-index: 99999 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
}

#searchSuggestions {
    top: 55px;
    width: 100%;
    left: 0;
}

#mentionSuggestions {
    top: 100%;
    left: 0;
    width: 280px;
}

/* --- 5. Media Previews and Component Collage Grids --- */
.preview-item {
    position: relative;
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 18px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.1);
}

.remove-preview {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.7);
    width: 20px;
    height: 20px;
    border-radius: 5px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.collage-grid {
    display: grid;
    gap: 4px;
    border-radius: 24px;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: rgba(255,255,255,0.02);
}

.collage-1 { grid-template-columns: 1fr; }
.collage-2 { grid-template-columns: 1fr 1fr; }
.collage-3 { grid-template-columns: 1.5fr 1fr; grid-template-rows: 1fr 1fr; }
.collage-3 .collage-item:first-child { grid-row: span 2; }
.collage-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.collage-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

#slider-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

/* --- 6. Navigation Controls and Badges --- */
.nav-badge {
    position: absolute;
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 99px;
    font-weight: bold;
    border: 2px solid var(--bg-color);
}

.feed-toggle.active {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary-indigo);
    color: white !important;
}

.post-tab.active {
    background: var(--primary-indigo);
    color: white;
}

/* --- 7. Layout Scrollbar Tuning --- */
.custom-scroll::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.2);
    border-radius: 10px;
}
.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* --- 8. Word wrap overrides for Charcha feeds --- */
.post-text {
    word-break: break-all;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

/* --- 9. Base components from legacy style.css --- */
.main-container {
    max-width: 600px;
    margin: 0 auto;
    border-left: 1px solid var(--border-legacy);
    border-right: 1px solid var(--border-legacy);
    min-height: 100vh;
}