.homework-chat-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.chat-header {
    background: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: #fafafa;
}

.chat-messages.loading {
    opacity: 0.7;
    pointer-events: none;
}

.chat-message {
    margin-bottom: 15px;
    max-width: 80%;
}

.chat-message.own-message {
    margin-left: auto;
}

.chat-message.other-message {
    margin-right: auto;
}

.chat-message.admin-message {
    border-left: 3px solid #0073aa;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.message-header strong {
    color: #333;
}

.message-time {
    color: #666;
    font-size: 0.8em;
}

.message-content {
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.own-message .message-content {
    background: #0073aa;
    color: white;
}

.message-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-file {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.own-message .message-file {
    border-top-color: rgba(255,255,255,0.3);
}

.message-file a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
}

.message-file a:hover {
    text-decoration: underline;
}

.chat-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #ddd;
}

.chat-input textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.file-upload {
    margin: 10px 0;
}

.file-upload-label {
    display: inline-block;
    background: #f8f9fa;
    padding: 8px 12px;
    border: 1px dashed #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.file-upload-label:hover {
    background: #e9ecef;
}

#file-name {
    margin-left: 10px;
    font-size: 0.9em;
    color: #666;
}

.chat-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.submit-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.submit-btn:hover:not(:disabled) {
    background: #005a87;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.refresh-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.refresh-btn:hover {
    background: #f8f9fa;
}

.no-messages {
    text-align: center;
    color: #666;
    padding: 40px;
    font-style: italic;
}

.chat-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    z-index: 10000;
    max-width: 300px;
}

.chat-notification.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.chat-notification.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.chat-notification.info {
    background: #cce7ff;
    color: #004085;
    border: 1px solid #b3d7ff;
}

/* Адаптивность */
@media (max-width: 768px) {
    .chat-messages {
        height: 300px;
    }

    .chat-message {
        max-width: 95%;
    }

    .message-header {
        flex-direction: column;
    }

    .message-time {
        margin-top: 2px;
    }
}