/* Floating Chat Widget Styles */

.scc-floating-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    max-height: 400px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    display: none; /* Dold som standard */
}

.scc-floating-widget.scc-widget-visible {
    display: block;
}

.scc-widget-header {
    background: #0073aa;
    color: white;
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
    position: relative;
}

.scc-widget-header span {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
}

.scc-header-controls {
    display: flex;
    gap: 5px;
}

.scc-back-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 2px 8px;
    margin-right: 10px;
    border-radius: 3px;
    font-size: 12px;
    transition: background-color 0.2s;
    display: none;
}

.scc-back-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.scc-back-btn.visible {
    display: inline-block;
}

.scc-widget-toggle,
.scc-widget-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    font-size: 16px;
    line-height: 1;
}

.scc-widget-toggle:hover,
.scc-widget-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.scc-widget-content {
    display: flex;
    flex-direction: column;
    height: 320px;
    max-height: 320px;
}

.scc-widget-content.scc-minimized {
    display: none;
}

.scc-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    max-height: 240px;
}

.scc-chat-message {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.4;
}

.scc-message-header {
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 2px;
}

.scc-message-time {
    font-size: 11px;
    color: #666;
    margin-left: 8px;
}

.scc-message-text {
    color: #333;
    word-wrap: break-word;
}

.scc-system-message {
    font-style: italic;
    color: #666;
    text-align: center;
    padding: 8px;
    background: #e7f3ff;
    border-radius: 4px;
    margin-bottom: 10px;
}

.scc-chat-input-area {
    padding: 15px;
    background: white;
    border-radius: 0 0 8px 8px;
    display: flex;
    gap: 8px;
}

.scc-chat-input-area input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}

.scc-chat-input-area input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.scc-chat-input-area button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.scc-chat-input-area button:hover {
    background: #005a87;
}

.scc-chat-input-area button:active {
    background: #004570;
}

/* Chat-status indikator */
.scc-status-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #0073aa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    transition: all 0.3s ease;
}

.scc-status-indicator:hover {
    background: #005a87;
    transform: scale(1.05);
}

.scc-status-indicator.scc-has-unread {
    animation: scc-pulse 2s infinite;
}

.scc-status-indicator .scc-chat-icon {
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.scc-status-indicator .scc-unread-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3232;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

@keyframes scc-pulse {
    0% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
    50% { box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4); }
    100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
}

/* Responsiv design */
@media (max-width: 480px) {
    .scc-floating-widget {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
    }
    
    .scc-status-indicator {
        width: 50px;
        height: 50px;
    }
    
    .scc-status-indicator .scc-chat-icon {
        font-size: 20px;
    }
}

/* Scrollbar styling */
.scc-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.scc-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.scc-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.scc-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Chat Tabs */
.scc-chat-tabs {
    display: flex;
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
}

.scc-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s ease;
}

.scc-tab-btn:hover {
    background: #e0e0e0;
}

.scc-tab-btn.active {
    background: #0073aa;
    color: white;
}

/* Tab Panels */
.scc-tab-panel {
    display: none;
    flex-direction: column;
    height: 280px;
}

.scc-tab-panel.active {
    display: flex;
}

/* Rooms Panel */
.scc-rooms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.scc-rooms-header h4 {
    margin: 0;
    font-size: 13px;
    color: #333;
}

.scc-rooms-list {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.scc-room-item {
    padding: 8px 12px;
    margin-bottom: 5px;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scc-room-item:hover {
    background: #e0e0e0;
}

.scc-room-item.active {
    background: #0073aa;
    color: white;
}

.scc-room-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.scc-room-name {
    font-size: 13px;
    font-weight: 500;
}

.scc-room-count {
    font-size: 11px;
    opacity: 0.7;
    color: #28a745;
    font-weight: 500;
}

.scc-room-item.active .scc-room-count {
    color: rgba(255, 255, 255, 0.8);
}

.scc-room-arrow {
    font-size: 12px;
    opacity: 0.5;
    margin-left: 8px;
}

/* Friends Panel */
.scc-friends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.scc-friends-header h4 {
    margin: 0;
    font-size: 13px;
    color: #333;
}

.scc-friend-section {
    padding: 10px 15px;
}

.scc-friend-section h5 {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.scc-friend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.scc-friend-info {
    flex: 1;
}

.scc-friend-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.scc-friend-status {
    font-size: 11px;
    color: #666;
}

.scc-friend-actions {
    display: flex;
    gap: 5px;
}

.scc-friend-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
}

.scc-friend-btn.decline {
    background: #dc3232;
}

.scc-friend-btn:hover {
    opacity: 0.8;
}

/* Dialog */
.scc-dialog {
    position: absolute;
    top: 50px;
    left: 10px;
    right: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.scc-dialog h5 {
    margin: 0 0 10px 0;
    font-size: 13px;
}

.scc-dialog input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-bottom: 10px;
}

#scc-search-results {
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.scc-user-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.scc-loading {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Online/Offline status */
.scc-friend-status.online {
    color: #28a745;
}

.scc-friend-status.offline {
    color: #6c757d;
}

/* Disabled buttons */
.scc-friend-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.scc-friend-btn:disabled:hover {
    background: #6c757d;
    opacity: 0.6;
}
