/* ============================================================
   CHAT SLIDEOUT - MINIMAL TELEGRAM STYLE
   ============================================================ */

.chat-slideout {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.chat-slideout.open {
    pointer-events: all;
    transform: translateX(0);
}
.chat-slideout .slideout-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.chat-slideout.open .slideout-overlay {
    opacity: 1;
    pointer-events: all;
}

.chat-slideout .slideout-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: radial-gradient(ellipse at 50% 0%, rgba(15, 12, 18, 0.98) 0%, #08060a 100%);
    border-left: 1px solid rgba(255, 180, 50, 0.04);
    padding: 0;
    display: flex;
    flex-direction: column;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
}

/* ============================================================
   HEADER - Minimal
   ============================================================ */
.chat-slideout .slideout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}
.chat-slideout .slideout-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e2e8f0;
}
.chat-slideout .slideout-title span {
    color: #6a6a80;
    font-weight: 400;
    font-size: 0.75rem;
}
.chat-slideout .slideout-close {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: #6a6a80;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-slideout .slideout-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

/* ============================================================
   CHANNEL BAR - Pills
   ============================================================ */
.chat-channel-selector {
    display: flex;
    gap: 4px;
    padding: 8px 16px 6px 16px;
    flex-shrink: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.chat-channel-selector::-webkit-scrollbar {
    height: 2px;
}
.chat-channel-selector::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.channel-btn {
    padding: 3px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: transparent;
    color: #5a4a3a;
    font-size: 0.6rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}
.channel-btn:hover:not(.locked) {
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.06);
}
.channel-btn.active {
    background: rgba(251, 191, 36, 0.08);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.12);
}
.channel-btn.view {
    border-color: rgba(74, 222, 128, 0.06);
    color: #4ade80;
}
.channel-btn.locked {
    opacity: 0.2;
    cursor: not-allowed;
}

/* ============================================================
   TAB NAV
   ============================================================ */
.chat-tab-nav {
    display: flex;
    gap: 4px;
    padding: 4px 8px 8px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}
.chat-tab-btn {
    flex: 1;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    color: #6a6a80;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}
.chat-tab-btn.active {
    background: rgba(251, 191, 36, 0.06);
    border-color: rgba(251, 191, 36, 0.08);
    color: #fbbf24;
}

/* ============================================================
   BADGE - Hidden
   ============================================================ */
.chat-badge {
    display: none !important;
}

/* ============================================================
   MESSAGES CONTAINER
   ============================================================ */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px 4px 12px;
}
.chat-messages::-webkit-scrollbar {
    width: 3px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

/* ============================================================
   TELEGRAM-STYLE MESSAGES
   ============================================================ */
.msg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.15s ease;
    margin-bottom: 2px;
    cursor: default;
}
.msg:hover {
    background: rgba(255, 255, 255, 0.02);
}

.msg-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #fff;
    flex-shrink: 0;
    margin-top: 2px;
    text-transform: uppercase;
    user-select: none;
}

.msg-content {
    flex: 1;
    min-width: 0;
}

.msg-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 1px;
}

.msg-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
}
.msg-name .badge {
    font-size: 0.45rem;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 500;
    margin-left: 4px;
    display: inline-block;
}
.msg-name .badge.mentor {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}
.msg-name .badge.system {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
}
.msg-name .badge.you {
    background: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
}

.msg-time {
    font-size: 0.5rem;
    color: #4a4a6a;
    flex-shrink: 0;
}

.msg-text {
    font-size: 0.88rem;
    color: #c4b4a4;
    line-height: 1.5;
    word-break: break-word;
}

/* Message variants */
.msg.own {
    background: rgba(96, 165, 250, 0.03);
    border-radius: 8px;
}
.msg.own .msg-name {
    color: #60a5fa;
}
.msg.mentor {
    border-left: 2px solid rgba(251, 191, 36, 0.08);
    padding-left: 6px;
}
.msg.mentor .msg-name {
    color: #fbbf24;
}
.msg.system .msg-name {
    color: #4ade80;
}

