:root {
    --primary-color: #0084ff;
    --secondary-color: #e4e6eb;
    --text-color: #050505;
    --background-color: #ffffff;
    --hover-color: #f2f2f2;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#chat-container {
    position: fixed;
    bottom: 10px;
    right: 60px;
    width: 350px;
    height: 450px;
    background: var(--background-color);
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1000;
}

#chat-container.minimized {
    height: 50px;
    width: 90px;
    opacity: 0.7;
}

#chat-container.minimized:hover {
    opacity: 1;
}

#chat-container.minimized .chat-title {
    display: none;
}

.chat-header {
    padding: 15px;
    background: var(--background-color);
    border-bottom: 1px solid var(--secondary-color);
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.chat-header:hover {
    background: var(--hover-color);
}

.chat-title {
    font-weight: 600;
    color: var(--text-color);
}

.chat-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-mode-switch {
    display: flex;
    align-items: center;
    gap: 5px;
}

.mode-label {
    font-size: 12px;
    color: var(--text-color);
}

.chat-controls button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--text-color);
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--secondary-color);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

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

#messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.message {
    position: relative;
    margin: 10px;
    padding: 10px;
    border-radius: 5px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    background-color: #e3f2fd;
    margin-left: auto;
    margin-right: 10px;
    border-radius: 15px 15px 0 15px;
}

.message.admin, .message.system {
    background-color: #f5f5f5;
    margin-right: auto;
    margin-left: 10px;
    border-radius: 15px 15px 15px 0;
}

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

.message-user {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 5px;
}

.message-image {
    max-width: 100%;
    border-radius: 5px;
    margin-top: 5px;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid var(--secondary-color);
}

.drop-zone {
    border-radius: 20px;
    background: var(--secondary-color);
    padding: 8px;
}

.drop-zone.drag-over {
    background: var(--hover-color);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

#message-input {
    flex: 1;
    border: none;
    background: none;
    resize: none;
    max-height: 100px;
    min-height: 20px;
    padding: 0 5px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--primary-color);
}

.chat-killed {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #DC3545;
    font-weight: bold;
    padding: 20px;
}

@media (max-width: 480px) {
    #chat-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-header {
        border-radius: 0;
    }
}
