:root {
    --bg-color: #181818;
    --surface-color: #16181c;
    --border-color: #2f3336;
    --text-primary: #e7e9ea;
    --text-secondary: #71767b;
    --accent-color: #1d9bf0;
    --accent-hover: #1a8cd8;
    --danger-color: #f4212e;
    --success-color: #00ba7c;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color) !important;
    color: var(--text-primary);
    font-family: var(--font-family);
    margin: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
    padding-bottom: 60px; /* Space for mobile nav */
}

@media (min-width: 1024px) {
    body {
        padding-bottom: 0;
    }
}

a {
    text-decoration: none !important;
    color: inherit;
}

a:hover {
    text-decoration: none !important;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

.sidebar-left {
    width: 275px;
    padding: 20px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    background-color: var(--bg-color);
    z-index: 1000;
}

.main-content {
    flex: 1;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    /* Custom Scrollbar for Main Content */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.main-content::-webkit-scrollbar {
    width: 5px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}


.sidebar-right {
    width: 350px;
    padding: 20px;
    flex-shrink: 0;
    display: none; /* Hidden on smaller screens initially */
    overflow-y: auto;
    
    /* Slim Scrollbar for Firefox */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* Slim Scrollbar for WebKit (Chrome, Safari, Edge) */
.sidebar-right::-webkit-scrollbar {
    width: 5px;
}

.sidebar-right::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-right::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.sidebar-right::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

@media (min-width: 1024px) {
    .sidebar-right {
        display: block;
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 700;
}

.page-header {
    position: sticky;
    top: 0;
    /* background-color: rgba(0, 0, 0, 0.65); */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
    z-index: 100;
}

.page-title {
    font-size: 20px;
    color: var(--text-primary);
}

/* Market List Styles */
.market-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.market-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
    cursor: pointer;
}

.market-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.rank-badge {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-secondary);
    width: 40px;
    text-align: center;
}

.company-info {
    flex: 1;
    margin-left: 12px;
}

.company-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}
.company-code {
    font-size: 13px;
    background-color: #2f3336;
    color: #ffffff;
    padding: 0px 3px;
    border-radius: 2px;
}

.company-ticker {
    font-size: 13px;
    color: var(--text-secondary);
}

.market-cap {
    text-align: right;
    min-width: 70px;
}

.cap-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
}

.cap-change {
    font-size: 13px;
    color: var(--success-color); /* Dynamic based on data later */
}

/* Community Feed Styles (Right Panel) */
.feed-header {
    /* margin-bottom: 20px; */
    height: 79px;
    display: flex;
    align-items: center;
}

.feed-title {
    font-size: 20px;
    margin-bottom: 8px;
}

.post-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d9bf0, #8b5cf6);
    margin-right: 12px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: 700;
    font-size: 15px;
}

.handle {
    color: var(--text-secondary);
    font-size: 14px;
}

.post-content {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 12px;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 13px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color 0.2s;
}

.action-btn:hover {
    color: var(--accent-color);
}

/* Sidebar Filters & Search */
.logo {
    /* padding: 12px 0; */
    font-size: 24px;
    color: var(--text-primary);
    /* margin-bottom: 16px; */
    display: flex;
    align-items: center;
    height: 79px;
}
a.logo {
    text-decoration: none;
}   
.logo-img {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: bottom;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.search-box {
    background-color: #202327;
    border-radius: 9999px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
}

.search-box:focus-within {
    background-color: #000000;
    border-color: var(--accent-color);
}

.search-box i {
    color: var(--text-secondary);
    margin-right: 12px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    width: 100%;
    outline: none;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scrollable-options {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Custom Scrollbar for options */
.scrollable-options::-webkit-scrollbar {
    width: 6px;
}
.scrollable-options::-webkit-scrollbar-track {
    background: transparent;
}
.scrollable-options::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 3px;
}

.filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.filter-option:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.filter-option input[type="radio"],
.filter-option input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--text-secondary);
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    cursor: pointer;
}

.filter-option input[type="radio"] {
    border-radius: 50%;
}

.filter-option input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.filter-option input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: white;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
}

.filter-option input[type="radio"]:checked::after {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
    mask: none;
    -webkit-mask: none;
}

.filter-option span {
    font-size: 15px;
    color: var(--text-primary);
}

/* Mobile Specific Styles */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 10px 0;
    z-index: 2000;
    justify-content: space-around;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item.active {
    color: var(--text-primary);
}

.d-lg-none {
    display: none !important;
}

.d-lg-flex {
    display: flex !important;
}

.d-none {
    display: none !important;
}

@media (max-width: 1023px) {
    .d-lg-none {
        display: block !important;
    }
    
    .d-lg-flex {
        display: none !important;
    }

    .app-container {
        display: block; /* Stack layout */
        height: auto;
    }

    .sidebar-left {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: none; /* Hidden by default */
        padding-bottom: 80px; /* Space for button */
    }

    .sidebar-left.active {
        display: flex;
    }

    .main-content {
        border-right: none;
        width: 100%;
    }

    .sidebar-right {
        width: 100%;
        display: none; /* Hidden by default */
        border-left: none;
        padding-bottom: 80px;
    }

    .mobile-nav {
        display: flex;
    }

    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }

    .close-btn {
        background: none;
        border: none;
        color: var(--text-primary);
        font-size: 24px;
        cursor: pointer;
    }

    .btn-primary {
        background-color: var(--accent-color);
        color: white;
        border: none;
        padding: 12px;
        border-radius: 9999px;
        font-weight: 700;
        font-size: 16px;
        cursor: pointer;
    }
    
    .w-100 {
        width: 100%;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background-color: rgba(91, 112, 131, 0.4); */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #16181c !important; /* Force opacity and color */
    width: 100%;
    max-width: 600px;
    border-radius: 16px;
    padding: 16px;
    position: relative;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    margin: 16px;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.comment-form textarea {
    width: 100%;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 16px;
    padding: 12px;
    border-radius: 8px;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 12px;
    font-family: var(--font-family);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-submit {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 9999px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: var(--accent-hover);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Comment Count Styles */
.comment-info {
    display: flex;
    align-items: center;
    justify-content: left;
    width: 80px;
    margin-left: 12px;
    flex-shrink: 0;
}

.comment-count {
    font-size: 15px; /* Increased from 13px */
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s;
    padding: 6px 8px;
    border-radius: 9999px;
}

.comment-count i {
    font-size: 18px; /* Bigger icon */
}

.comment-count:hover {
    color: var(--accent-color);
    background-color: rgba(29, 155, 240, 0.1);
}