/* Reactions - hidden by default, show on hover */
.msg-reactions {
    display: flex;
    gap: 3px;
    margin-top: 2px;
    flex-wrap: wrap;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.msg:hover .msg-reactions {
    opacity: 1;
}
.msg-reactions.has-reactions {
    opacity: 1;
}

.msg-reaction {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 0px 6px 0px 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.65rem;
}
.msg-reaction:hover {
    background: rgba(255, 255, 255, 0.08);
}
.msg-reaction .emoji {
    font-size: 0.75rem;
}
.msg-reaction .count {
    font-size: 0.45rem;
    color: #6a6a80;
    font-weight: 500;
}
.msg-reaction.active {
    border-color: rgba(251, 191, 36, 0.15);
    background: rgba(251, 191, 36, 0.06);
}
.msg-reaction.active .emoji {
    color: #fbbf24;
}
.msg-reaction.active .count {
    color: #fbbf24;
}
.msg-reaction.tipped {
    border-color: rgba(251, 191, 36, 0.15);
    background: rgba(251, 191, 36, 0.06);
}

.msg-tip {
    font-size: 0.5rem;
    color: #4ade80;
    margin-top: 1px;
    opacity: 0.6;
}

/* Reactions legend - removed */
.chat-reactions-legend {
    display: none !important;
}

/* ============================================================
   INPUT AREA
   ============================================================ */
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 8px 16px 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.1);
}
.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 8px 14px;
    color: #f0ece6;
    outline: none;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
}
.chat-input-area input:focus {
    border-color: rgba(251, 191, 36, 0.08);
}
.chat-input-area input::placeholder {
    color: #4a3a2a;
}
.chat-input-area input:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.chat-input-area button {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    border: none;
    border-radius: 10px;
    padding: 8px 18px;
    color: #0a080c;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}
.chat-input-area button:hover:not(:disabled) {
    transform: scale(0.96);
}
.chat-input-area button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-chat {
    text-align: center;
    color: #4a3a2a;
    font-size: 0.8rem;
    padding: 3rem 0;
}
.empty-chat .icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
    opacity: 0.3;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    .chat-slideout .slideout-content {
        max-width: 100%;
    }
    .msg-avatar {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 0.65rem;
    }
    .msg-name {
        font-size: 0.75rem;
    }
    .msg-text {
        font-size: 0.82rem;
    }
    .chat-input-area input {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    .chat-input-area button {
        font-size: 0.7rem;
        padding: 6px 14px;
    }
    .chat-channel-selector {
        padding: 6px 12px 4px 12px;
    }
    .channel-btn {
        font-size: 0.55rem;
        padding: 2px 10px;
    }
}

@media (max-height: 650px) {
    .chat-slideout .slideout-header {
        padding: 8px 14px 6px 14px;
    }
    .chat-channel-selector {
        padding: 4px 14px 4px 14px;
    }
    .chat-messages {
        padding: 4px 10px 2px 10px;
    }
    .chat-input-area {
        padding: 6px 14px 10px 14px;
    }
    .msg {
        padding: 3px 6px;
    }
    .msg-avatar {
        width: 26px;
        height: 26px;
        min-width: 26px;
        font-size: 0.55rem;
    }
    .msg-name {
        font-size: 0.7rem;
    }
    .msg-text {
        font-size: 0.78rem;
    }
}

/* ============================================================
   LARGER FONT SIZE - READABILITY
   ============================================================ */

.chat-slideout .slideout-title {
    font-size: 1.1rem !important;
}

.chat-slideout .chat-tab-btn {
    font-size: 0.8rem !important;
    padding: 8px 12px !important;
}

.msg-name {
    font-size: 0.95rem !important;
}

.msg-text {
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

.msg-time {
    font-size: 0.65rem !important;
}

.msg-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    font-size: 0.9rem !important;
}

.chat-input-area input {
    font-size: 1rem !important;
    padding: 10px 16px !important;
}

.chat-input-area button {
    font-size: 0.9rem !important;
    padding: 10px 22px !important;
}

.channel-btn {
    font-size: 0.75rem !important;
    padding: 4px 16px !important;
}

.msg-reaction {
    font-size: 0.8rem !important;
}

.msg-reaction .emoji {
    font-size: 0.9rem !important;
}

.msg-reaction .count {
    font-size: 0.6rem !important;
}

.msg-tip {
    font-size: 0.6rem !important;
}

.msg-name .badge {
    font-size: 0.55rem !important;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .msg-name {
        font-size: 0.85rem !important;
    }
    .msg-text {
        font-size: 0.92rem !important;
    }
    .msg-avatar {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        font-size: 0.8rem !important;
    }
    .chat-input-area input {
        font-size: 0.9rem !important;
        padding: 8px 12px !important;
    }
    .chat-input-area button {
        font-size: 0.8rem !important;
        padding: 8px 16px !important;
    }
}

@media (max-height: 650px) {
    .msg-name {
        font-size: 0.8rem !important;
    }
    .msg-text {
        font-size: 0.85rem !important;
    }
    .msg-avatar {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        font-size: 0.7rem !important;
    }
}

/* ============================================================
   CLEAN PILLS STYLING - For chat header
   ============================================================ */

/* Pill buttons in chat header */
.pill {
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: transparent;
    color: #5a4a3a;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    user-select: none;
    flex-shrink: 0;
}

.pill:hover:not(.locked) {
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.06);
}

/* Current rank - active */
.pill.active {
    background: rgba(251, 191, 36, 0.08);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.12);
}

/* Next rank - view-only */
.pill.view {
    border-color: rgba(74, 222, 128, 0.06);
    color: #4ade80;
}

/* News pill - always visible, special style */
.pill.news {
    border-color: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.04);
    display: flex;
    align-items: center;
    gap: 4px;
}

.pill.news:hover {
    background: rgba(96, 165, 250, 0.08);
    border-color: rgba(96, 165, 250, 0.2);
}

.pill.news .icon {
    font-size: 0.65rem;
}

.pill.locked {
    opacity: 0.2;
    cursor: not-allowed;
}

/* Scrollbar for pills container */
#channelSelector::-webkit-scrollbar {
    height: 2px;
}

#channelSelector::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

/* Responsive pills */
@media (max-width: 480px) {
    .pill {
        font-size: 0.65rem;
        padding: 3px 12px;
    }
}

@media (max-height: 650px) {
    .pill {
        font-size: 0.6rem;
        padding: 3px 10px;
    }
}
