/* New Message Modal — scoped under .new-message-modal on the root element */
.new-message-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.new-message-modal.show {
    opacity: 1;
    visibility: visible;
}

.new-message-modal .modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 720px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.new-message-modal.show .modal-content {
    transform: scale(1);
}

.new-message-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.new-message-modal .modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
}

.new-message-modal .close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.new-message-modal .close-button:hover {
    background: #f8f9fa;
    color: #495057;
}

.new-message-modal .modal-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    max-height: calc(80vh - 120px);
    overflow-y: auto;
}

.new-message-modal .modal-body > * {
    width: 100%;
    box-sizing: border-box;
}

.new-message-modal .message-input-section {
    margin-bottom: 2rem;
}

.new-message-modal .input-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: #495057;
    font-size: 0.95rem;
}

.new-message-modal .message-textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.new-message-modal .message-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.new-message-modal .message-textarea::placeholder {
    color: #adb5bd;
}

.new-message-modal .character-count {
    text-align: right;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.new-message-modal .actions-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
}

.new-message-modal .actions-section .btn { width: 100%; }

/* ── Desktop ───────────────────────────────────────────────── */
@media (min-width: 769px) {
    .new-message-modal {
        padding-left: 250px;
    }

    .new-message-modal .actions-section {
        flex-direction: row;
        justify-content: flex-end;
    }

    .new-message-modal .actions-section .btn {
        width: auto;
        flex: 1;
    }
}

@media (max-width: 768px) {
    .new-message-modal .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .new-message-modal .modal-header {
        padding: 1rem 1rem 0.75rem 1rem;
    }

    .new-message-modal .modal-body {
        padding: 1rem;
    }

}
