

.frw-im-unread-badge {
    background-color: #d13838;
    color: white;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -5px;
    right: -5px;
    padding: 1px;
}

.bar-im-container {
    display: flex;
    align-items: center;
    margin-left: 4px;
    margin-right: 8px;
    padding-left: 5px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

#frw-im-button {
    display: flex;
    box-sizing: border-box;
    text-decoration: none;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    z-index: 999999;
    font-family: 'Segoe UI', 'Tahoma', 'Verdana', sans-serif;
    font-size: 11px;
    font-weight: 600;
    min-width: 100px;
    height: 32px;
    padding: 4px 12px;
    border-radius: 6px;
    border: none;
    
    
    background: linear-gradient(180deg, 
        #7eb2f5 0%,
        #4a8de8 25%,
        #2776e0 50%,
        #1e6bd8 75%,
        #1760d0 100%
    );
    
    
    position: relative;
    
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    
    
    box-shadow: 
        0 3px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 1px 0 rgba(255, 255, 255, 0.1);
    
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 4px;
}

#frw-im-button::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    height: 50%;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.4) 0%,
        rgba(255, 255, 255, 0.1) 70%,
        transparent 100%
    );
    border-radius: 5px 5px 20px 20px;
    pointer-events: none;
}

#frw-im-button:hover {
    background: linear-gradient(180deg, 
        #8bbcf7 0%,
        #5a9aea 25%,
        #3785e3 50%,
        #2e7adb 75%,
        #276fd3 100%
    );
    
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 10px rgba(30, 107, 216, 0.3);
    
    transform: translateY(-1px);
}

#frw-im-button:active {
    background: linear-gradient(180deg, 
        #5a9aea 0%,
        #3785e3 25%,
        #2776e0 50%,
        #1e6bd8 75%,
        #1760d0 100%
    );
    
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(0, 0, 0, 0.4),
        0 1px 3px rgba(0, 0, 0, 0.2);
    
    transform: translateY(1px);
}

.messenger-button-2007 {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    position: relative;
    z-index: 1;
}

.person-icon-glossy {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 1px rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.2);
}

.person-icon-glossy svg {
    color: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.4));
    width: 14px;
    height: 14px;
}

.messenger-label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
    letter-spacing: 0.3px;
    text-transform: none;
}

.messenger-button-2007 .messages-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
    font-size: 9px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    line-height: 1;
    min-width: 16px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.3);
    animation: notificationBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.bar-im-container .unread-badge,
.messenger-button-2007 .unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
    font-size: 9px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    line-height: 1;
    min-width: 16px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow:
        0 2px 4px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.3);
    animation: notificationBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes notificationBounce {
    0% { 
        transform: scale(0) rotate(45deg); 
        opacity: 0; 
    }
    50% { 
        transform: scale(1.2) rotate(22.5deg); 
    }
    100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 1; 
    }
}

.im-button-content {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.im-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.im-icon {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
    transition: all 0.3s ease;
}

.status-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #4ade80;
    border: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
    transition: all 0.3s ease;
}

#frw-im-button.has-notification {
    background: linear-gradient(180deg,
        #ff7b7b 0%,
        #ff5252 25%,
        #e53935 50%,
        #d32f2f 75%,
        #c62828 100%
    ) !important;
    box-shadow:
        0 0 14px rgba(255, 40, 40, 0.85),
        0 3px 8px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
    animation: imButtonNotifyPulse 2.2s ease-in-out infinite;
}

#frw-im-button.has-notification::before {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.35) 0%,
        rgba(255, 200, 200, 0.12) 60%,
        transparent 100%
    );
}

#frw-im-button.has-notification:hover {
    background: linear-gradient(180deg,
        #ff8a8a 0%,
        #ff6b6b 25%,
        #ef5350 50%,
        #e53935 75%,
        #d32f2f 100%
    ) !important;
    box-shadow:
        0 0 18px rgba(255, 60, 60, 0.95),
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

