.teams-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    height: 400px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1000;
}

.teams-chat-widget.minimized {
    height: 50px;
}

.teams-chat-widget.closed {
    display: none;
}

.teams-chat-header {
    padding: 15px;
    background: #464775;
    color: white;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.teams-chat-controls {
    display: flex;
    gap: 5px;
}

.teams-chat-minimize,
.teams-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
}

.teams-chat-minimize:hover,
.teams-chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.teams-chat-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.teams-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* User info form styles */
.teams-chat-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.teams-chat-form .form-intro {
    font-size: 14px;
    color: #666;
    margin: 0 0 5px 0;
    line-height: 1.4;
}

.teams-chat-form .form-group {
    width: 100%;
}

.teams-chat-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.teams-chat-form input:focus {
    outline: none;
    border-color: #464775;
}

.teams-chat-form input::placeholder {
    color: #999;
}

.teams-chat-start {
    padding: 12px 20px;
    background: #464775;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-top: 5px;
    transition: background 0.2s;
}

.teams-chat-start:hover:not(:disabled) {
    background: #565995;
}

.teams-chat-start:disabled {
    background: #9999aa;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Dark theme support for form */
:root[data-theme="dark"] .teams-chat-form .form-intro {
    color: #aaa;
}

:root[data-theme="dark"] .teams-chat-form input {
    background: #333;
    border-color: #444;
    color: #fff;
}

:root[data-theme="dark"] .teams-chat-form input::placeholder {
    color: #888;
}

.teams-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.teams-chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

/* User's sent messages - right aligned, dark background */
.teams-chat-message.sending,
.teams-chat-message.sent {
    background: #464775;
    color: white;
    margin-left: auto;
    border-radius: 15px 15px 5px 15px;
}

.teams-chat-message.sending {
    opacity: 0.7;
}

.teams-chat-message.error {
    background: #ffebee;
    border-left: 3px solid #f44336;
    color: #333;
}

/* Received messages from support - left aligned, light background */
.teams-chat-message.received {
    background: #f0f0f0;
    color: #333;
    margin-right: auto;
    border-radius: 15px 15px 15px 5px;
}

.message-content {
    word-wrap: break-word;
}

.message-meta {
    font-size: 0.75em;
    margin-top: 4px;
    opacity: 0.7;
}

.teams-chat-message.sent .message-meta,
.teams-chat-message.sending .message-meta {
    color: rgba(255, 255, 255, 0.7);
    text-align: right;
}

.teams-chat-message.received .message-meta {
    color: #666;
}

.message-from {
    font-weight: bold;
}

.teams-chat-input {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.teams-chat-input textarea {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: none;
    height: 40px;
}

.teams-chat-send {
    padding: 8px 15px;
    background: #464775;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.teams-chat-send:hover {
    background: #565995;
}

.teams-chat-widget.minimized .teams-chat-body {
    display: none;
}

/* Add dark theme support */
:root[data-theme="dark"] .teams-chat-widget {
    background: #2d2d2d;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

:root[data-theme="dark"] .teams-chat-message.sending,
:root[data-theme="dark"] .teams-chat-message.sent {
    background: #565995;
    color: #ffffff;
}

:root[data-theme="dark"] .teams-chat-message.error {
    background: #482c2f;
    border-left: 3px solid #f44336;
    color: #ffffff;
}

:root[data-theme="dark"] .teams-chat-message.received {
    background: #3d3d3d;
    color: #ffffff;
}

:root[data-theme="dark"] .teams-chat-input textarea {
    background: #333333;
    border-color: #444444;
    color: #ffffff;
}

.chat-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background: #464775;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 999;
    display: none;
}

.chat-launcher.visible {
    display: block;
}

.chat-launcher:hover {
    background: #565995;
}
