/* Simple Slack Chat CSS - v2.1 with Mobile Fixes */

#sc-chat-app {
    display: flex;
    height: 600px;
    max-width: 1200px;
    margin: 20px auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Sidebar */
.sc-sidebar {
    width: 250px;
    background: #3f0e40;
    color: white;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
}

.sc-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.sc-header h3 {
    margin: 0;
    font-size: 18px;
}

#sc-channels {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
    min-height: 0;
}

.sc-sidebar-footer {
    flex-shrink: 0;
    padding: 0;
    background: #3f0e40;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: relative;
    z-index: 100;
}

.sc-channel-item {
    padding: 8px 20px;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    transition: all 0.2s;
}

.sc-channel-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sc-channel-item.active {
    background: #1264a3;
    color: white;
}

#sc-new-channel {
    margin: 12px;
    padding: 12px 20px;
    background: #00ff00;
    color: #000000 !important;
    border: 2px solid #ffffff;
    cursor: pointer;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 900;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: calc(100% - 24px);
    text-align: center;
    transition: background 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0, 255, 0, 0.4);
}

#sc-new-channel:hover {
    background: #00cc00;
    box-shadow: 0 4px 12px rgba(0, 255, 0, 0.6);
}

/* Main Chat */
.sc-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.sc-chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
}

.sc-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
}

.sc-chat-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

#sc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f8f8;
}

.sc-message {
    padding: 8px 0;
    color: #333;
}

.sc-message strong {
    color: #1264a3;
    margin-right: 8px;
}

.sc-msg-text {
    color: #333;
}

.sc-msg-time {
    color: #999;
    font-size: 12px;
    margin-left: 8px;
}

.sc-empty {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* Input Area */
.sc-input-area {
    padding: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    background: white;
}

#sc-message-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
}

#sc-message-input:focus {
    outline: none;
    border-color: #1264a3;
}

/* Buttons */
.sc-btn, .sc-btn-primary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.sc-btn {
    background: #f8f8f8;
    color: #333;
}

.sc-btn:hover {
    background: #e8e8e8;
}

.sc-btn-primary {
    background: #007a5a;
    color: white;
}

.sc-btn-primary:hover {
    background: #006644;
}

.sc-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.sc-tool-btn {
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 18px;
    min-width: 44px;
    height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.sc-tool-btn:hover {
    background: #e8e8e8;
}

/* Emoji Picker */
#sc-emoji-picker {
    position: absolute;
    bottom: 80px;
    right: 80px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    z-index: 1000;
}

.sc-emoji {
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    text-align: center;
}

.sc-emoji:hover {
    background: #f0f0f0;
}

/* Modal */
.sc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.sc-modal {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
}

.sc-modal h3 {
    margin: 0 0 20px 0;
}

.sc-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 15px;
    box-sizing: border-box;
}

.sc-input:focus {
    outline: none;
    border-color: #1264a3;
}

.sc-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Mobile Styles - CRITICAL FIXES */
@media (max-width: 768px) {
    #sc-chat-app {
        height: 100vh;
        border-radius: 0;
        border: none;
        margin: 0;
        max-width: 100%;
    }
    
    .sc-menu-btn {
        display: block !important;
    }
    
    .sc-sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        bottom: 0;
        width: 250px;
        height: 100%;
        z-index: 1000;
        transition: left 0.3s;
        box-shadow: 2px 0 8px rgba(0,0,0,0.2);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .sc-sidebar.active {
        left: 0;
    }
    
    .sc-header {
        flex: 0 0 auto;
        padding: 20px;
    }
    
    #sc-channels {
        flex: 1 1 auto;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 10px 0;
    }
    
    .sc-sidebar-footer {
        flex: 0 0 auto;
        background: #3f0e40;
        padding: 0;
        position: sticky;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 9999;
    }
    
    /* CRITICAL: Add Channel Button - FORCE VISIBLE WITH STICKY */
    #sc-new-channel {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: calc(100% - 24px) !important;
        margin: 12px !important;
        padding: 16px 20px !important;
        font-size: 18px !important;
        font-weight: 900 !important;
        text-align: center;
        background: #00ff00 !important;
        color: #000000 !important;
        border: 3px solid #ffffff !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 12px rgba(0,255,0,0.5) !important;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    
    #sc-new-channel:active {
        background: #00cc00 !important;
        transform: scale(0.98);
    }
    
    .sc-channel-item {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    .sc-header h3 {
        font-size: 16px;
    }
    
    #sc-messages {
        padding: 15px;
    }
    
    /* CRITICAL: Input Area - Force Buttons Visible */
    .sc-input-area {
        padding: 10px !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
        background: white;
    }
    
    #sc-message-input {
        font-size: 16px !important;
        flex: 1 1 100% !important;
        width: 100% !important;
        order: 1;
        margin-bottom: 8px;
        box-sizing: border-box;
    }
    
    /* CRITICAL: Tool Buttons - Force Visible */
    .sc-tool-btn {
        order: 2 !important;
        min-width: 50px !important;
        height: 50px !important;
        padding: 10px !important;
        font-size: 22px !important;
        flex: 0 0 auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #f8f8f8 !important;
        border: 1px solid #ddd !important;
        margin: 0 !important;
    }
    
    #sc-attach-btn {
        order: 2;
    }
    
    #sc-emoji-btn {
        order: 3;
    }
    
    /* CRITICAL: Send Button - Force Visible */
    #sc-send-btn {
        order: 4 !important;
        flex: 1 1 auto !important;
        padding: 12px 20px !important;
        min-height: 50px !important;
        font-size: 16px !important;
        display: block !important;
    }
    
    /* Emoji Picker Mobile */
    #sc-emoji-picker {
        bottom: 75px;
        left: 10px;
        right: 10px;
        grid-template-columns: repeat(6, 1fr);
        max-height: 250px;
        overflow-y: auto;
    }
    
    .sc-emoji {
        font-size: 28px;
        padding: 8px;
    }
}

/* Scrollbar */
.sc-channels::-webkit-scrollbar,
#sc-messages::-webkit-scrollbar {
    width: 8px;
}

.sc-channels::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sc-channels::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

#sc-messages::-webkit-scrollbar-track {
    background: #f8f8f8;
}

#sc-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