#frw-im-button.has-notification .messages-badge {
    display: flex !important;
    background: linear-gradient(135deg, #fff5f5, #ffc9c9) !important;
    color: #b71c1c !important;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    animation: notificationBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes imButtonNotifyPulse {
    0%, 100% {
        box-shadow:
            0 0 10px rgba(255, 40, 40, 0.7),
            0 3px 8px rgba(0, 0, 0, 0.35),
            inset 0 1px 0 rgba(255, 255, 255, 0.35);
    }
    50% {
        box-shadow:
            0 0 20px rgba(255, 60, 60, 1),
            0 4px 10px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.45);
    }
}

.im-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.im-label {
    font-size: 12px;
    font-weight: 600;
    color: inherit;
}

.unread-count {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    margin-top: 1px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes ledPulse {
    0% { background-color: #ff0000; box-shadow: 0 0 8px #ff0000, 0 0 15px #ff0000; }
    16.66% { background-color: #ff8800; box-shadow: 0 0 8px #ff8800, 0 0 15px #ff8800; }
    33.33% { background-color: #ffff00; box-shadow: 0 0 8px #ffff00, 0 0 15px #ffff00; }
    50% { background-color: #00ff00; box-shadow: 0 0 8px #00ff00, 0 0 15px #00ff00; }
    66.66% { background-color: #0088ff; box-shadow: 0 0 8px #0088ff, 0 0 15px #0088ff; }
    83.33% { background-color: #8800ff; box-shadow: 0 0 8px #8800ff, 0 0 15px #8800ff; }
    100% { background-color: #ff0000; box-shadow: 0 0 8px #ff0000, 0 0 15px #ff0000; }
}

@keyframes ledRotate {
    0% { transform: rotate(0deg) scale(1.2); }
    25% { transform: rotate(90deg) scale(1.5); }
    50% { transform: rotate(180deg) scale(1.2); }
    75% { transform: rotate(270deg) scale(1.5); }
    100% { transform: rotate(360deg) scale(1.2); }
}

.frw-im-window {
    position: fixed;
    background: white;
    border: 1px solid #666;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    border-radius: 0;
    
    z-index: 99990;
    font-family: Verdana, Arial, sans-serif;
    font-size: 11px;
    min-width: 280px; 
    min-height: 350px; 
    display: flex;
    flex-direction: column;
    resize: both; 
    overflow: hidden; 
}

.frw-im-chat-window {
    
}

.frw-im-window-header {
    background: linear-gradient(to bottom, #3b75c2, #215db0);
    color: white;
    padding: 2px 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
    font-weight: bold;
    font-size: 11px;
    height: 20px;
    flex-shrink: 0; 
}

.frw-im-title {
    display: flex;
    align-items: center;
    gap: 5px;
}

.frw-im-icon {
    width: 16px;
    height: 16px;
}

.frw-im-controls {
    display: flex;
    gap: 2px;
}

.frw-im-controls button {
    background: #5a85c5;
    border: 1px solid #215db0;
    width: 16px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 9px;
    padding: 0;
    line-height: 1;
    margin-left: 1px;
}

.frw-im-controls button:hover {
    background: rgba(255,255,255,0.2);
}

.frw-im-footer {
    height: 50px; 
    background-color: #3b75c2;
    border-top: 1px solid #c3d9ff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    overflow: visible;
    flex-shrink: 0; 
}

.frw-im-logo-area {
    width: 100%;
    height: 50px; 
    background: #3b75c2;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    box-shadow: none;
    padding: 0;
}

.frw-im-logo {
    width: auto; 
    height: auto; 
    max-height: 75px; 
    object-fit: contain;
    display: block;
    margin: 0 auto;
    padding: 0;
    
}
#frw-im-main {
    display: flex;
    flex-direction: column;
    border: 1px solid #215db0;
    background-color: #e8eef7;
    resize: none;
    overflow: hidden;
    width: 220px;
    height: 420px;
    
}

#frw-im-main > .frw-im-window-header {
    flex-shrink: 0; 
}

#frw-im-main > .frw-im-content {
    
    height: calc(100% - 20px - 50px); 
    overflow-y: auto; 
    background-color: transparent; 
    min-height: 0; 
}

#frw-im-main > .frw-im-footer {
    flex-shrink: 0; 
    
}

.frw-im-section-header.collapsible {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.frw-im-section-header.collapsible .frw-im-count {
    font-weight: normal;
    margin-left: 5px;
}

.frw-im-section-header.collapsible .frw-im-collapse-icon {
    font-family: monospace;
    font-weight: bold;
    padding: 0 5px;
}

.frw-im-friend-list-section {
    
}

.frw-im-user-info {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #e3e3e3; 
    background-color: #f2f0f0; 
}

.frw-im-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 3px; 
    margin-right: 8px;
    border: 1px solid #ccc;
}

.frw-im-user-details {
    display: flex;
    flex-direction: column;
}

.frw-im-user-name {
    font-weight: bold;
    color: #333;
}

.frw-im-view-profile {
    font-size: 10px;
    color: #0033cc;
    text-decoration: none;
}
.frw-im-view-profile:hover {
    text-decoration: underline;
}

.frw-im-content {
    padding: 0;
    
    
    background-color: #e8eef7; 
    display: flex;
    flex-direction: column;
    flex-grow: 1; 
    overflow: hidden; 
}

.frw-im-section {
    margin-bottom: 10px;
}

.frw-im-section-header {
    padding: 4px 6px;
    background: #e8eef7;
    border-bottom: 1px solid #c3d9ff;
    color: #215db0;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.frw-im-section-header::before {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    background-color: #c3d9ff;
    margin-right: 5px;
    border: 1px solid #98b0e5;
}

.frw-im-online-friends, 
.frw-im-offline-friends { 
    
    
    
}

.frw-im-friend {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    cursor: pointer;
    border-bottom: 1px solid #c3d9ff;
    font-size: 11px;
    color: #333;
    background-color: #f5faff;
}

.frw-im-friend:hover {
    background-color: #cde3ff;
}

.frw-im-friend-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    flex-shrink: 0;
}

.frw-im-friend-status.online {
    background-image: url('/media/onlinenow.gif');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.frw-im-friend-status.away {
    background-color: #ffcc00; 
}

.frw-im-friend-status.offline {
    background-color: #d13838; 
}

.frw-im-friend-avatar {
    width: 24px;
    height: 24px;
    border-radius: 2px;
    margin-right: 8px;
    flex-shrink: 0;
}

.frw-im-friend-name {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.frw-im-error {
    color: #c00;
    padding: 10px;
    text-align: center;
}

.frw-im-no-friends {
    padding: 10px;
    color: #666;
    text-align: center;
    font-style: italic;
}

.frw-im-chat {
    width: 350px;
    height: 280px;
    display: none;
    border: 1px solid #215db0;
    font-family: Verdana, Arial, sans-serif;
    background-color: #f5faff;
    
    
    min-width: 250px; 
    min-height: 200px; 
}

.frw-im-chat-content { 
    display: flex;
    flex-direction: column;
    height: calc(100% - 26px); 
}

.frw-im-messages {
    flex-grow: 1; 
    overflow-y: auto; 
    padding: 10px; 
    background-color: #e8f1fd; 
    font-size: 11px;
    line-height: 1.4;
    transform: translateZ(0);
    will-change: transform;
}

.frw-im-message-status {
    font-size: 10px;
    color: #215db0;
    text-align: center;
    margin: 5px 0;
    font-style: italic;
}

.frw-im-input-area {
    display: flex; 
    
    padding: 8px 10px; 
    background-color: #f0f6fe; 
    border-top: 1px solid #c3d9ff; 
    flex-shrink: 0; 
    align-items: flex-start; 
}

.frw-im-formatting-toolbar {
    display: flex;
    padding: 3px;
    border-bottom: 1px solid #c3d9ff;
    margin-bottom: 4px;
    background-color: #f0f6fe;
}

.frw-im-formatting-toolbar button {
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 0 5px;
    color: #215db0;
    font-size: 11px;
    height: 20px;
    font-family: Verdana, Arial, sans-serif;
}

.frw-im-formatting-toolbar button:hover {
    background-color: #e8eef7;
}

.frw-im-input {
    flex-grow: 1; 
    resize: none; 
    border: 1px solid #a4bdec;
    border-radius: 2px; 
    padding: 6px 8px; 
    min-height: 38px; 
    font-family: Verdana, Arial, sans-serif;
    font-size: 11px;
    background-color: #ffffff;
    line-height: 1.3;
}

.frw-im-send {
    
    
    padding: 6px 12px; 
    background-color: #e8eef7;
    color: #0033cc;
    border: 1px solid #c3d9ff;
    border-radius: 2px;
    cursor: pointer;
    font-weight: normal;
    font-size: 11px;
    margin-left: 8px; 
    height: 38px; 
}

.frw-im-message {
    margin-bottom: 8px;
    max-width: 80%;
    clear: both;
}

.frw-im-message.sent {
    float: right;
}

.frw-im-message.received {
    float: left;
}

.frw-im-message-bubble {
    padding: 6px 10px;
    border-radius: 10px;
    word-wrap: break-word;
}

.frw-im-message.sent .frw-im-message-bubble {
    background-color: #e8f1fd;
    border: 1px solid #c3d9ff;
    border-radius: 0;
}

.frw-im-message.received .frw-im-message-bubble {
    background-color: #f0f6fe;
    border: 1px solid #c3d9ff;
    border-radius: 0;
}

.frw-im-message-time {
    font-size: 10px;
    color: #999;
    text-align: right;
    margin-top: 2px;
}

.frw-im-no-messages {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #777;
    text-align: center;
    padding: 20px;
}

.frw-im-empty-icon {
    font-size: 36px;
    margin-bottom: 15px;
    animation: frw-bounce 1s ease infinite alternate;
}

.frw-im-no-messages h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #555;
}

.frw-im-no-messages p {
    margin: 0;
    font-size: 14px;
}

.frw-im-error {
    text-align: center;
    color: #d13838;
    padding: 20px;
    font-size: 12px;
}

.frw-im-loading-subtle {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    color: #aaa;
    padding: 5px;
    opacity: 0.7;
}

@keyframes frw-bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

.frw-im-taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 24px;
    background-color: #3b75c2;
    display: none;
    width: 100%;
    z-index: 99980;
    border-top: 1px solid #215db0;
}

.frw-im-taskbar-items {
    display: flex;
    height: 100%;
}

.frw-im-taskbar-item {
    display: flex;
    align-items: center;
    color: white;
    padding: 0 8px;
    cursor: pointer;
    height: 100%;
    max-width: 140px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    background-color: #215db0;
    margin-right: 1px;
    border-bottom: 2px solid transparent;
    font-size: 10px;
}

.frw-im-taskbar-item:hover {
    background-color: #306CBF;
}

.frw-im-taskbar-item.active {
    background-color: #4A90E2;
    border-bottom: 2px solid #FFD700;
}

@media (max-width: 768px) {
    .frw-im-chat-window.frw-im-mobile-fullscreen {
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        position: fixed !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        resize: none !important;
        z-index: 100000 !important; 
        display: flex !important; 
        flex-direction: column !important;
        min-width: 0 !important; 
        min-height: 0 !important;
    }

    
    .frw-im-taskbar {
        display: none !important;
    }

    
    #frw-im-main .frw-im-window-header {
        cursor: default !important;
    }
    
    
    #frw-im-button {
        min-width: 70px !important;
        height: 28px !important;
        padding: 3px 8px !important;
        font-size: 10px !important;
        border-radius: 4px !important;
    }
    
    .person-icon-glossy {
        width: 16px !important;
        height: 16px !important;
    }
    
    .person-icon-glossy svg {
        width: 12px !important;
        height: 12px !important;
    }
    
    .messenger-label {
        font-size: 10px !important;
        letter-spacing: 0.1px !important;
    }
    
    .messenger-button-2007 {
        gap: 6px !important;
    }
    
    .messenger-button-2007 .messages-badge {
        top: -3px !important;
        right: -3px !important;
        padding: 1px 3px !important;
        font-size: 8px !important;
        min-width: 14px !important;
    }
    
    
    #bar-prev, #bar-next {
        display: none !important;
    }
}
